Versions in this module Expand all Collapse all v1 v1.5.24 Dec 7, 2020 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 DecryptOpenDataToBodyMap(encryptedData, iv, sessionKey string) (bm gopay.BodyMap, err error) + func DecryptOpenDataToStruct(encryptedData, iv, sessionKey string, beanPtr interface{}) (err error) + func GetAppPaySign(appid, partnerid, noncestr, prepayid, signType, timestamp, apiKey string) (paySign string) + func GetH5PaySign(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 GetSanBoxParamSign(appId, 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 + func GetAppletAccessToken(appId, appSecret string) (accessToken *AccessToken, err error) + 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(accessToken, openid string) (result *CheckAccessTokenRsp, err error) + type Client struct + ApiKey string + AppId string + BaseURL string + DebugSwitch gopay.DebugSwitch + IsProd bool + MchId string + func NewClient(appId, mchId, apiKey string, isProd bool) (client *Client) + func (w *Client) AddCertFilePath(certFilePath, keyFilePath, pkcs12FilePath interface{}) (err error) + func (w *Client) AuthCodeToOpenId(bm gopay.BodyMap) (wxRsp *AuthCodeToOpenIdResponse, err error) + func (w *Client) BatchQueryComment(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp string, err error) + func (w *Client) CloseOrder(bm gopay.BodyMap) (wxRsp *CloseOrderResponse, err error) + func (w *Client) DownloadBill(bm gopay.BodyMap) (wxRsp string, err error) + func (w *Client) DownloadFundFlow(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp string, err error) + func (w *Client) EntrustAppPre(bm gopay.BodyMap) (wxRsp *EntrustAppPreResponse, err error) + func (w *Client) EntrustH5(bm gopay.BodyMap) (wxRsp *EntrustH5Response, err error) + func (w *Client) EntrustPaying(bm gopay.BodyMap) (wxRsp *EntrustPayingResponse, err error) + func (w *Client) EntrustPublic(bm gopay.BodyMap) (wxRsp *EntrustPublicResponse, err error) + func (w *Client) GetRSAPublicKey(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *RSAPublicKeyResponse, err error) + func (w *Client) GetTransferInfo(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *TransfersInfoResponse, err error) + func (w *Client) Micropay(bm gopay.BodyMap) (wxRsp *MicropayResponse, err error) + func (w *Client) MultiProfitSharing(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) PayBank(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *PayBankResponse, err error) + func (w *Client) PostWeChatAPISelf(bm gopay.BodyMap, path string, tlsConfig *tls.Config) (bs []byte, err error) + func (w *Client) ProfitSharing(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) ProfitSharingAddReceiver(bm gopay.BodyMap) (wxRsp *ProfitSharingAddReceiverResponse, err error) + func (w *Client) ProfitSharingFinish(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *ProfitSharingResponse, err error) + func (w *Client) ProfitSharingQuery(bm gopay.BodyMap) (wxRsp *ProfitSharingQueryResponse, err error) + func (w *Client) ProfitSharingRemoveReceiver(bm gopay.BodyMap) (wxRsp *ProfitSharingAddReceiverResponse, err error) + func (w *Client) ProfitSharingReturn(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *ProfitSharingReturnResponse, err error) + func (w *Client) ProfitSharingReturnQuery(bm gopay.BodyMap) (wxRsp *ProfitSharingReturnResponse, err error) + func (w *Client) QueryBank(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *QueryBankResponse, err error) + func (w *Client) QueryOrder(bm gopay.BodyMap) (wxRsp *QueryOrderResponse, resBm gopay.BodyMap, err error) + func (w *Client) QueryRedRecord(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *QueryRedRecordResponse, err error) + func (w *Client) QueryRefund(bm gopay.BodyMap) (wxRsp *QueryRefundResponse, resBm gopay.BodyMap, err error) + func (w *Client) Refund(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *RefundResponse, resBm gopay.BodyMap, err error) + func (w *Client) Report(bm gopay.BodyMap) (wxRsp *ReportResponse, err error) + func (w *Client) Reverse(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *ReverseResponse, err error) + func (w *Client) SendAppletRed(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *SendAppletRedResponse, err error) + func (w *Client) SendCashRed(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *SendCashRedResponse, err error) + func (w *Client) SendGroupCashRed(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *SendCashRedResponse, err error) + func (w *Client) SetCountry(country Country) (client *Client) + func (w *Client) Transfer(bm gopay.BodyMap, certFilePath, keyFilePath, pkcs12FilePath interface{}) (wxRsp *TransfersResponse, err error) + func (w *Client) UnifiedOrder(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 Code2SessionRsp struct + Errcode int + Errmsg string + Openid string + SessionKey string + Unionid string + func Code2Session(appId, appSecret, wxCode string) (sessionRsp *Code2SessionRsp, err error) + type Country int + type EntrustAppPreResponse struct + Appid string + ErrCode string + MchId string + NonceStr string + PreEntrustwebId string + ResultCode string + ReturnCode string + ReturnMsg string + Sign string + SubAppid string + SubMchId 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 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 GetAppLoginAccessToken(appId, appSecret, code string) (accessToken *Oauth2AccessToken, err error) + func GetOauth2AccessToken(appId, appSecret, code string) (accessToken *Oauth2AccessToken, err error) + func RefreshOauth2AccessToken(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(accessToken, openId string, lang ...string) (userInfo *Oauth2UserInfo, err error) + func GetUserInfoOpen(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(appId, mchId, apiKey, authCode, nonceStr string) (openIdRsp *OpenIdByAuthCodeRsp, err error) + type PaidUnionId struct + Errcode int + Errmsg string + Unionid string + func GetAppletPaidUnionId(accessToken, openId, transactionId string) (unionId *PaidUnionId, err error) + 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 []*profitSharingReceiver + 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 + func GetPublicUserInfo(accessToken, openId string, lang ...string) (userInfo *PublicUserInfo, err error) + func GetUserInfo(accessToken, openId string, lang ...string) (userInfo *PublicUserInfo, err error) + type PublicUserInfoBatch struct + UserInfoList []*PublicUserInfo + func GetPublicUserInfoBatch(accessToken string, users *PublicOpenids) (userInfos *PublicUserInfoBatch, err error) + 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 RefreshAppLoginAccessTokenRsp struct + AccessToken string + Errcode int + Errmsg string + ExpiresIn int + Openid string + RefreshToken string + Scope string + func RefreshAppLoginAccessToken(appId, refreshToken string) (accessToken *RefreshAppLoginAccessTokenRsp, err error) + 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