From 0db6094b242ccbee005164000a3f6e14bcd3c5c6 Mon Sep 17 00:00:00 2001 From: Mongo Date: Mon, 30 Oct 2017 15:28:41 +0800 Subject: [PATCH] fix bug --- pay/pay.go | 10 ++++++++++ wechat.go | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pay/pay.go b/pay/pay.go index 86212a9..6ca11a9 100644 --- a/pay/pay.go +++ b/pay/pay.go @@ -17,6 +17,7 @@ type Pay struct { *context.Context } +// 传入的参数,用于生成 prepay_id 的必需参数 // PayParams was NEEDED when request unifiedorder type PayParams struct { TotalFee string @@ -26,6 +27,15 @@ type PayParams struct { OpenID string } +// PayConfig 是传出用于 jsdk 用的参数 +type PayConfig struct { + Timestamp int64 + NonceStr string + PrePayID string + SignType string + Sign string +} + // payResult 是 unifie order 接口的返回 type payResult struct { ReturnCode string `xml:"return_code"` diff --git a/wechat.go b/wechat.go index 1dcdd2f..7c84644 100644 --- a/wechat.go +++ b/wechat.go @@ -27,9 +27,9 @@ type Config struct { AppSecret string Token string EncodingAESKey string - PayMchID string - PayNotifyURL string //支付的通知接口 - PayKey string //商家后台设置的支付 key + PayMchID string //支付 - 商户 ID + PayNotifyURL string //支付 - 接受微信支付结果通知的接口地址 + PayKey string //支付 - 商户后台设置的支付 key Cache cache.Cache } @@ -95,4 +95,4 @@ func (wc *Wechat) GetTemplate() *template.Template { // GetPay 返回支付消息的实例 func (wc *Wechat) GetPay() *pay.Pay { return pay.NewPay(wc.Context) -} +} \ No newline at end of file