Documentation ¶
Index ¶
- Constants
- type ClientV3
- func (a *ClientV3) DataBillDownloadUrlQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *DataBillDownloadUrlQueryRsp, err error)
- func (a *ClientV3) DoAliPayAPISelfV3(ctx context.Context, method, path string, bm gopay.BodyMap, aliRsp any) (res *http.Response, err error)
- func (a *ClientV3) FundAuthOperationDetailQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOperationDetailQueryRsp, err error)
- func (a *ClientV3) FundAuthOrderFreeze(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderFreezeRsp, err error)
- func (a *ClientV3) FundAuthOrderUnfreeze(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderUnfreezeRsp, err error)
- func (a *ClientV3) FundAuthOrderVoucherCreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderVoucherCreateRsp, err error)
- func (a *ClientV3) SetAESKey(aesKey string)
- func (a *ClientV3) SetBodySize(sizeMB int)
- func (a *ClientV3) SetCert(appCertContent, alipayRootCertContent, alipayPublicCertContent []byte) (err error)
- func (a *ClientV3) SetHttpClient(client *xhttp.Client)
- func (a *ClientV3) SetLogger(logger xlog.XLogger)
- func (a *ClientV3) SetRequestIdFunc(requestIdFunc xhttp.RequestIdHandler)
- func (a *ClientV3) SystemOauthToken(ctx context.Context, bm gopay.BodyMap) (aliRsp *SystemOauthTokenRsp, err error)
- func (a *ClientV3) TradeCancel(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCancelRsp, err error)
- func (a *ClientV3) TradeClose(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCloseRsp, err error)
- func (a *ClientV3) TradeCreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCreateRsp, err error)
- func (a *ClientV3) TradeFastPayRefundQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeFastPayRefundQueryRsp, err error)
- func (a *ClientV3) TradePay(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradePayRsp, err error)
- func (a *ClientV3) TradePrecreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradePrecreateRsp, err error)
- func (a *ClientV3) TradeQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeQueryRsp, err error)
- func (a *ClientV3) TradeRefund(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeRefundRsp, err error)
- func (a *ClientV3) UserAuthRelationshipQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserAuthRelationshipQueryRsp, err error)
- func (a *ClientV3) UserCertifyOpenInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserCertifyOpenInitializeRsp, err error)
- func (a *ClientV3) UserCertifyOpenQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserCertifyOpenQueryRsp, err error)
- func (a *ClientV3) UserDelOauthDetailQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserDelOauthDetailQueryRsp, err error)
- func (a *ClientV3) UserInfoShare(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserInfoShareRsp, err error)
- type DataBillDownloadUrlQueryRsp
- type DepositBackInfo
- type Detail
- type ErrResponse
- type FundAuthOperationDetailQueryRsp
- type FundAuthOrderFreezeRsp
- type FundAuthOrderUnfreezeRsp
- type FundAuthOrderVoucherCreateRsp
- type FundBill
- type Link
- type OtherContributeDetail
- type RefundChargeInfo
- type RefundDetailItem
- type RefundRoyalty
- type RefundSubFeeDetail
- type RefundVoucherDetail
- type SystemOauthTokenRsp
- type TradeCancelRsp
- type TradeCloseRsp
- type TradeCreateRsp
- type TradeFastPayRefundQueryRsp
- type TradePayRsp
- type TradePrecreateRsp
- type TradeQueryRsp
- type TradeRefundRsp
- type UserAuthRelationshipQueryRsp
- type UserCertifyOpenInitializeRsp
- type UserCertifyOpenQueryRsp
- type UserDelOauthDetail
- type UserDelOauthDetailQueryRsp
- type UserInfoShareRsp
- type VoucherDetail
Constants ¶
const ( Success = http.StatusOK MethodGet = "GET" MethodPost = "POST" MethodPut = "PUT" MethodDelete = "DELETE" MethodPATCH = "PATCH" HeaderAuthorization = "Authorization" HeaderRequestID = "alipay-request-id" HeaderSdkVersion = "alipay-sdk-version" HeaderAppAuthToken = "alipay-app-auth-token" HeaderTimestamp = "alipay-timestamp" HeaderNonce = "alipay-nonce" HeaderSignature = "alipay-signature" SignTypeRSA = "ALIPAY-SHA256withRSA" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientV3 ¶
type ClientV3 struct { AppId string AppCertSN string AliPayPublicCertSN string AliPayRootCertSN string AppAuthToken string IsProd bool DebugSwitch gopay.DebugSwitch // contains filtered or unexported fields }
ClientV3 支付宝 V3
func NewClientV3 ¶
NewClientV3 初始化支付宝客户端 V3 appid:应用ID privateKey:应用私钥,支持PKCS1和PKCS8 isProd:是否是正式环境,沙箱环境请选择新版沙箱应用。
func (*ClientV3) DataBillDownloadUrlQuery ¶
func (a *ClientV3) DataBillDownloadUrlQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *DataBillDownloadUrlQueryRsp, err error)
查询对账单下载地址 StatusCode = 200 is success
func (*ClientV3) DoAliPayAPISelfV3 ¶
func (a *ClientV3) DoAliPayAPISelfV3(ctx context.Context, method, path string, bm gopay.BodyMap, aliRsp any) (res *http.Response, err error)
DoAliPayAPISelfV3 支付宝接口自行实现方法
func (*ClientV3) FundAuthOperationDetailQuery ¶
func (a *ClientV3) FundAuthOperationDetailQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOperationDetailQueryRsp, err error)
资金授权操作查询接口 StatusCode = 200 is success
func (*ClientV3) FundAuthOrderFreeze ¶
func (a *ClientV3) FundAuthOrderFreeze(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderFreezeRsp, err error)
资金授权冻结接口 StatusCode = 200 is success
func (*ClientV3) FundAuthOrderUnfreeze ¶
func (a *ClientV3) FundAuthOrderUnfreeze(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderUnfreezeRsp, err error)
资金授权解冻接口 StatusCode = 200 is success
func (*ClientV3) FundAuthOrderVoucherCreate ¶
func (a *ClientV3) FundAuthOrderVoucherCreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *FundAuthOrderVoucherCreateRsp, err error)
资金授权发码接口 StatusCode = 200 is success
func (*ClientV3) SetAESKey ¶
SetAESKey 设置 biz_content 的AES加密key,设置此参数默认开启 biz_content 参数加密 注意:目前不可用,设置后会报错
func (*ClientV3) SetBodySize ¶
SetBodySize 设置http response body size(MB)
func (*ClientV3) SetCert ¶
func (a *ClientV3) SetCert(appCertContent, alipayRootCertContent, alipayPublicCertContent []byte) (err error)
应用公钥证书内容设置 app_cert_sn、alipay_root_cert_sn、alipay_cert_sn appCertContent:应用公钥证书文件内容 alipayRootCertContent:支付宝根证书文件内容 alipayPublicCertContent:支付宝公钥证书文件内容
func (*ClientV3) SetHttpClient ¶
SetHttpClient 设置自定义的xhttp.Client
func (*ClientV3) SetRequestIdFunc ¶
func (a *ClientV3) SetRequestIdFunc(requestIdFunc xhttp.RequestIdHandler)
设置自定义RequestId生成函数
func (*ClientV3) SystemOauthToken ¶
func (a *ClientV3) SystemOauthToken(ctx context.Context, bm gopay.BodyMap) (aliRsp *SystemOauthTokenRsp, err error)
换取授权访问令牌 StatusCode = 200 is success
func (*ClientV3) TradeCancel ¶
func (a *ClientV3) TradeCancel(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCancelRsp, err error)
统一收单交易撤销接口 StatusCode = 200 is success
func (*ClientV3) TradeClose ¶
func (a *ClientV3) TradeClose(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCloseRsp, err error)
统一收单交易关闭接口 StatusCode = 200 is success
func (*ClientV3) TradeCreate ¶
func (a *ClientV3) TradeCreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeCreateRsp, err error)
统一收单交易创建接口 StatusCode = 200 is success
func (*ClientV3) TradeFastPayRefundQuery ¶
func (a *ClientV3) TradeFastPayRefundQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeFastPayRefundQueryRsp, err error)
统一收单交易退款查询 StatusCode = 200 is success
func (*ClientV3) TradePrecreate ¶
func (a *ClientV3) TradePrecreate(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradePrecreateRsp, err error)
统一收单线下交易预创建 StatusCode = 200 is success
func (*ClientV3) TradeQuery ¶
func (a *ClientV3) TradeQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeQueryRsp, err error)
统一收单交易查询 StatusCode = 200 is success
func (*ClientV3) TradeRefund ¶
func (a *ClientV3) TradeRefund(ctx context.Context, bm gopay.BodyMap) (aliRsp *TradeRefundRsp, err error)
统一收单交易退款接口 StatusCode = 200 is success
func (*ClientV3) UserAuthRelationshipQuery ¶
func (a *ClientV3) UserAuthRelationshipQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserAuthRelationshipQueryRsp, err error)
用户授权关系查询 StatusCode = 200 is success
func (*ClientV3) UserCertifyOpenInitialize ¶
func (a *ClientV3) UserCertifyOpenInitialize(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserCertifyOpenInitializeRsp, err error)
身份认证初始化服务 StatusCode = 200 is success
func (*ClientV3) UserCertifyOpenQuery ¶
func (a *ClientV3) UserCertifyOpenQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserCertifyOpenQueryRsp, err error)
身份认证记录查询 StatusCode = 200 is success
func (*ClientV3) UserDelOauthDetailQuery ¶
func (a *ClientV3) UserDelOauthDetailQuery(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserDelOauthDetailQueryRsp, err error)
查询解除授权明细 StatusCode = 200 is success
func (*ClientV3) UserInfoShare ¶
func (a *ClientV3) UserInfoShare(ctx context.Context, bm gopay.BodyMap) (aliRsp *UserInfoShareRsp, err error)
支付宝会员授权信息查询接口 StatusCode = 200 is success
type DataBillDownloadUrlQueryRsp ¶
type DataBillDownloadUrlQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` BillDownloadUrl string `json:"bill_download_url"` BillFileCode string `json:"bill_file_code"` }
type DepositBackInfo ¶
type ErrResponse ¶
type FundAuthOperationDetailQueryRsp ¶
type FundAuthOperationDetailQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OrderStatus string `json:"order_status"` TotalFreezeAmount string `json:"total_freeze_amount"` RestAmount string `json:"rest_amount"` TotalPayAmount string `json:"total_pay_amount"` OrderTitle string `json:"order_title"` PayerLogonId string `json:"payer_logon_id"` PayerUserId string `json:"payer_user_id"` PayerOpenId string `json:"payer_open_id"` ExtraParam string `json:"extra_param"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` OperationType string `json:"operation_type"` Status string `json:"status"` Remark string `json:"remark"` GmtCreate string `json:"gmt_create"` GmtTrans string `json:"gmt_trans"` PreAuthType string `json:"pre_auth_type"` TransCurrency string `json:"trans_currency"` TotalFreezeCreditAmount string `json:"total_freeze_credit_amount"` TotalFreezeFundAmount string `json:"total_freeze_fund_amount"` TotalPayCreditAmount string `json:"total_pay_credit_amount"` TotalPayFundAmount string `json:"total_pay_fund_amount"` RestCreditAmount string `json:"rest_credit_amount"` RestFundAmount string `json:"rest_fund_amount"` CreditAmount string `json:"credit_amount"` FundAmount string `json:"fund_amount"` CreditMerchantExt string `json:"credit_merchant_ext"` }
type FundAuthOrderFreezeRsp ¶
type FundAuthOrderFreezeRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` PayerUserId string `json:"payer_user_id"` PayerOpenId string `json:"payer_open_id"` Status string `json:"status"` PayerLogonId string `json:"payer_logon_id"` GmtTrans string `json:"gmt_trans"` PreAuthType string `json:"pre_auth_type"` TransCurrency string `json:"trans_currency"` CreditAmount string `json:"credit_amount"` FundAmount string `json:"fund_amount"` }
type FundAuthOrderUnfreezeRsp ¶
type FundAuthOrderUnfreezeRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount float64 `json:"amount"` Status string `json:"status"` GmtTrans string `json:"gmt_trans"` CreditAmount float64 `json:"credit_amount"` FundAmount float64 `json:"fund_amount"` }
type FundAuthOrderVoucherCreateRsp ¶
type FundAuthOrderVoucherCreateRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` OutOrderNo string `json:"out_order_no"` OutRequestNo string `json:"out_request_no"` CodeType string `json:"code_type"` CodeValue string `json:"code_value"` CodeUrl string `json:"code_url"` }
type OtherContributeDetail ¶
type RefundChargeInfo ¶
type RefundChargeInfo struct { RefundChargeFee string `json:"refund_charge_fee"` SwitchFeeRate string `json:"switch_fee_rate"` ChargeType string `json:"charge_type"` RefundSubFeeDetailList []*RefundSubFeeDetail `json:"refund_sub_fee_detail_list"` }
type RefundDetailItem ¶
type RefundRoyalty ¶
type RefundRoyalty struct { RefundAmount string `json:"refund_amount"` RoyaltyType string `json:"royalty_type"` ResultCode string `json:"result_code"` TransOut string `json:"trans_out"` TransOutEmail string `json:"trans_out_email"` TransIn string `json:"trans_in"` TransInEmail string `json:"trans_in_email"` OriTransOut string `json:"ori_trans_out"` OriTransIn string `json:"ori_trans_in"` }
type RefundSubFeeDetail ¶
type RefundVoucherDetail ¶
type RefundVoucherDetail struct { Id string `json:"id"` Name string `json:"name"` Type string `json:"type"` Amount string `json:"amount"` MerchantContribute string `json:"merchant_contribute"` OtherContribute string `json:"other_contribute"` Memo string `json:"memo"` TemplateId string `json:"template_id"` OtherContributeDetail []*OtherContributeDetail `json:"other_contribute_detail"` PurchaseBuyerContribute string `json:"purchase_buyer_contribute"` PurchaseMerchantContribute string `json:"purchase_merchant_contribute"` PurchaseAntContribute string `json:"purchase_ant_contribute"` }
type SystemOauthTokenRsp ¶
type SystemOauthTokenRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` UserId string `json:"user_id"` OpenId string `json:"open_id"` AccessToken string `json:"access_token"` ExpiresIn string `json:"expires_in"` RefreshToken string `json:"refresh_token"` ReExpiresIn string `json:"re_expires_in"` AuthStart string `json:"auth_start"` }
type TradeCancelRsp ¶
type TradeCloseRsp ¶
type TradeCloseRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` }
type TradeCreateRsp ¶
type TradeCreateRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` }
type TradeFastPayRefundQueryRsp ¶
type TradeFastPayRefundQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` OutRequestNo string `json:"out_request_no"` TotalAmount string `json:"total_amount"` RefundAmount string `json:"refund_amount"` RefundStatus string `json:"refund_status"` RefundRoyaltys []*RefundRoyalty `json:"refund_royaltys"` GmtRefundPay string `json:"gmt_refund_pay"` RefundDetailItemList []*RefundDetailItem `json:"refund_detail_item_list"` SendBackFee string `json:"send_back_fee"` DepositBackInfo *DepositBackInfo `json:"deposit_back_info"` RefundHybAmount string `json:"refund_hyb_amount"` RefundChargeInfoList []*RefundChargeInfo `json:"refund_charge_info_list"` DepositBackInfoList []*DepositBackInfo `json:"deposit_back_info_list"` RefundVoucherDetailList []*RefundVoucherDetail `json:"refund_voucher_detail_list"` }
type TradePayRsp ¶
type TradePayRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` BuyerLogonId string `json:"buyer_logon_id"` TotalAmount string `json:"total_amount"` ReceiptAmount string `json:"receipt_amount"` BuyerPayAmount string `json:"buyer_pay_amount"` PointAmount string `json:"point_amount"` InvoiceAmount string `json:"invoice_amount"` GmtPayment string `json:"gmt_payment"` FundBillList []*FundBill `json:"fund_bill_list"` StoreName string `json:"store_name"` DiscountGoodsDetail string `json:"discount_goods_detail"` BuyerUserId string `json:"buyer_user_id"` BuyerOpenId string `json:"buyer_open_id"` VoucherDetailList []*VoucherDetail `json:"voucher_detail_list"` MdiscountAmount string `json:"mdiscount_amount"` DiscountAmount string `json:"discount_amount"` }
type TradePrecreateRsp ¶
type TradePrecreateRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` OutTradeNo string `json:"out_trade_no"` QrCode string `json:"qr_code"` }
type TradeQueryRsp ¶
type TradeQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` BuyerLogonId string `json:"buyer_logon_id"` TradeStatus string `json:"trade_status"` TotalAmount string `json:"total_amount"` BuyerPayAmount string `json:"buyer_pay_amount"` PointAmount string `json:"point_amount"` InvoiceAmount string `json:"invoice_amount"` SendPayDate string `json:"send_pay_date"` ReceiptAmount string `json:"receipt_amount"` StoreId string `json:"store_id"` TerminalId string `json:"terminal_id"` FundBillList []*FundBill `json:"fund_bill_list"` StoreName string `json:"store_name"` BuyerUserId string `json:"buyer_user_id"` BuyerOpenId string `json:"buyer_open_id"` BuyerUserType string `json:"buyer_user_type"` MdiscountAmount string `json:"mdiscount_amount"` DiscountAmount string `json:"discount_amount"` ExtInfos string `json:"ext_infos"` }
type TradeRefundRsp ¶
type TradeRefundRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` BuyerLogonId string `json:"buyer_logon_id"` FundChange string `json:"fund_change"` RefundFee string `json:"refund_fee"` RefundDetailItemList []*RefundDetailItem `json:"refund_detail_item_list"` StoreName string `json:"store_name"` BuyerUserId string `json:"buyer_user_id"` BuyerOpenId string `json:"buyer_open_id"` SendBackFee string `json:"send_back_fee"` RefundHybAmount string `json:"refund_hyb_amount"` RefundChargeInfoList []*RefundChargeInfo `json:"refund_charge_info_list"` RefundVoucherDetailList []*RefundVoucherDetail `json:"refund_voucher_detail_list"` }
type UserAuthRelationshipQueryRsp ¶
type UserAuthRelationshipQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` QueryDetail string `json:"query_detail"` }
type UserCertifyOpenInitializeRsp ¶
type UserCertifyOpenInitializeRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` CertifyId string `json:"certify_id"` }
type UserCertifyOpenQueryRsp ¶
type UserDelOauthDetail ¶
type UserDelOauthDetailQueryRsp ¶
type UserDelOauthDetailQueryRsp struct { StatusCode int `json:"status_code"` ErrResponse ErrResponse `json:"-"` Details []*UserDelOauthDetail `json:"details"` }
type UserInfoShareRsp ¶
type UserInfoShareRsp struct {}
type VoucherDetail ¶
type VoucherDetail struct { Id string `json:"id"` Name string `json:"name"` Type string `json:"type"` Amount string `json:"amount"` MerchantContribute string `json:"merchant_contribute"` OtherContribute string `json:"other_contribute"` Memo string `json:"memo"` TemplateId string `json:"template_id"` PurchaseBuyerContribute string `json:"purchase_buyer_contribute"` PurchaseMerchantContribute string `json:"purchase_merchant_contribute"` PurchaseAntContribute string `json:"purchase_ant_contribute"` }