Versions in this module Expand all Collapse all v0 v0.2.0 Sep 6, 2019 Changes in this version + const BankTypeAbcCredit + const BankTypeAbcDebit + const BankTypeBczDebit + const BankTypeBeebCredit + const BankTypeBeebDebit + const BankTypeBgzbDebit + const BankTypeBhbDebit + const BankTypeBjrcbCredit + const BankTypeBocCredit + const BankTypeBocDebit + const BankTypeBocdDebit + const BankTypeBoshCredit + const BankTypeBoshDebit + const BankTypeBsbCredit + const BankTypeBsbDebit + const BankTypeCcabDebit + const BankTypeCcbCredit + const BankTypeCcbDebit + const BankTypeCebCredit + const BankTypeCebDebit + const BankTypeCibCredit + const BankTypeCibDebit + const BankTypeCiticCredit + const BankTypeCiticDebit + const BankTypeCmbCredit + const BankTypeCmbDebit + const BankTypeCmbcCredit + const BankTypeCmbcDebit + const BankTypeCommCredit + const BankTypeCommDebit + const BankTypeCqbDebit + const BankTypeCrbDebit + const BankTypeGdbCredit + const BankTypeGdbDebit + const BankTypeGdnybCredit + const BankTypeGdnybDebit + const BankTypeGycbCredit + const BankTypeGycbDebit + const BankTypeGzcbCredit + const BankTypeGzcbDebit + const BankTypeGznxDebit + const BankTypeHainnxCredit + const BankTypeHanabDebit + const BankTypeHbcbCredit + const BankTypeHbcbDebit + const BankTypeHbnxCredit + const BankTypeHbnxDebit + const BankTypeHdcbDebit + const BankTypeHebnxDebit + const BankTypeHfbDebit + const BankTypeHkbDebit + const BankTypeHkbeaDebit + const BankTypeHrbbDebit + const BankTypeHzbCredit + const BankTypeHzbDebit + const BankTypeIcbcCredit + const BankTypeIcbcDebit + const BankTypeJcbCredit + const BankTypeJsbCredit + const BankTypeJsbDebit + const BankTypeLnnxDebit + const BankTypeLqt + const BankTypeMasterCardCredit + const BankTypeNbcbCredit + const BankTypeNbcbDebit + const BankTypeNjcbDebit + const BankTypeOrdosbCredit + const BankTypeOrdosbDebit + const BankTypePabCredit + const BankTypePabDebit + const BankTypePsbcCredit + const BankTypePsbcDebit + const BankTypePzhccbDebit + const BankTypeQdccbCredit + const BankTypeQdccbDebit + const BankTypeQhnxDebit + const BankTypeQlbDebit + const BankTypeQsbDebit + const BankTypeRzbDebit + const BankTypeScnxDebit + const BankTypeSdebDebit + const BankTypeSdrcuDebit + const BankTypeShinhanDebit + const BankTypeSjbDebit + const BankTypeSpdbCredit + const BankTypeSpdbDebit + const BankTypeSzrcbCredit + const BankTypeSzrcbDebit + const BankTypeVisaCredit + const BankTypeZzbDebit + const BillTypeAll + const BillTypeRechargeRefund + const BillTypeRefund + const BillTypeSuccess + const CheckNameTypeForceCheck + const CheckNameTypeNoCheck + const CouponTypeCash + const CouponTypeNoCash + const ErrCodeAppIdMchIdNotMatch + const ErrCodeAppIdNotExist + const ErrCodeAuthCodeError + const ErrCodeAuthCodeExpire + const ErrCodeAuthCodeInvalid + const ErrCodeBankError + const ErrCodeBuyerMismatch + const ErrCodeInvalidRequest + const ErrCodeInvalidTransactionId + const ErrCodeLackParams + const ErrCodeMchIdNotExist + const ErrCodeNoAuth + const ErrCodeNotEnough + const ErrCodeNotSuportCard + const ErrCodeNotUtf8 + const ErrCodeOrderClosed + const ErrCodeOrderPaid + const ErrCodeOrderReversed + const ErrCodeOutTradeNoUsed + const ErrCodeParamError + const ErrCodePostDataEmpty + const ErrCodeRefundNotExist + const ErrCodeRequirePostMethod + const ErrCodeSignError + const ErrCodeSystemError + const ErrCodeTradeError + const ErrCodeUserPaying + const ErrCodeXmlFormatError + const FeeTypeCNY + const IsSubscribeNo + const IsSubscribeYes + const LimitPayNoCredit + const ReceiptEnable + const RefundAccountRechargeFunds + const RefundAccountUnsettledFunds + const RefundChannelBalance + const RefundChannelOriginal + const RefundChannelOtherBalance + const RefundChannelOtherBankCard + const RefundRequestSourceApi + const RefundRequestSourceVendorPlatform + const RefundStatusChange + const RefundStatusClose + const RefundStatusProcessing + const RefundStatusSuccess + const ReportMicropayTradeStateCancel + const ReportMicropayTradeStateFail + const ReportMicropayTradeStateOk + const ResponseFail + const ResponseMessageOk + const ResponseSuccess + const ServiceTypeBankServiceProvidor + const ServiceTypeFacilitatorAbroad + const ServiceTypeFacilitatorDomestic + const ServiceTypeNormalAbroad + const ServiceTypeNormalDomestic + const SignTypeHmacSHA256 + const SignTypeMD5 + const TarTypeGzip + const TradeStateClosed + const TradeStateNotPay + const TradeStatePayError + const TradeStateRefund + const TradeStateRevoked + const TradeStateSuccess + const TradeStateUserPaying + const TradeTypeApp + const TradeTypeApplet + const TradeTypeH5 + const TradeTypeJsApi + const TradeTypeMicropay + const TradeTypeNative + func EscapedPath(u string) (path string, err error) + func FormatDateTime(t time.Time) string + func GenerateXml(data map[string]interface{}) string + func GetAppPaySign(appId, nonceStr, partnerId, prepayId, signType, timeStamp, apiKey string) (paySign string) + func GetH5PaySign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func GetMiniPaySign(appId, nonceStr, prepayId, signType, timeStamp, apiKey string) (paySign string) + func GetRandomString(length int) string + func JsonString(m interface{}) string + func PKCS7UnPadding(plainText []byte) []byte + type AccessToken struct + AccessToken string + ErrCode int + ErrMsg string + ExpiresIn int64 + OpenId string + RefreshToken string + Scope string + func GetAuthAccessToken(appId, appSecret, code string) (accessToken AccessToken, err error) + func GetBasicAccessToken(appId, appSecret string) (accessToken AccessToken, err error) + func RefreshAuthAccessToken(appId, refreshToken string) (accessToken AccessToken, err error) + type BodyMap map[string]interface + type ChangeBody struct + Amount int + CheckName string + Desc string + DeviceInfo string + OpenId string + PartnerTradeNo string + ReUserName string + SpbillCreateIP string + type ChangeResponse struct + DeviceInfo string + PartnerTradeNo string + PaymentNo string + PaymentTime string + type Client struct + func NewClient(isProd bool, isMch bool, serviceType int, apiKey string, certFilepath string, ...) (client *Client) + func (c *Client) Change(body ChangeBody) (wxRsp ChangeResponse, err error) + func (c *Client) CloseOrder(body CloseOrderBody) (wxRsp CloseOrderResponse, err error) + func (c *Client) DownloadBill(body DownloadBillBody) (wxRsp string, failRsp *DownloadBillResponse, err error) + func (c *Client) Micropay(body MicropayBody) (wxRsp MicropayResponse, err error) + func (c *Client) OnPayNotify(handler PayNotifyHandler, requestBody []byte) (rspBody string, err error) + func (c *Client) OpenIdByAuthCode(body OpenIdByAuthCodeBody) (wxRsp OpenIdByAuthCodeResponse, err error) + func (c *Client) QueryOrder(body QueryOrderBody) (wxRsp QueryOrderResponse, err error) + func (c *Client) QueryRefund(body QueryRefundBody) (wxRsp QueryRefundResponse, err error) + func (c *Client) Refund(body RefundBody) (wxRsp RefundResponse, err error) + func (c *Client) RefundNotify(handler RefundNotifyHandler, requestBody []byte) (rspBody string, err error) + func (c *Client) ReportJsApi(body ReportJsApiBody) (wxRsp ReportJsApiResponse, err error) + func (c *Client) ReportMicropay(body ReportMicropayBody) (wxRsp ReportMicropayResponse, err error) + func (c *Client) Reverse(body ReverseBody) (wxRsp ReverseResponse, err error) + func (c *Client) UnifiedOrder(body UnifiedOrderBody) (wxRsp UnifiedOrderResponse, err error) + type CloseOrderBody struct + OutTradeNo string + SignType string + type CloseOrderResponse struct + ResultMsg string + type Config struct + AppId string + MchId string + SubAppId string + SubMchId string + type CouponResponseModel struct + CouponFee int64 + CouponId string + CouponType string + func NewCouponResponseModel(doc *etree.Element, idFormat string, typeFormat string, feeFormat string, ...) (m CouponResponseModel) + type DownloadBillBody struct + BillDate string + BillType string + SignType string + TarType string + type DownloadBillResponse struct + ErrCode string + type MchServiceResponseModel struct + ErrCode string + ErrCodeDes string + MchAppId string + MchId string + NonceStr string + ResultCode string + Sign string + type MicropayBody struct + Attach string + AuthCode string + Body string + Detail string + DeviceInfo string + FeeType string + GoodsTag string + LimitPay string + OutTradeNo string + Receipt string + SceneInfo *SceneInfoModel + SceneInfoStr string + SignType string + SpbillCreateIP string + TimeExpire string + TimeStart string + TotalFee int + type MicropayResponse struct + Attach string + BankType string + CashFee int + CashFeeType string + CouponFee int + DeviceInfo string + FeeType string + IsSubscribe string + OpenId string + OutTradeNo string + PromotionDetail string + SettlementTotalFee int + SubIsSubscribe string + SubOpenId string + TimeEnd string + TotalFee int + TradeType string + TransactionId string + type NotifyResponseModel struct + ReturnCode string + ReturnMsg string + func (m *NotifyResponseModel) ToXmlString() string + type OpenIdByAuthCodeBody struct + AuthCode string + SignType string + type OpenIdByAuthCodeResponse struct + OpenId string + SubOpenId string + type PayNotifyBody struct + Attach string + BankType string + CashFee int + CashFeeType string + CouponCount int + CouponFee int + Coupons []CouponResponseModel + DeviceInfo string + FeeType string + IsSubscribe string + OpenId string + OutTradeNo string + SettlementTotalFee int + SubIsSubscribe string + SubOpenId string + TimeEnd string + TotalFee int + TradeType string + TransactionId string + type PayNotifyHandler func(PayNotifyBody) error + type QueryOrderBody struct + OutTradeNo string + SignType string + TransactionId string + type QueryOrderResponse struct + Attach string + BankType string + CashFee int + CashFeeType string + CouponCount int + CouponFee int + Coupons []CouponResponseModel + Detail string + DeviceInfo string + FeeType string + IsSubscribe string + OpenId string + OutTradeNo string + SettlementTotalFee int + SubIsSubscribe string + SubOpenId string + TimeEnd string + TotalFee int + TradeState string + TradeStateDesc string + TradeType string + TransactionId string + type QueryRefundBody struct + Offset string + OutRefundNo string + OutTradeNo string + RefundId string + SignType string + TransactionId string + type QueryRefundResponse struct + CashFee int + CurrentRefunds []QueryRefundResponseCurrentRefund + FeeType string + OutTradeNo string + RefundCount int + SettlementTotalFee int + TotalFee int + TotalRefundCount int + TotalRefunds []QueryRefundResponseTotalRefund + TransactionId string + type QueryRefundResponseCurrentRefund struct + OutRefundNo string + RefundChannel string + RefundId string + type QueryRefundResponseTotalRefund struct + CouponRefundCount int64 + CouponRefundFee int64 + Coupons []CouponResponseModel + RefundAccount string + RefundFee int64 + RefundRecvAccout string + RefundStatus string + RefundSuccessTime string + SettlementRefundFee int64 + type RefundBody struct + NotifyUrl string + OutRefundNo string + OutTradeNo string + RefundAccount string + RefundDesc string + RefundFee int + RefundFeeType string + TotalFee int + TransactionId string + type RefundNotifyBody struct + OutRefundNo string + OutTradeNo string + RefundAccount string + RefundFee int + RefundId string + RefundRecvAccount string + RefundRequestSource string + RefundStatus string + ReqInfo string + SettlementRefundFee int + SettlementTotalFee int + SuccessTime string + TotalFee int + TransactionId string + type RefundNotifyHandler func(RefundNotifyBody) (NotifyResponseModel, error) + type RefundResponse struct + CashFee int + CashRefundFee int + CouponRefundCount int + CouponRefundFee int + FeeType string + OutRefundNo string + OutTradeNo string + RefundCoupons []CouponResponseModel + RefundFee int + RefundId string + SettlementRefundFee int + SettlementTotalFee int + TotalFee int + TransactionId string + type ReportJsApiBody struct + DeviceInfo string + ErrCode string + ErrCodeDes string + ExecuteTime int64 + InterfaceUrl string + OutTradeNo string + ResultCode string + ReturnCode string + ReturnMsg string + SignType string + Time string + UserIp string + type ReportJsApiResponse struct + ResultCode string + type ReportMicropayBody struct + DeviceInfo string + InterfaceUrl string + SignType string + Trades []ReportMicropayBodyTrade + TradesStr string + UserIp string + type ReportMicropayBodyTrade struct + BeginTime string + EndTime string + ErrMsg string + OutTradeNo string + State string + type ReportMicropayResponse struct + ResultCode string + type ResponseBase struct + ErrCode int + ErrMsg string + func CheckAuthAccessToken(accessToken, openId string) (resp ResponseBase, err error) + type ResponseModel struct + RetMsg string + ReturnCode string + ReturnMsg string + type ReverseBody struct + OutTradeNo string + TransactionId string + type ReverseResponse struct + Recall string + type SceneInfoModel struct + Address string + AreaCode string + ID string + Name string + type ServiceResponseModel struct + AppId string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + ResultCode string + Sign string + SubAppId string + SubMchId string + type UnifiedOrderBody struct + Attach string + Body string + Detail string + DeviceInfo string + FeeType string + GoodsTag string + LimitPay string + NotifyUrl string + OpenId string + OutTradeNo string + ProductId string + Receipt string + SceneInfo string + SceneInfoModel *SceneInfoModel + SignType string + SpbillCreateIP string + SubOpenId string + TimeExpire string + TimeStart string + TotalFee int + TradeType string + type UnifiedOrderResponse struct + CodeUrl string + DeviceInfo string + MWebUrl string + PrepayId string + TradeType string + type UserInfo struct + City string + Country string + ErrCode int + ErrMsg string + GroupId int + HeadimgUrl string + Language string + Nickname string + OpenId string + Privilege []string + Province string + QrScene int + QrSceneStr string + Remark string + Sex int + Subscribe int + SubscribeScene string + SubscribeTime int + TagidList []int + UnionId string + func GetAuthUserInfo(accessToken, openId, lang string) (userInfo UserInfo, err error) + func GetBasicUserInfo(accessToken, openId, lang string) (userInfo UserInfo, err error)