From d984e798bd290192d0116540b2bbc65b9a4ebd6c Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 24 Jul 2023 17:57:14 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=BE=AE=E4=BF=A1=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/local_wechat/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/local_wechat/api.go b/lib/local_wechat/api.go index b89835a..e66d451 100644 --- a/lib/local_wechat/api.go +++ b/lib/local_wechat/api.go @@ -127,6 +127,10 @@ func TradeH5Pay(client *wechat.Client, subject, orderID, amount, notifyUrl strin // TradeMiniProgPay is 微信小程序支付 ☑️ func TradeMiniProgPay(client *wechat.Client, subject, orderID, amount, notifyUrl, openid string) (map[string]string, error) { + if len(subject) > 127 { + tmpSubject := []rune(subject) + subject = string(tmpSubject[0:44]) + } // 初始化 BodyMap bm := make(gopay.BodyMap) bm.Set("nonce_str", util.GetRandomString(32)).