Versions in this module Expand all Collapse all v1 v1.1.5 Aug 21, 2021 Changes in this version + type MsgBuilder struct + func (msgBuilder *MsgBuilder) CreateReplyArticlesMsg(FromUserName string, ToUserName string, Url string, PicUrl string, ...) WxMpReplyArticlesMsg + func (msgBuilder *MsgBuilder) CreateReplyImageMsg(FromUserName string, ToUserName string, MediaId string) WxMpReplyImageMsg + func (msgBuilder *MsgBuilder) CreateReplyMusicMsg(FromUserName string, ToUserName string, MusicUrl string, HQMusicUrl string, ...) WxMpReplyMusicMsg + func (msgBuilder *MsgBuilder) CreateReplyTextMsg(FromUserName string, ToUserName string, Content string) WxMpReplyTextMsg + func (msgBuilder *MsgBuilder) CreateReplyVideoMsg(FromUserName string, ToUserName string, MediaId string, Title string, ...) WxMpReplyVideoMsg + func (msgBuilder *MsgBuilder) CreateReplyVoiceMsg(FromUserName string, ToUserName string, MediaId string) WxMpReplyVoiceMsg + type WeChatMpBaseMsg struct + CreateTime string + FromUserName string + MsgId string + MsgType string + ToUserName string + type WxMpEventClick struct + type WxMpEventLocation struct + Event string + Latitude string + Longitude string + Precision string + type WxMpEventQrscene struct + Event string + EventKey string + type WxMpEventScan struct + type WxMpEventView struct + type WxMpLinkMsg struct + Description string + Title string + Url string + type WxMpLocationMsg struct + Label string + LocationX string + LocationY string + Scale string + type WxMpPicMsg struct + MediaId string + PicUrl string + type WxMpReplyArticlesMsg struct + ArticleCount int + Articles struct{ ... } + CreateTime string + FromUserName string + MsgType string + ToUserName string + XMLName xml.Name + type WxMpReplyImageMsg struct + CreateTime string + FromUserName string + Image struct{ ... } + MsgType string + ToUserName string + XMLName xml.Name + type WxMpReplyMusicMsg struct + CreateTime string + FromUserName string + MsgType string + Music struct{ ... } + ToUserName string + XMLName xml.Name + type WxMpReplyTextMsg struct + Content string + CreateTime string + FromUserName string + MsgType string + ToUserName string + XMLName xml.Name + type WxMpReplyVideoMsg struct + CreateTime string + FromUserName string + MsgType string + ToUserName string + Video struct{ ... } + XMLName xml.Name + type WxMpReplyVoiceMsg struct + CreateTime string + FromUserName string + MsgType string + ToUserName string + Voice struct{ ... } + XMLName xml.Name + type WxMpShortVideoMsg struct + type WxMpTextMsg struct + Content string + type WxMpVideoMsg struct + Format string + MediaId string + ThumbMediaId string + type WxMpVoiceMsg struct + Format string + MediaId string + Recognition string v1.1.4 Aug 16, 2021 Changes in this version + const ServiceTypeBankServiceProvidor + const ServiceTypeFacilitatorAbroad + const ServiceTypeFacilitatorDomestic + const ServiceTypeNormalAbroad + const ServiceTypeNormalDomestic + const SignTypeHmacSHA256 + const SignTypeMD5 + const TradeTypeApp + const TradeTypeH5 + const TradeTypeJsApi + const TradeTypeMicropay + const TradeTypeMiniApp + const TradeTypeNative + var FuncGenerateRandomString func(int) string = generateRandomString + var WxMpAPIURL = "https://api.weixin.qq.com" + var WxMpOpenURL = "https://open.weixin.qq.com" + var WxMpWeiXinURL = "https://mp.weixin.qq.com" + var WxPayAppURL = "https://payapp.weixin.qq.com" + var WxPayMchAPIURL = "https://api.mch.weixin.qq.com" + var WxPayReporMchtURL = "http://report.mch.weixin.qq.com" + var WxPaySanBoxAPIURL = "https://api.mch.weixin.qq.com/sandboxnew" + var WxQyAPIURL = "https://qyapi.weixin.qq.com" + func WxJSSDKTicketSign(nonceStr, ticket, timeStamp, url string) (ticketSign string) + func WxMpQrShowQrCodeUrl(wxMpConfig IWxMpConfig, ticket string) (string, error) + func WxMpSubscribeMsgURL(body *WxMpSubscribeMsgURLBody) (string, error) + func WxMpWrapAuthorizeURL(wxMpConfig IWxMpConfig, redirectUri string, snsapiBase bool) (string, error) + func WxPayAppSign(appId, nonceStr, partnerId, prepayId, signType, timeStamp, apiKey string) (paySign string) + func WxPayJSAPISign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func WxPayMaSign(appId, nonceStr, packages, signType, timeStamp, apiKey string) (paySign string) + func WxPayNotifyPay(wxPayConfig IWxPayConfig, requestBody []byte, ...) (rspBody string, err error) + type IWxConfig interface + GetAccessToken func() string + GetAppId func() string + GetId func() string + GetSecret func() string + type IWxMaConfig interface + type IWxMpConfig interface + GetAesKey func() string + GetOauth2 func() bool + GetToken func() string + type IWxPayConfig interface + GetAPIKey func() string + GetCertificateFile func() string + GetMchId func() string + GetNotifyUrl func() string + GetServiceType func() int + GetSignType func() string + GetSubAppId func() string + GetSubMchId func() string + IsProd func() bool + type ResponseBase struct + ErrCode int + ErrMsg string + func WxMaCodeGetUnlimited(wxMaConfig IWxMaConfig, body *WxMaCodeGetUnlimitedBody) ([]byte, *ResponseBase, error) + func WxMaSubscribeMessageSend(wxMaConfig IWxMaConfig, body *WxMaTemplateMsgSendBody) (*ResponseBase, error) + type SessionKey struct + ErrCode int + ErrMsg string + OpenId string + SessionKey string + UnionId string + func WxMaCode2Session(wxMaConfig IWxMaConfig, jsCode string) (*SessionKey, error) + type WxAccessToken struct + AccessToken string + AccessTokenExpiresTime int64 + ErrCode int + ErrMsg string + ExpiresIn int + OpenId string + RefreshToken string + Scope string + func GetAccessToken(wxConfig IWxConfig) (*WxAccessToken, error) + func WxMpWebAuthAccessToken(wxMpConfig IWxMpConfig, code string) (*WxAccessToken, error) + func WxMpWebAuthRefreshAccessToken(wxMpConfig IWxMpConfig, refreshToken string) (*WxAccessToken, error) + func (wxAccessToken *WxAccessToken) IsAccessTokenExpired() bool + type WxCardTicket struct + CardTicket string + CardTicketExpiresTime int64 + ErrCode int + ErrMsg string + ExpiresIn int + func GetCardTicket(wxConfig IWxConfig) (*WxCardTicket, error) + func (wxCardTicket *WxCardTicket) IsCardTicketExpired() bool + type WxJsTicket struct + ErrCode int + ErrMsg string + ExpiresIn int + JsTicket string + JsTicketExpiresTime int64 + func GetJsTicket(wxConfig IWxConfig) (*WxJsTicket, error) + func (wxJsTicket *WxJsTicket) IsJsTicketExpired() bool + type WxMaAuthGetPaidUnionIdResponse struct + ErrCode int + ErrMsg string + UnionId string + func WxMaAuthGetPaidUnionId(wxMaConfig IWxMaConfig, openId string) (*WxMaAuthGetPaidUnionIdResponse, error) + type WxMaCodeGetUnlimitedBody struct + AutoColor bool + IsHyaline bool + LineColorB uint8 + LineColorG uint8 + LineColorR uint8 + Page string + Scene string + Width int64 + type WxMaTemplateMsgSendBody struct + Lang string + MiniprogramState string + Page string + TemplateId string + Touser string + func (wxMaTemplateMsg *WxMaTemplateMsgSendBody) AddData(key string, value string) + type WxMpQrCreateResponse struct + ExpireSeconds int + Ticket string + URL string + func WxMpQrCreatePermanent(wxMpConfig IWxMpConfig, sceneStr string) (*WxMpQrCreateResponse, error) + func WxMpQrCreateTemporary(wxMpConfig IWxMpConfig, sceneStr string, expireSeconds int) (*WxMpQrCreateResponse, error) + type WxMpSubscribeMsgSendBody struct + Scene string + Title string + func (wxMpTemplateMsg *WxMpSubscribeMsgSendBody) AddData(key string, value string, color string) + type WxMpSubscribeMsgURLBody struct + AppId string + RedirectURL string + Reserved string + Scene string + TemplateId string + type WxMpTemplateMsgSendBody struct + EmphasisKeyword string + func (wxMpTemplateMsg *WxMpTemplateMsgSendBody) AddData(key string, value string, color string) + type WxMpTemplateMsgSendResponse struct + ErrCode int + ErrMsg string + MsgId int64 + func WxMpSubscribeMsgSend(wxMpConfig IWxMpConfig, body *WxMpSubscribeMsgSendBody) (*WxMpTemplateMsgSendResponse, error) + func WxMpTemplateMsgSend(wxMpConfig IWxMpConfig, body *WxMpTemplateMsgSendBody) (*WxMpTemplateMsgSendResponse, error) + type WxMpUserInfo 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 WxMpGetUserInfo(wxMpConfig IWxMpConfig, openId, lang string) (*WxMpUserInfo, error) + type WxMpUserOpenIds struct + Count int + Data map[string][]string + ErrCode int + ErrMsg string + NextOpenid string + Total int + func WxMpGetUserOpenIds(wxMpConfig IWxMpConfig, openId string) (*WxMpUserOpenIds, error) + type WxPayCloseOrderBody struct + OutTradeNo string + SignType string + type WxPayCloseOrderResponse struct + ResultMsg string + func WxPayCloseOrder(wxPayConfig IWxPayConfig, body *WxPayCloseOrderBody) (*WxPayCloseOrderResponse, error) + type WxPayCouponResponseModel struct + CouponFee int64 + CouponId string + CouponType string + type WxPayDownloadBillBody struct + BillDate string + BillType string + SignType string + TarType string + type WxPayDownloadBillResponse struct + ErrCode string + func WxPayDownloadBill(wxPayConfig IWxPayConfig, body *WxPayDownloadBillBody) (*WxPayDownloadBillResponse, error) + type WxPayGetHBInfoBody struct + BillType string + MchBillno string + type WxPayGetHBInfoResponse struct + ActName string + Amount int + DetailId string + ErrCode string + ErrCodeDes string + HBList []WxPayHBInfoModel + HBType string + MchBillno string + MchId string + Openid string + RcvTime string + Reason string + RefundAmount int + RefundTime string + Remark string + ResultCode string + ReturnCode string + ReturnMsg string + SendTime string + SendType string + Status string + TotalAmount int + TotalNum int + Wishing string + func WxPayGetHBInfo(wxPayConfig IWxPayConfig, body *WxPayGetHBInfoBody) (*WxPayGetHBInfoResponse, error) + type WxPayHBInfoModel struct + Amount int + Openid string + RcvTime string + type WxPayMchServiceResponseModel struct + ErrCode string + ErrCodeDes string + MchAppId string + MchId string + NonceStr string + ResultCode string + Sign string + type WxPayMicropayBody struct + Attach string + AuthCode string + Body string + Detail string + DeviceInfo string + FeeType string + GoodsTag string + LimitPay string + OutTradeNo string + Receipt string + SceneInfo *WxPaySceneInfoModel + SceneInfoStr string + SignType string + SpbillCreateIP string + TimeExpire string + TimeStart string + TotalFee int + type WxPayMicropayResponse 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 + func WxPayMicropay(wxPayConfig IWxPayConfig, body *WxPayMicropayBody) (*WxPayMicropayResponse, error) + type WxPayNotifyPayBody struct + Attach string + BankType string + CashFee int + CashFeeType string + CouponCount int + CouponFee int + Coupons []WxPayCouponResponseModel + 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 WxPayPartnerResponseModel struct + AppId string + ErrCode string + ErrCodeDes string + MchId string + NonceStr string + ResultCode string + Sign string + SubAppId string + SubMchId string + type WxPayPromotionMktTransfersBody struct + Amount int + CheckName string + Desc string + DeviceInfo string + OpenId string + PartnerTradeNo string + ReUserName string + SpbillCreateIP string + type WxPayPromotionMktTransfersResponse struct + DeviceInfo string + PartnerTradeNo string + PaymentNo string + PaymentTime string + func WxPayPromotionMktTransfers(wxPayConfig IWxPayConfig, body *WxPayPromotionMktTransfersBody) (*WxPayPromotionMktTransfersResponse, error) + type WxPayQueryMktTransferBody struct + PartnerTradeNo string + type WxPayQueryMktTransferResponse struct + Desc string + DetailId string + OpenId string + PartnerTradeNo string + PaymentAmount int64 + PaymentTime string + Reason string + Status string + TransferName string + TransferTime string + func WxPayQueryMktTransfer(wxPayConfig IWxPayConfig, body *WxPayQueryMktTransferBody) (*WxPayQueryMktTransferResponse, error) + type WxPayQueryOrderBody struct + OutTradeNo string + SignType string + TransactionId string + type WxPayQueryOrderResponse struct + Attach string + BankType string + CashFee int + CashFeeType string + CouponCount int + CouponFee int + Coupons []WxPayCouponResponseModel + 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 + func WxPayQueryOrder(wxPayConfig IWxPayConfig, body *WxPayQueryOrderBody) (*WxPayQueryOrderResponse, error) + type WxPayQueryRefundBody struct + Offset string + OutRefundNo string + OutTradeNo string + RefundId string + SignType string + TransactionId string + type WxPayQueryRefundResponse struct + CashFee int + CurrentRefunds []WxPayQueryRefundResponseCurrentRefund + FeeType string + OutTradeNo string + RefundCount int + SettlementTotalFee int + TotalFee int + TotalRefundCount int + TotalRefunds []WxPayQueryRefundResponseTotalRefund + TransactionId string + func WxPayQueryRefund(wxPayConfig IWxPayConfig, body *WxPayQueryRefundBody) (*WxPayQueryRefundResponse, error) + type WxPayQueryRefundResponseCurrentRefund struct + OutRefundNo string + RefundChannel string + RefundId string + type WxPayQueryRefundResponseTotalRefund struct + CouponRefundCount int64 + CouponRefundFee int64 + Coupons []WxPayCouponResponseModel + RefundAccount string + RefundFee int64 + RefundRecvAccout string + RefundStatus string + RefundSuccessTime string + SettlementRefundFee int64 + type WxPayRefundBody struct + NotifyUrl string + OutRefundNo string + OutTradeNo string + RefundAccount string + RefundDesc string + RefundFee int + RefundFeeType string + TotalFee int + TransactionId string + type WxPayRefundResponse struct + CashFee int + CashRefundFee int + CouponRefundCount int + CouponRefundFee int + FeeType string + OutRefundNo string + OutTradeNo string + RefundCoupons []WxPayCouponResponseModel + RefundFee int + RefundId string + SettlementRefundFee int + SettlementTotalFee int + TotalFee int + TransactionId string + func WxPayRefund(wxPayConfig IWxPayConfig, body *WxPayRefundBody) (*WxPayRefundResponse, error) + type WxPayReportJsAPIBody 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 WxPayReportMicropayBody struct + DeviceInfo string + InterfaceUrl string + SignType string + Trades []WxPayReportMicropayBodyTrade + TradesStr string + UserIp string + type WxPayReportMicropayBodyTrade struct + BeginTime string + EndTime string + ErrMsg string + OutTradeNo string + State string + type WxPayReverseMicroOrderBody struct + OutTradeNo string + TransactionId string + type WxPayReverseMicroOrderResponse struct + Recall string + func WxPayReverseMicroOrder(wxPayConfig IWxPayConfig, body *WxPayReverseMicroOrderBody) (*WxPayReverseMicroOrderResponse, error) + type WxPaySceneInfoModel struct + Address string + AreaCode string + ID string + Name string + type WxPaySendGroupRedPackBody struct + AmtType string + type WxPaySendGroupRedPackResponse struct + func WxPaySendGroupRedPack(wxPayConfig IWxPayConfig, body *WxPaySendGroupRedPackBody) (*WxPaySendGroupRedPackResponse, error) + type WxPaySendMiniProgramHBBody struct + NotifyWay string + type WxPaySendMiniProgramHBResponse struct + JSAPIPackage string + func WxPaySendMiniProgramHB(wxPayConfig IWxPayConfig, body *WxPaySendMiniProgramHBBody) (*WxPaySendMiniProgramHBResponse, error) + type WxPaySendRedPackBody struct + ActName string + ClientIp string + MchBillno string + ReOpenid string + Remark string + RiskInfo string + SceneId string + SendName string + TotalAmount int + TotalNum int + Wishing string + type WxPaySendRedPackResponse struct + ErrCode string + ErrCodeDes string + MchBillno string + MchId string + ReOpenid string + ResultCode string + ReturnCode string + ReturnMsg string + SendListid string + TotalAmount int + WxAppId string + func WxPaySendRedPack(wxPayConfig IWxPayConfig, body *WxPaySendRedPackBody) (*WxPaySendRedPackResponse, error) + type WxPayUnifiedOrderBody 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 *WxPaySceneInfoModel + SignType string + SpbillCreateIP string + SubOpenId string + TimeExpire string + TimeStart string + TotalFee int + TradeType string + type WxPayUnifiedOrderResponse struct + CodeUrl string + DeviceInfo string + MWebUrl string + PrepayId string + TradeType string + func WxPayUnifiedOrder(wxPayConfig IWxPayConfig, body *WxPayUnifiedOrderBody) (*WxPayUnifiedOrderResponse, error) + type WxResponseModel struct + RetMsg string + ReturnCode string + ReturnMsg string + func WxPayReportJsApi(wxPayConfig IWxPayConfig, body *WxPayReportJsAPIBody) (*WxResponseModel, error) + func WxPayReportMicropay(wxPayConfig IWxPayConfig, body *WxPayReportMicropayBody) (*WxResponseModel, error)