ali

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(config model.ClientConfig) model.Client

func ParseAliClientConfig

func ParseAliClientConfig(config string) (model.ClientConfig, error)

Types

type Client

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

Client 结构体实现了 PayClient 接口

func (*Client) GetOrder

func (a *Client) GetOrder(ctx context.Context, outTradeNo string) (*model.OrderResp, error)

func (*Client) Init

func (a *Client) Init() error

func (*Client) ParseOrderNotify

func (a *Client) ParseOrderNotify(r []byte) (*model.OrderResp, error)

func (*Client) Refresh

func (a *Client) Refresh(config model.ClientConfig) error

func (*Client) UnifiedOrder

func (a *Client) UnifiedOrder(ctx context.Context, code string, req model.OrderUnifiedReq) (*model.OrderResp, error)

func (*Client) UnifiedRefund

func (a *Client) UnifiedRefund(ctx context.Context, req model.RefundUnifiedReq) (*model.RefundResp, error)

type ClientConfig

type ClientConfig struct {
	AppId                   string `json:"appId"`                            // appId
	SignType                string `json:"signType"`                         // 签名类型
	PrivateKey              string `json:"privateKey"`                       // 应用私钥
	AppPublicContent        []byte `json:"appPublicContent,optional"`        // 应用公钥证书内容
	AlipayPublicContentRSA2 []byte `json:"alipayPublicContentRSA2,optional"` // 支付宝公钥证书内容
	AlipayRootContent       []byte `json:"alipayRootContent,optional"`       // 支付宝根证书内容
	Status                  bool   `json:"status"`                           // 是否启用
}

ClientConfig 实现了 pay.ClientConfig 接口

func (ClientConfig) Validate

func (p ClientConfig) Validate() error

Jump to

Keyboard shortcuts

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