Versions in this module Expand all Collapse all v3 v3.2.2 Sep 22, 2023 Changes in this version type TradeCreate + BuyerOpenId string v3.2.1 Oct 8, 2022 Changes in this version type Trade + ExtUserInfo interface{} v3.2.0 Oct 19, 2021 Changes in this version + const NotifyTypeTradeStatusSync + var ErrAliPublicKeyNotFound = errors.New("alipay: alipay public key not found") + var ErrSignNotFound = errors.New("alipay: sign content not found") + func AckNotification(w http.ResponseWriter) + func NewRequest(method, url string, params url.Values) (*http.Request, error) + type AccessParams struct + Channel string + type AccountAuth struct + AuthType string + Pid string + TargetId string + func (this AccountAuth) APIName() string + func (this AccountAuth) Params() map[string]string + type AgreementExecutionplanModify struct + AgreementNo string + AppAuthToken string + DeductTime string + Memo string + NotifyURL string + func (this AgreementExecutionplanModify) APIName() string + func (this AgreementExecutionplanModify) Params() map[string]string + type AgreementExecutionplanModifyRsp struct + Content struct{ ... } + Sign string + type AgreementPageSign struct + AccessParams *AccessParams + AgreementEffectType string + AppAuthToken string + DeviceParams *DeviceParams + ExternalAgreementNo string + ExternalLogonId string + IdentityParams *IdentityParams + MerchantProcessUrl string + NotifyURL string + PeriodRuleParams *PeriodRuleParams + PersonalProductCode string + ProdParams *ProdParams + ProductCode string + PromoParams string + ReturnURL string + SignScene string + SignValidityPeriod string + SubMerchantParams *SubMerchantParams + ThirdPartyType string + UserAgeRange string + ZmAuthParams *ZmAuthParams + func (this AgreementPageSign) APIName() string + func (this AgreementPageSign) Params() map[string]string + type AgreementPageSignRsp struct + Content struct{ ... } + Sign string + type AgreementParams struct + AgreementNo string + ApplyToken string + AuthConfirmNo string + type AgreementQuery struct + AgreementNo string + AlipayLogonId string + AlipayUserId string + AppAuthToken string + ExternalAgreementNo string + PersonalProductCode string + SignScene string + ThirdPartyType string + func (this AgreementQuery) APIName() string + func (this AgreementQuery) Params() map[string]string + type AgreementQueryRsp struct + Content struct{ ... } + Sign string + type AgreementUnsign struct + AgreementNo string + AlipayLogonId string + AlipayUserId string + AppAuthToken string + ExtendParams string + ExternalAgreementNo string + NotifyURL string + OperateType string + PersonalProductCode string + SignScene string + ThirdPartyType string + func (this AgreementUnsign) APIName() string + func (this AgreementUnsign) Params() map[string]string + type AgreementUnsignRsp struct + Content struct{ ... } + Sign string + type BillBalanceQuery struct + AppAuthToken string + func (this BillBalanceQuery) APIName() string + func (this BillBalanceQuery) Params() map[string]string + type BillBalanceQueryRsp struct + Content struct{ ... } + Sign string + type BillDownloadURLQuery struct + AppAuthToken string + BillDate string + BillType string + func (this BillDownloadURLQuery) APIName() string + func (this BillDownloadURLQuery) Params() map[string]string + type BillDownloadURLQueryRsp struct + Content struct{ ... } + Sign string + type CertDownload struct + AliPayCertSN string + AppAuthToken string + func (this CertDownload) APIName() string + func (this CertDownload) Params() map[string]string + type CertDownloadRsp struct + Content struct{ ... } + Sign string + type CertifyBizCode string + const CertifyBizCodeCertPhoto + const CertifyBizCodeCertPhotoFace + const CertifyBizCodeFace + const CertifyBizCodeSmartFace + type Client struct + Client *http.Client + func New(appId, privateKey string, isProduction bool, opts ...OptionFunc) (client *Client, err error) + func (this *Client) AccountAuth(param AccountAuth) (result string, err error) + func (this *Client) AckNotification(w http.ResponseWriter) + func (this *Client) AgreementExecutionplanModify(param AgreementExecutionplanModify) (result *AgreementExecutionplanModifyRsp, err error) + func (this *Client) AgreementPageSign(param AgreementPageSign) (result *url.URL, err error) + func (this *Client) AgreementQuery(param AgreementQuery) (result *AgreementQueryRsp, err error) + func (this *Client) AgreementUnsign(param AgreementUnsign) (result *AgreementUnsignRsp, err error) + func (this *Client) AppToAppAuth(redirectURI string) (result *url.URL, err error) + func (this *Client) BillBalanceQuery(param BillBalanceQuery) (result *BillBalanceQueryRsp, err error) + func (this *Client) BillDownloadURLQuery(param BillDownloadURLQuery) (result *BillDownloadURLQueryRsp, err error) + func (this *Client) CertDownload(param CertDownload) (result *CertDownloadRsp, err error) + func (this *Client) DoRequest(method string, param Param, result interface{}) (err error) + func (this *Client) FundAccountQuery(param FundAccountQuery) (result *FundAccountQueryRsp, err error) + func (this *Client) FundAuthOperationCancel(param FundAuthOperationCancel) (result *FundAuthOperationCancelRsp, err error) + func (this *Client) FundAuthOperationDetailQuery(param FundAuthOperationDetailQuery) (result *FundAuthOperationDetailQueryRsp, err error) + func (this *Client) FundAuthOrderAppFreeze(param FundAuthOrderAppFreeze) (result string, err error) + func (this *Client) FundAuthOrderFreeze(param FundAuthOrderFreeze) (result *FundAuthOrderFreezeRsp, err error) + func (this *Client) FundAuthOrderUnfreeze(param FundAuthOrderUnfreeze) (result *FundAuthOrderUnfreezeRsp, err error) + func (this *Client) FundAuthOrderVoucherCreate(param FundAuthOrderVoucherCreate) (result *FundAuthOrderVoucherCreateRsp, err error) + func (this *Client) FundTransCommonQuery(param FundTransCommonQuery) (result *FundTransCommonQueryRsp, err error) + func (this *Client) FundTransOrderQuery(param FundTransOrderQuery) (result *FundTransOrderQueryRsp, err error) + func (this *Client) FundTransToAccountTransfer(param FundTransToAccountTransfer) (result *FundTransToAccountTransferRsp, err error) + func (this *Client) FundTransUniTransfer(param FundTransUniTransfer) (result *FundTransUniTransferRsp, err error) + func (this *Client) GetTradeNotification(req *http.Request) (noti *TradeNotification, err error) + func (this *Client) IsProduction() bool + func (this *Client) LoadAliPayPublicCert(s string) error + func (this *Client) LoadAliPayPublicCertFromFile(filename string) error + func (this *Client) LoadAliPayPublicKey(aliPublicKey string) error + func (this *Client) LoadAliPayRootCert(s string) error + func (this *Client) LoadAliPayRootCertFromFile(filename string) error + func (this *Client) LoadAppPublicCert(s string) error + func (this *Client) LoadAppPublicCertFromFile(filename string) error + func (this *Client) NotifyVerify(partnerId, notifyId string) bool + func (this *Client) OpenAuthTokenApp(param OpenAuthTokenApp) (result *OpenAuthTokenAppRsp, err error) + func (this *Client) PublicAppAuthorize(scopes []string, redirectURI, state string) (result *url.URL, err error) + func (this *Client) SystemOauthToken(param SystemOauthToken) (result *SystemOauthTokenRsp, err error) + func (this *Client) TradeAppPay(param TradeAppPay) (result string, err error) + func (this *Client) TradeCancel(param TradeCancel) (result *TradeCancelRsp, err error) + func (this *Client) TradeClose(param TradeClose) (result *TradeCloseRsp, err error) + func (this *Client) TradeCreate(param TradeCreate) (result *TradeCreateRsp, err error) + func (this *Client) TradeFastPayRefundQuery(param TradeFastPayRefundQuery) (result *TradeFastPayRefundQueryRsp, err error) + func (this *Client) TradeOrderInfoSync(param TradeOrderInfoSync) (result *TradeOrderInfoSyncRsp, err error) + func (this *Client) TradeOrderSettle(param TradeOrderSettle) (result *TradeOrderSettleRsp, err error) + func (this *Client) TradePagePay(param TradePagePay) (result *url.URL, err error) + func (this *Client) TradePay(param TradePay) (result *TradePayRsp, err error) + func (this *Client) TradePreCreate(param TradePreCreate) (result *TradePreCreateRsp, err error) + func (this *Client) TradeQuery(param TradeQuery) (result *TradeQueryRsp, err error) + func (this *Client) TradeRefund(param TradeRefund) (result *TradeRefundRsp, err error) + func (this *Client) TradeWapPay(param TradeWapPay) (result *url.URL, err error) + func (this *Client) URLValues(param Param) (value url.Values, err error) + func (this *Client) UserCertifyOpenCertify(param UserCertifyOpenCertify) (result *url.URL, err error) + func (this *Client) UserCertifyOpenInitialize(param UserCertifyOpenInitialize) (result *UserCertifyOpenInitializeRsp, err error) + func (this *Client) UserCertifyOpenQuery(param UserCertifyOpenQuery) (result *UserCertifyOpenQueryRsp, err error) + func (this *Client) UserInfoShare(param UserInfoShare) (result *UserInfoShareRsp, err error) + func (this *Client) VerifySign(data url.Values) (ok bool, err error) + type Code string + const CodeBusinessFailed + const CodeInvalidAuthToken + const CodeInvalidParam + const CodeMissingParam + const CodePermissionDenied + const CodeSuccess + const CodeUnknowError + func (c Code) IsSuccess() bool + type DeviceParams struct + DeviceId string + DeviceName string + DeviceType string + type ErrorRsp struct + Code Code + Msg string + SubCode string + SubMsg string + func (this *ErrorRsp) Error() string + type FundAccountQuery struct + AccountProductCode string + AccountSceneCode string + AccountType string + AliPayUserId string + AppAuthToken string + ExtInfo string + MerchantUserId string + func (this FundAccountQuery) APIName() string + func (this FundAccountQuery) Params() map[string]string + type FundAccountQueryRsp struct + Content struct{ ... } + Sign string + func (this *FundAccountQueryRsp) IsSuccess() bool + type FundAuthOperationCancel struct + AppAuthToken string + AuthNo string + NotifyURL string + OperationId string + OutOrderNo string + OutRequestNo string + Remark string + func (this FundAuthOperationCancel) APIName() string + func (this FundAuthOperationCancel) Params() map[string]string + type FundAuthOperationCancelRsp struct + Content struct{ ... } + Sign string + type FundAuthOperationDetailQuery struct + AppAuthToken string + AuthNo string + OperationId string + OutOrderNo string + OutRequestNo string + func (this FundAuthOperationDetailQuery) APIName() string + func (this FundAuthOperationDetailQuery) Params() map[string]string + type FundAuthOperationDetailQueryRsp struct + Content struct{ ... } + Sign string + type FundAuthOrderAppFreeze struct + Amount string + AppAuthToken string + EnablePayChannels string + ExtraParam string + NotifyURL string + OrderTitle string + OutOrderNo string + OutRequestNo string + PayTimeout string + PayeeLogonId string + PayeeUserId string + ProductCode string + func (this FundAuthOrderAppFreeze) APIName() string + func (this FundAuthOrderAppFreeze) Params() map[string]string + type FundAuthOrderAppFreezeRsp struct + Content struct{ ... } + Sign string + type FundAuthOrderFreeze struct + Amount string + AppAuthToken string + AuthCode string + AuthCodeType string + ExtraParam string + NotifyURL string + OrderTitle string + OutOrderNo string + OutRequestNo string + PayTimeout string + PayeeLogonId string + PayeeUserId string + ProductCode string + func (this FundAuthOrderFreeze) APIName() string + func (this FundAuthOrderFreeze) Params() map[string]string + type FundAuthOrderFreezeRsp struct + Content struct{ ... } + Sign string + type FundAuthOrderUnfreeze struct + Amount string + AppAuthToken string + AuthNo string + ExtraParam string + NotifyURL string + OutRequestNo string + Remark string + func (this FundAuthOrderUnfreeze) APIName() string + func (this FundAuthOrderUnfreeze) Params() map[string]string + type FundAuthOrderUnfreezeRsp struct + Content struct{ ... } + Sign string + type FundAuthOrderVoucherCreate struct + Amount string + AppAuthToken string + EnablePayChannels string + ExtraParam string + NotifyURL string + OrderTitle string + OutOrderNo string + OutRequestNo string + PayTimeout string + PayeeLogonId string + PayeeUserId string + ProductCode string + SettleCurrency string + TransCurrency string + func (this FundAuthOrderVoucherCreate) APIName() string + func (this FundAuthOrderVoucherCreate) Params() map[string]string + type FundAuthOrderVoucherCreateRsp struct + Content struct{ ... } + Sign string + type FundBill struct + Amount string + BankCode string + FundChannel string + RealAmount float64 + type FundTransCommonQuery struct + AppAuthToken string + BizScene string + OrderId string + OutBizNo string + PayFundOrderId string + ProductCode string + func (this FundTransCommonQuery) APIName() string + func (this FundTransCommonQuery) Params() map[string]string + type FundTransCommonQueryRsp struct + Content struct{ ... } + Sign string + func (this *FundTransCommonQueryRsp) IsSuccess() bool + type FundTransOrderQuery struct + AppAuthToken string + OrderId string + OutBizNo string + func (this FundTransOrderQuery) APIName() string + func (this FundTransOrderQuery) Params() map[string]string + type FundTransOrderQueryRsp struct + Content struct{ ... } + Sign string + func (this *FundTransOrderQueryRsp) IsSuccess() bool + type FundTransToAccountTransfer struct + Amount string + AppAuthToken string + OutBizNo string + PayeeAccount string + PayeeRealName string + PayeeType string + PayerShowName string + Remark string + func (this FundTransToAccountTransfer) APIName() string + func (this FundTransToAccountTransfer) Params() map[string]string + type FundTransToAccountTransferRsp struct + Content struct{ ... } + Sign string + func (this *FundTransToAccountTransferRsp) IsSuccess() bool + type FundTransUniTransfer struct + AppAuthToken string + BizScene string + BusinessParams string + OrderTitle string + OriginalOrderId string + OutBizNo string + PayeeInfo *PayeeInfo + ProductCode string + Remark string + TransAmount string + func (this FundTransUniTransfer) APIName() string + func (this FundTransUniTransfer) Params() map[string]string + type FundTransUniTransferRsp struct + Content struct{ ... } + Sign string + func (this *FundTransUniTransferRsp) IsSuccess() bool + type GoodsDetail struct + AliPayGoodsId string + Body string + CategoriesTree string + GoodsCategory string + GoodsId string + GoodsName string + Price float64 + Quantity int + ShowURL string + type GoodsDetailItem struct + AliPayGoodsId string + Body string + GoodsCategory string + GoodsId string + GoodsName string + Price string + Quantity string + ShowUrl string + type IdentityParam struct + CertName string + CertNo string + CertType string + IdentityType string + type IdentityParams struct + CertNo string + IdentityHash string + SignUserId string + UserName string + type MerchantConfig struct + ReturnURL string + type OpenAuthToken struct + AppAuthToken string + AppRefreshToken string + AuthAppId string + ExpiresIn int64 + ReExpiresIn int64 + UserId string + type OpenAuthTokenApp struct + Code string + GrantType string + RefreshToken string + func (this OpenAuthTokenApp) APIName() string + func (this OpenAuthTokenApp) Params() map[string]string + type OpenAuthTokenAppRsp struct + Content struct{ ... } + Sign string + type OptionFunc func(c *Client) + func WithHTTPClient(client *http.Client) OptionFunc + func WithTimeLocation(location *time.Location) OptionFunc + type Param interface + APIName func() string + Params func() map[string]string + type PayeeInfo struct + Identity string + IdentityType string + Name string + type PeriodRuleParams struct + ExecuteTime string + Period string + PeriodType string + SingleAmount string + TotalAmount string + TotalPayments int + type ProdParams struct + AuthBizParams string + type RefundDetailItem struct + Amount string + FundChannel string + RealAmount string + type RoyaltyDetailInfoItem struct + AliPayStoreId string + Amount string + AmountPercentage string + BatchNo string + Desc string + OutRelationId string + SerialNo string + TransIn string + TransInType string + TransOut string + TransOutType string + type RoyaltyInfo struct + RoyaltyDetailInfo []*RoyaltyDetailInfoItem + RoyaltyType string + type RoyaltyParameter struct + Amount float64 + AmountPercentage float64 + Desc string + TransIn string + TransOut string + type SubMerchantItem struct + MerchantId string + type SubMerchantParams struct + SubMerchantId string + SubMerchantName string + SubMerchantServiceDescription string + SubMerchantServiceName string + type SystemOauthToken struct + AppAuthToken string + Code string + GrantType string + RefreshToken string + func (this SystemOauthToken) APIName() string + func (this SystemOauthToken) Params() map[string]string + type SystemOauthTokenRsp struct + Content struct{ ... } + Error ... + Sign string + type Trade struct + AgreementSignParams interface{} + AppAuthToken string + Body string + BusinessParams string + DisablePayChannels string + EnablePayChannels string + ExtendParams map[string]interface{} + GoodsType string + InvoiceInfo string + NotifyURL string + OutTradeNo string + PassbackParams string + ProductCode string + PromoParams string + ReturnURL string + RoyaltyInfo string + SellerId string + SettleInfo string + SpecifiedChannel string + StoreId string + SubMerchant string + Subject string + TimeExpire string + TimeoutExpress string + TotalAmount string + type TradeAppPay struct + GoodsDetail []*GoodsDetail + TimeExpire string + func (this TradeAppPay) APIName() string + func (this TradeAppPay) Params() map[string]string + type TradeCancel struct + AppAuthToken string + NotifyURL string + OutTradeNo string + TradeNo string + func (this TradeCancel) APIName() string + func (this TradeCancel) Params() map[string]string + type TradeCancelRsp struct + Content struct{ ... } + Sign string + func (this *TradeCancelRsp) IsSuccess() bool + type TradeClose struct + AppAuthToken string + NotifyURL string + OperatorId string + OutTradeNo string + TradeNo string + func (this TradeClose) APIName() string + func (this TradeClose) Params() map[string]string + type TradeCloseRsp struct + Content struct{ ... } + Sign string + type TradeCreate struct + BuyerId string + DiscountableAmount string + GoodsDetail []*GoodsDetailItem + OperatorId string + TerminalId string + func (this TradeCreate) APIName() string + func (this TradeCreate) Params() map[string]string + type TradeCreateRsp struct + Content struct{ ... } + Sign string + type TradeFastPayRefundQuery struct + AppAuthToken string + OutRequestNo string + OutTradeNo string + QueryOptions []string + TradeNo string + func (this TradeFastPayRefundQuery) APIName() string + func (this TradeFastPayRefundQuery) Params() map[string]string + type TradeFastPayRefundQueryRsp struct + Content struct{ ... } + Sign string + func (this *TradeFastPayRefundQueryRsp) IsSuccess() bool + type TradeNotification struct + AgreementNo string + AppId string + AuthAppId string + Body string + BuyerId string + BuyerLogonId string + BuyerPayAmount string + Charset string + ExternalAgreementNo string + FundBillList string + GmtClose string + GmtCreate string + GmtPayment string + GmtRefund string + InvoiceAmount string + NotifyId string + NotifyTime string + NotifyType string + OutBizNo string + OutTradeNo string + PassbackParams string + PointAmount string + ReceiptAmount string + RefundFee string + SellerEmail string + SellerId string + Sign string + SignType string + Subject string + TotalAmount string + TradeNo string + TradeStatus TradeStatus + Version string + VoucherDetailList string + type TradeOrderInfoSync struct + AppAuthToken string + BizType string + OrderBizInfo string + OutRequestNo string + TradeNo string + func (this TradeOrderInfoSync) APIName() string + func (this TradeOrderInfoSync) Params() map[string]string + type TradeOrderInfoSyncRsp struct + Content struct{ ... } + Sign string + type TradeOrderSettle struct + AppAuthToken string + OperatorId string + OutRequestNo string + RoyaltyParameters []*RoyaltyParameter + TradeNo string + func (this TradeOrderSettle) APIName() string + func (this TradeOrderSettle) Params() map[string]string + type TradeOrderSettleRsp struct + Content struct{ ... } + Sign string + type TradePagePay struct + AuthToken string + GoodsDetail []*GoodsDetail + QRCodeWidth string + QRPayMode string + func (this TradePagePay) APIName() string + func (this TradePagePay) Params() map[string]string + type TradePay struct + AgreementParams *AgreementParams + AuthCode string + AuthConfirmMode string + AuthNo string + BuyerId string + DiscountableAmount string + GoodsDetail []*GoodsDetailItem + OperatorId string + Scene string + SettleCurrency string + TerminalId string + TerminalParams string + TransCurrency string + func (this TradePay) APIName() string + func (this TradePay) Params() map[string]string + type TradePayRsp struct + Content struct{ ... } + Sign string + func (this *TradePayRsp) IsSuccess() bool + type TradePreCreate struct + DiscountableAmount string + GoodsDetail []*GoodsDetailItem + OperatorId string + TerminalId string + func (this TradePreCreate) APIName() string + func (this TradePreCreate) Params() map[string]string + type TradePreCreateRsp struct + Content struct{ ... } + Sign string + func (this *TradePreCreateRsp) IsSuccess() bool + type TradeQuery struct + AppAuthToken string + OutTradeNo string + QueryOptions []string + TradeNo string + func (this TradeQuery) APIName() string + func (this TradeQuery) Params() map[string]string + type TradeQueryRsp struct + Content struct{ ... } + Sign string + func (this *TradeQueryRsp) IsSuccess() bool + type TradeRefund struct + AppAuthToken string + OperatorId string + OutRequestNo string + OutTradeNo string + RefundAmount string + RefundCurrency string + RefundReason string + StoreId string + TerminalId string + TradeNo string + func (this TradeRefund) APIName() string + func (this TradeRefund) Params() map[string]string + type TradeRefundRsp struct + Content struct{ ... } + Sign string + func (this *TradeRefundRsp) IsSuccess() bool + type TradeSettleDetail struct + Amount string + OperationDate string + OperationSerialNo string + OperationType string + TransIn string + TransOut string + type TradeSettleInfo struct + TradeSettleDetailList []*TradeSettleDetail + type TradeStatus string + const TradeStatusClosed + const TradeStatusFinished + const TradeStatusSuccess + const TradeStatusWaitBuyerPay + type TradeWapPay struct + AuthToken string + QuitURL string + TimeExpire string + func (this TradeWapPay) APIName() string + func (this TradeWapPay) Params() map[string]string + type UserCertifyOpenCertify struct + AppAuthToken string + CertifyId string + func (this UserCertifyOpenCertify) APIName() string + func (this UserCertifyOpenCertify) Params() map[string]string + type UserCertifyOpenCertifyRsp struct + Content struct{ ... } + Sign string + type UserCertifyOpenInitialize struct + AppAuthToken string + BizCode CertifyBizCode + FaceContrastPicture string + IdentityParam IdentityParam + MerchantConfig MerchantConfig + OuterOrderNo string + func (this UserCertifyOpenInitialize) APIName() string + func (this UserCertifyOpenInitialize) Params() map[string]string + type UserCertifyOpenInitializeRsp struct + Content struct{ ... } + Sign string + type UserCertifyOpenQuery struct + AppAuthToken string + CertifyId string + func (this UserCertifyOpenQuery) APIName() string + func (this UserCertifyOpenQuery) Params() map[string]string + type UserCertifyOpenQueryRsp struct + Content struct{ ... } + Sign string + type UserInfoShare struct + AppAuthToken string + AuthToken string + func (this UserInfoShare) APIName() string + func (this UserInfoShare) Params() map[string]string + type UserInfoShareRsp struct + Content struct{ ... } + Sign string + type VoucherDetail struct + Amount string + Id string + Memo string + MerchantContribute string + Name string + OtherContribute string + Type string + type ZmAuthParams struct + BuckleAppId string + BuckleMerchantId string