Documentation ¶
Index ¶
- func NewClient(config model.ClientConfig) model.Client
- func ParseAliClientConfig(config string) (model.ClientConfig, error)
- type Client
- func (a *Client) GetOrder(ctx context.Context, outTradeNo string) (*model.OrderResp, error)
- func (a *Client) Init() error
- func (a *Client) ParseOrderNotify(r []byte) (*model.OrderResp, error)
- func (a *Client) Refresh(config model.ClientConfig) error
- func (a *Client) UnifiedOrder(ctx context.Context, code string, req model.OrderUnifiedReq) (*model.OrderResp, error)
- func (a *Client) UnifiedRefund(ctx context.Context, req model.RefundUnifiedReq) (*model.RefundResp, error)
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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) ParseOrderNotify ¶
func (*Client) UnifiedOrder ¶
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
Click to show internal directories.
Click to hide internal directories.