Documentation ¶
Index ¶
- Constants
- type BizErr
- type Client
- func (c *Client) Cancel(ctx context.Context, bm gopay.BodyMap) (rsp *RefundRsp, err error)
- func (c *Client) Close(ctx context.Context, bm gopay.BodyMap) (rsp *CloseRsp, err error)
- func (c *Client) Pay(ctx context.Context, bm gopay.BodyMap) (rsp *PayRsp, err error)
- func (c *Client) Query(ctx context.Context, orderType string, no string) (rsp *ScanPayRsp, err error)
- func (c *Client) Refund(ctx context.Context, bm gopay.BodyMap) (rsp *RefundRsp, err error)
- func (c *Client) ScanPay(ctx context.Context, bm gopay.BodyMap) (rsp *ScanPayRsp, err error)
- func (c *Client) SetHttpClient(client *xhttp.Client)
- func (c *Client) SetOrgId(id string) *Client
- type CloseRsp
- type PayRsp
- type RefundRsp
- type RspBase
- type ScanPayRsp
Constants ¶
const ( RSA = "RSA" SM2 = "SM2" // OrderTypeReqSN 商家自由订单号 OrderTypeReqSN = "reqsn" // OrderTypeTrxId 通联生产支付号 OrderTypeTrxId = "trxid" // PayTypeWXScan 微信扫码支付 PayTypeWXScan = "W01" // PayTypeWXJS 微信JS支付 PayTypeWXJS = "W02" // PayTypeWXMini 微信小程序支付 PayTypeWXMini = "W03" // PayTypeAliScan 支付宝扫码支付 PayTypeAliScan = "A01" // PayTypeAliJS 支付宝JS支付 PayTypeAliJS = "A02" // PayTypeAliApp 支付宝APP支付 PayTypeAliApp = "A03" // PayTypeQQScan 手机QQ扫码支付 PayTypeQQScan = "Q01" // PayTypeQQJS 手机QQ JS支付 PayTypeQQJS = "Q02" // PayTypeUniPay 银联扫码支付(CSB) PayTypeUniPay = "U01" // PayTypeUniJS 银联JS支付 PayTypeUniJS = "U02" // PayTypeNumH5 数字货币H5 PayTypeNumH5 = "S01" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { CusId string // 实际交易商户号 AppId string // 平台分配的APPID SignType string // 签名类型 // contains filtered or unexported fields }
func NewClient ¶
NewClient 初始化通联客户端 cusId:实际交易商户号 appid:平台分配的APPID privateKey:商户的RSA私钥 publicKey:通联的公钥 isProd:是否是正式环境
func (*Client) Cancel ¶
Cancel 统一撤销接口 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=837
func (*Client) Close ¶
Close 订单关闭 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=424
func (*Client) Pay ¶
Pay 统一支付接口 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=88
func (*Client) Query ¶
func (c *Client) Query(ctx context.Context, orderType string, no string) (rsp *ScanPayRsp, err error)
Query 统一查询接口 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=836
func (*Client) Refund ¶
Refund 统一退款接口 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=838
func (*Client) ScanPay ¶
ScanPay 统一扫码接口 https://aipboss.allinpay.com/know/devhelp/main.php?pid=15#mid=89
func (*Client) SetHttpClient ¶ added in v1.5.102
SetHttpClient 设置自定义的xhttp.Client
type PayRsp ¶
type PayRsp struct { RspBase Trxid string `json:"trxid"` ChnlTrxId string `json:"chnltrxid"` Reqsn string `json:"reqsn"` RandomStr string `json:"randomstr"` TrxStatus string `json:"trxstatus"` FinTime string `json:"fintime"` ErrMsg string `json:"errmsg"` PayInfo string `json:"payinfo"` }
PayRsp 通用支付响应
type RefundRsp ¶
type RefundRsp struct { RspBase Trxid string `json:"trxid"` Reqsn string `json:"reqsn"` TrxStatus string `json:"trxstatus"` FinTime string `json:"fintime"` ErrMsg string `json:"errmsg"` Fee string `json:"fee"` TrxCode string `json:"trxCode"` RandomStr string `json:"randomstr"` ChnlTrxId string `json:"chnltrxid"` }
RefundRsp 退款响应
type ScanPayRsp ¶
type ScanPayRsp struct { RspBase Trxid string `json:"trxid"` ChnlTrxId string `json:"chnltrxid"` Reqsn string `json:"reqsn"` TrxStatus string `json:"trxstatus"` Acct string `json:"acct"` TrxCode string `json:"trxcode"` FinTime string `json:"fintime"` ErrMsg string `json:"errmsg"` RandomStr string `json:"randomstr"` InitAmt string `json:"initamt"` TrxAmt string `json:"trxamt"` Fee string `json:"fee"` Cmid string `json:"cmid"` Chnlid string `json:"chnlid"` ChnlData string `json:"chnldata"` AcctType string `json:"accttype"` }
ScanPayRsp 扫码支付、订单查询响应