|
@@ -179,6 +179,10 @@ func TradePcPay(client *wechat.Client, subject, orderID, amount, notifyUrl, prod |
|
|
|
|
|
|
|
|
// TradeMiniProgPay is 微信小程序支付 ☑️ |
|
|
// TradeMiniProgPay is 微信小程序支付 ☑️ |
|
|
func TradeMiniProgPay(client *wechat.Client, subject, orderID, amount, notifyUrl, openid string) (map[string]string, error) { |
|
|
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 |
|
|
// 初始化 BodyMap |
|
|
bm := make(gopay.BodyMap) |
|
|
bm := make(gopay.BodyMap) |
|
|
bm.Set("nonce_str", util.GetRandomString(32)). |
|
|
bm.Set("nonce_str", util.GetRandomString(32)). |
|
|