Versions in this module Expand all Collapse all v1 v1.5.93 Mar 14, 2023 v1.5.92 Mar 13, 2023 Changes in this version + const China + const China2 + const Other + const SignType_HMAC_SHA256 + const SignType_MD5 + const SoutheastAsia + const TradeType_App + const TradeType_H5 + const TradeType_JsApi + const TradeType_Mini + const TradeType_Native + func GenerateXml(bm gopay.BodyMap) (reqXml string) + func GetAppPaySign(appid, partnerid, noncestr, prepayid, signType, timestamp, apiKey string) (paySign string) + func GetH5PaySign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func GetJsapiPaySign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func GetMiniPaySign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func GetParamSign(appId, mchId, apiKey string, bm gopay.BodyMap) (sign string) + func GetReleaseSign(apiKey string, signType string, bm gopay.BodyMap) (sign string) + func GetSanBoxParamSign(ctx context.Context, appId, mchId, apiKey string, bm gopay.BodyMap) (sign string, err error) + func GetSandBoxSign(ctx context.Context, mchId, apiKey string, bm gopay.BodyMap) (sign string, err error) + func ParseNotifyToBodyMap(req *http.Request) (bm gopay.BodyMap, err error) + func VerifySign(apiKey, signType string, bean interface{}) (ok bool, err error) + type AccessToken struct + AccessToken string + Errcode int + Errmsg string + ExpiresIn int + type AppletUserInfo struct + AvatarUrl string + City string + Country string + Gender int + NickName string + OpenId string + Province string + UnionId string + Watermark *watermarkInfo + type AuthCodeToOpenIdResponse struct + Appid string + ErrCode string + MchId string + NonceStr string + Openid string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + type CheckAccessTokenRsp struct + Errcode int + Errmsg string + func CheckOauth2AccessToken(ctx context.Context, accessToken, openid string) (result *CheckAccessTokenRsp, err error) + type Client struct + ApiKey string + AppId string + BaseURL string + Certificate *tls.Certificate + DebugSwitch gopay.DebugSwitch + IsProd bool + MchId string + func NewClient(appId, mchId, apiKey string, isProd bool) (client *Client) + func (w *Client) AddCertPemFileContent(certFileContent, keyFileContent []byte) (err error) + func (w *Client) AddCertPemFilePath(certFilePath, keyFilePath string) (err error) + func (w *Client) AddCertPkcs12FileContent(p12FileContent []byte) (err error) + func (w *Client) AddCertPkcs12FilePath(pkcs12FilePath string) (err error) + func (w *Client) AuthCodeToOpenId(ctx context.Context, bm gopay.BodyMap) (wxRsp *AuthCodeToOpenIdResponse, err error) + func (w *Client) BatchQueryComment(ctx context.Context, bm gopay.BodyMap) (wxRsp string, err error) + func (w *Client) CloseOrder(ctx context.Context, bm gopay.BodyMap) (wxRsp *CloseOrderResponse, err error) + func (w *Client) CustomsDeclareOrder(ctx context.Context, bm gopay.BodyMap) (wxRsp *CustomsDeclareOrderResponse, err error) + func (w *Client) CustomsDeclareQuery(ctx context.Context, bm gopay.BodyMap) (wxRsp *CustomsDeclareQueryResponse, err error) + func (w *Client) CustomsReDeclareOrder(ctx context.Context, bm gopay.BodyMap) (wxRsp *CustomsReDeclareOrderResponse, err error) + func (w *Client) DownloadBill(ctx context.Context, bm gopay.BodyMap) (wxRsp string, err error) + func (w *Client) DownloadFundFlow(ctx context.Context, bm gopay.BodyMap) (wxRsp string, err error) + func (w *Client) EntrustAppPre(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustAppPreResponse, err error) + func (w *Client) EntrustApplyPay(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustApplyPayResponse, err error) + func (w *Client) EntrustDelete(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustDeleteResponse, err error) + func (w *Client) EntrustH5(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustH5Response, err error) + func (w *Client) EntrustPaying(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustPayingResponse, err error) + func (w *Client) EntrustPublic(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustPublicResponse, err error) + func (w *Client) EntrustQuery(ctx context.Context, bm gopay.BodyMap) (wxRsp *EntrustQueryResponse, err error) + func (w *Client) GetRSAPublicKey(ctx context.Context, bm gopay.BodyMap) (wxRsp *RSAPublicKeyResponse, err error) + func (w *Client) GetTransferInfo(ctx context.Context, bm gopay.BodyMap) (wxRsp *TransfersInfoResponse, err error) + func (w *Client) Micropay(ctx context.Context, bm gopay.BodyMap) (wxRsp *MicropayResponse, err error) + func (w *Client) MultiProfitSharing(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) PayBank(ctx context.Context, bm gopay.BodyMap) (wxRsp *PayBankResponse, err error) + func (w *Client) PostWeChatAPISelf(ctx context.Context, bm gopay.BodyMap, path string, tlsConfig *tls.Config) (bs []byte, err error) + func (w *Client) ProfitSharing(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) ProfitSharingAddReceiver(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingAddReceiverResponse, err error) + func (w *Client) ProfitSharingFinish(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) ProfitSharingQuery(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingQueryResponse, err error) + func (w *Client) ProfitSharingRemoveReceiver(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingAddReceiverResponse, err error) + func (w *Client) ProfitSharingReturn(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingReturnResponse, err error) + func (w *Client) ProfitSharingReturnQuery(ctx context.Context, bm gopay.BodyMap) (wxRsp *ProfitSharingReturnResponse, err error) + func (w *Client) QueryBank(ctx context.Context, bm gopay.BodyMap) (wxRsp *QueryBankResponse, err error) + func (w *Client) QueryOrder(ctx context.Context, bm gopay.BodyMap) (wxRsp *QueryOrderResponse, resBm gopay.BodyMap, err error) + func (w *Client) QueryRedRecord(ctx context.Context, bm gopay.BodyMap) (wxRsp *QueryRedRecordResponse, err error) + func (w *Client) QueryRefund(ctx context.Context, bm gopay.BodyMap) (wxRsp *QueryRefundResponse, resBm gopay.BodyMap, err error) + func (w *Client) Refund(ctx context.Context, bm gopay.BodyMap) (wxRsp *RefundResponse, resBm gopay.BodyMap, err error) + func (w *Client) Report(ctx context.Context, bm gopay.BodyMap) (wxRsp *ReportResponse, err error) + func (w *Client) Reverse(ctx context.Context, bm gopay.BodyMap) (wxRsp *ReverseResponse, err error) + func (w *Client) SendAppletRed(ctx context.Context, bm gopay.BodyMap) (wxRsp *SendAppletRedResponse, err error) + func (w *Client) SendCashRed(ctx context.Context, bm gopay.BodyMap) (wxRsp *SendCashRedResponse, err error) + func (w *Client) SendGroupCashRed(ctx context.Context, bm gopay.BodyMap) (wxRsp *SendCashRedResponse, err error) + func (w *Client) SetBodySize(sizeMB int) + func (w *Client) SetCountry(country Country) (client *Client) + func (w *Client) Transfer(ctx context.Context, bm gopay.BodyMap) (wxRsp *TransfersResponse, err error) + func (w *Client) UnifiedOrder(ctx context.Context, bm gopay.BodyMap) (wxRsp *UnifiedOrderResponse, err error) + type CloseOrderResponse struct + Appid string + DeviceInfo string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + type Country int + type CustomsDeclareOrderResponse struct + Appid string + CertCheckResult string + ErrCode string + ErrCodeDes string + MchId string + ModifyTime string + OutTradeNo string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SignType string + State string + SubOrderId string + SubOrderNo string + TransactionId string + VerifyDepartment string + VerifyDepartmentTradeId string + type CustomsDeclareQueryResponse struct + Appid string + CertCheckResult0 string + CertCheckResult1 string + CertCheckResult2 string + Count string + Customs0 string + Customs1 string + Customs2 string + Duty0 string + Duty1 string + Duty2 string + ErrCode string + ErrCodeDes string + Explanation0 string + Explanation1 string + Explanation2 string + FeeType0 string + FeeType1 string + FeeType2 string + MchCustomsNo0 string + MchCustomsNo1 string + MchCustomsNo2 string + MchId string + ModifyTime0 string + ModifyTime1 string + ModifyTime2 string + OrderFee0 string + OrderFee1 string + OrderFee2 string + ProductFee0 string + ProductFee1 string + ProductFee2 string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + State0 string + State1 string + State2 string + SubOrderId0 string + SubOrderId1 string + SubOrderId2 string + SubOrderNo0 string + SubOrderNo1 string + SubOrderNo2 string + TransactionId string + TransportFee0 string + TransportFee1 string + TransportFee2 string + VerifyDepartment string + VerifyDepartmentTradeId string + type CustomsReDeclareOrderResponse struct + Appid string + ErrCode string + ErrCodeDes string + Explanation string + MchId string + ModifyTime string + OutTradeNo string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SignType string + State string + SubOrderId string + SubOrderNo string + TransactionId string + type EntrustAppPreResponse struct + Appid string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + PreEntrustwebId string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + type EntrustApplyPayResponse struct + Appid string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + type EntrustDeleteResponse struct + Appid string + ContractCode string + ContractId string + ErrCode string + ErrCodeDes string + MchId string + PlanId string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + type EntrustH5Response struct + RedirectUrl string + ResultCode string + ResultMsg string + ReturnCode string + ReturnMsg string + type EntrustPayingResponse struct + Appid string + CodeUrl string + ContractCode string + ContractDisplayAccount string + ContractErrCode string + ContractErrCodeDes string + ContractResultCode string + DeviceInfo string + ErrCode string + ErrCodeDes string + MchId string + MwebUrl string + NonceStr string + OutTradeNo string + PlanId string + PrepayId string + RequestSerial string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + TradeType string + type EntrustPublicResponse struct + ResultCode string + ResultMsg string + ReturnCode string + ReturnMsg string + type EntrustQueryResponse struct + Appid string + ContractCode string + ContractDisplayAccount string + ContractExpiredTime string + ContractId string + ContractSignedTime string + ContractState string + ContractTerminatedTime string + ContractTerminationMode string + ContractTerminationRemark string + ErrCode string + ErrCodeDes string + MchId string + Openid string + PlanId string + RequestSerial string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + type MicropayResponse struct + Appid string + Attach string + BankType string + CashFee string + CashFeeType string + CouponFee string + DeviceInfo string + ErrCode string + ErrCodeDes string + FeeType string + IsSubscribe string + MchId string + NonceStr string + Openid string + OutTradeNo string + PromotionDetail string + ResultCode string + ReturnCode string + ReturnMsg string + SettlementTotalFee string + Sign string + SubAppid string + SubMchId string + TimeEnd string + TotalFee string + TradeType string + TransactionId string + type NotifyRequest struct + Appid string + Attach string + BankType string + CashFee string + CashFeeType string + CouponCount string + CouponFee string + CouponFee0 string + CouponFee1 string + CouponFee2 string + CouponId0 string + CouponId1 string + CouponId2 string + CouponType0 string + CouponType1 string + CouponType2 string + DeviceInfo string + ErrCode string + ErrCodeDes string + FeeType string + IsSubscribe string + MchId string + NonceStr string + Openid string + OutTradeNo string + ResultCode string + ReturnCode string + ReturnMsg string + SettlementTotalFee string + Sign string + SignType string + SubAppid string + SubMchId string + TimeEnd string + TotalFee string + TradeType string + TransactionId string + func ParseNotify(req *http.Request) (notifyReq *NotifyRequest, err error) + type NotifyResponse struct + ReturnCode string + ReturnMsg string + func (w *NotifyResponse) ToXmlString() (xmlStr string) + type Oauth2AccessToken struct + AccessToken string + Errcode int + Errmsg string + ExpiresIn int + Openid string + RefreshToken string + Scope string + Unionid string + func GetOauth2AccessToken(ctx context.Context, appId, appSecret, code string) (accessToken *Oauth2AccessToken, err error) + func RefreshOauth2AccessToken(ctx context.Context, appId, refreshToken string) (accessToken *Oauth2AccessToken, err error) + type Oauth2UserInfo struct + City string + Country string + Headimgurl string + Nickname string + Openid string + Privilege []string + Province string + Sex int + Unionid string + func GetOauth2UserInfo(ctx context.Context, accessToken, openId string, lang ...string) (userInfo *Oauth2UserInfo, err error) + type OpenIdByAuthCodeRsp struct + Appid string + ErrCode string + MchId string + NonceStr string + Openid string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + func GetOpenIdByAuthCode(ctx context.Context, appId, mchId, apiKey, authCode, nonceStr string) (openIdRsp *OpenIdByAuthCodeRsp, err error) + type PaidUnionId struct + Errcode int + Errmsg string + Unionid string + type PayBankResponse struct + Amount string + CmmsAmt string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + PartnerTradeNo string + PaymentNo string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + type ProfitSharingAddReceiverResponse struct + Appid string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + Receiver string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + type ProfitSharingQueryResponse struct + CloseReason string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + OrderId string + OutOrderNo string + Receivers string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + Status string + TransactionId string + type ProfitSharingResponse struct + Appid string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + OrderId string + OutOrderNo string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + TransactionId string + type ProfitSharingReturnResponse struct + Appid string + Description string + ErrCode string + ErrCodeDes string + ErrorMsg string + FailReason string + FinishTime string + MchId string + NonceStr string + OrderId string + OutOrderNo string + OutReturnNo string + Result string + ReturnAccount string + ReturnAccountType string + ReturnAmount string + ReturnCode string + ReturnNo string + Sign string + SubAppid string + SubMchId string + type PublicOpenids struct + UserList []... + type PublicUserInfo struct + City string + Country string + Errcode int + Errmsg string + Groupid int + Headimgurl string + Language string + Nickname string + Openid string + Province string + QrScene int + QrSceneStr string + Remark string + Sex int + Subscribe int + SubscribeScene string + SubscribeTime int + TagidList []int + Unionid string + type PublicUserInfoBatch struct + UserInfoList []*PublicUserInfo + type QueryBankResponse struct + Amount string + BankNoMd5 string + CmmsAmt string + CreateTime string + ErrCode string + ErrCodeDes string + MchId string + PartnerTradeNo string + PaySuccTime string + PaymentNo string + Reason string + ResultCode string + ReturnCode string + ReturnMsg string + Status string + TrueNameMd5 string + type QueryOrderResponse struct + Appid string + Attach string + BankType string + CashFee string + CashFeeType string + CouponCount string + CouponFee string + CouponFee0 string + CouponFee1 string + CouponFee2 string + CouponId0 string + CouponId1 string + CouponId2 string + CouponType0 string + CouponType1 string + CouponType2 string + DeviceInfo string + ErrCode string + ErrCodeDes string + FeeType string + IsSubscribe string + MchId string + NonceStr string + Openid string + OutTradeNo string + ResultCode string + ReturnCode string + ReturnMsg string + SettlementTotalFee string + Sign string + SubAppid string + SubMchId string + TimeEnd string + TotalFee string + TradeState string + TradeStateDesc string + TradeType string + TransactionId string + type QueryRedRecordResponse struct + ActName string + DetailId string + ErrCode string + ErrCodeDes string + HbType string + Hblist *hbList + MchBillno string + MchId string + Reason string + RefundAmount string + RefundTime string + Remark string + ResultCode string + ReturnCode string + ReturnMsg string + SendTime string + SendType string + Status string + TotalAmount string + TotalNum string + Wishing string + type QueryRefundResponse struct + Appid string + CashFee string + CouponRefundCount0 string + CouponRefundCount1 string + CouponRefundCount2 string + CouponRefundFee0 string + CouponRefundFee00 string + CouponRefundFee01 string + CouponRefundFee1 string + CouponRefundFee10 string + CouponRefundFee11 string + CouponRefundFee2 string + CouponRefundFee20 string + CouponRefundFee21 string + CouponRefundFee22 string + CouponRefundId00 string + CouponRefundId01 string + CouponRefundId10 string + CouponRefundId11 string + CouponRefundId20 string + CouponRefundId21 string + CouponRefundId22 string + CouponType00 string + CouponType01 string + CouponType10 string + CouponType11 string + CouponType20 string + CouponType21 string + CouponType22 string + ErrCode string + ErrCodeDes string + FeeType string + MchId string + NonceStr string + OutRefundNo0 string + OutRefundNo1 string + OutRefundNo2 string + OutTradeNo string + RefundAccount0 string + RefundAccount1 string + RefundAccount2 string + RefundChannel0 string + RefundChannel1 string + RefundChannel2 string + RefundCount string + RefundFee string + RefundFee0 string + RefundFee1 string + RefundFee2 string + RefundId0 string + RefundId1 string + RefundId2 string + RefundRecvAccout0 string + RefundRecvAccout1 string + RefundRecvAccout2 string + RefundStatus0 string + RefundStatus1 string + RefundStatus2 string + RefundSuccessTime0 string + RefundSuccessTime1 string + RefundSuccessTime2 string + ResultCode string + ReturnCode string + ReturnMsg string + SettlementRefundFee0 string + SettlementRefundFee1 string + SettlementRefundFee2 string + SettlementTotalFee string + Sign string + SubAppid string + SubMchId string + TotalFee string + TotalRefundCount string + TransactionId string + type RSAPublicKeyResponse struct + ErrCode string + ErrCodeDes string + MchId string + PubKey string + ResultCode string + ReturnCode string + ReturnMsg string + type RefundNotify struct + OutRefundNo string + OutTradeNo string + RefundAccount string + RefundFee string + RefundId string + RefundRecvAccout string + RefundRequestSource string + RefundStatus string + SettlementRefundFee string + SettlementTotalFee string + SuccessTime string + TotalFee string + TransactionId string + func DecryptRefundNotifyReqInfo(reqInfo, apiKey string) (refundNotify *RefundNotify, err error) + type RefundNotifyRequest struct + Appid string + MchId string + NonceStr string + ReqInfo string + ReturnCode string + ReturnMsg string + SubAppid string + SubMchId string + func ParseRefundNotify(req *http.Request) (notifyReq *RefundNotifyRequest, err error) + type RefundResponse struct + Appid string + CashFee string + CashFeeType string + CashRefundFee string + CouponRefundCount string + CouponRefundFee string + CouponRefundFee0 string + CouponRefundFee1 string + CouponRefundFee2 string + CouponRefundId0 string + CouponRefundId1 string + CouponRefundId2 string + CouponType0 string + CouponType1 string + CouponType2 string + ErrCode string + ErrCodeDes string + FeeType string + MchId string + NonceStr string + OutRefundNo string + OutTradeNo string + RefundFee string + RefundId string + ResultCode string + ReturnCode string + ReturnMsg string + SettlementRefundFee string + SettlementTotalFee string + Sign string + SubAppid string + SubMchId string + TotalFee string + TransactionId string + type ReportResponse struct + ResultCode string + ReturnCode string + ReturnMsg string + type ReverseResponse struct + Appid string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + Recall string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + type SendAppletRedResponse struct + ErrCode string + ErrCodeDes string + MchBillno string + MchId string + Packages string + ReOpenid string + ResultCode string + ReturnCode string + ReturnMsg string + SendListid string + TotalAmount string + Wxappid string + type SendCashRedResponse struct + ErrCode string + ErrCodeDes string + MchBillno string + MchId string + ReOpenid string + ResultCode string + ReturnCode string + ReturnMsg string + SendListid string + TotalAmount string + Wxappid string + type TransfersInfoResponse struct + Appid string + Desc string + DetailId string + ErrCode string + ErrCodeDes string + MchId string + Openid string + PartnerTradeNo string + PaymentAmount string + PaymentTime string + Reason string + ResultCode string + ReturnCode string + ReturnMsg string + Status string + SubAppid string + SubMchId string + TransferName string + TransferTime string + type TransfersResponse struct + DeviceInfo string + ErrCode string + ErrCodeDes string + MchAppid string + Mchid string + NonceStr string + PartnerTradeNo string + PaymentNo string + PaymentTime string + ResultCode string + ReturnCode string + ReturnMsg string + type UnifiedOrderResponse struct + Appid string + CodeUrl string + DeviceInfo string + ErrCode string + ErrCodeDes string + MchId string + MwebUrl string + NonceStr string + PrepayId string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId string + TradeType string + type UserPhone struct + CountryCode string + PhoneNumber string + PurePhoneNumber string + Watermark *watermarkInfo