alipay

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c Config) *Client

func (*Client) DecodeNotification

func (c *Client) DecodeNotification(form url.Values) (*Notification, error)

func (*Client) PreCreateTrade

func (c *Client) PreCreateTrade(ctx context.Context, order Order) (string, error)

func (*Client) QueryTrade

func (c *Client) QueryTrade(ctx context.Context, orderNo string) (Status, error)

type Config

type Config struct {
	AppId       string
	PrivateKey  string
	PublicKey   string
	InvoiceName string
	NotifyURL   string
	Sandbox     bool
}

type Notification

type Notification struct {
	OrderNo string
	Amount  int64
	Status  Status
}

type Order

type Order struct {
	OrderNo string
	Amount  int64
}

type Status

type Status string
const (
	Success  Status = "TRADE_SUCCESS"
	Pending  Status = "WAIT_BUYER_PAY"
	Closed   Status = "TRADE_CLOSED"
	Finished Status = "TRADE_FINISHED"
	Error    Status = "TRADE_ERROR"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL