pay result

This commit is contained in:
苏尹岚
2020-11-06 16:33:59 +08:00
parent 35bd646600
commit 6b9eb80be9
2 changed files with 5 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ package cms
import (
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/financial"
@@ -54,6 +56,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType stri
VendorPayType: vendorPayType,
}
)
globals.SugarLogger.Debugf("pay begin……")
err = dao.GetEntity(db, order, "OrderID")
if order.ID == 0 {
return result, fmt.Errorf("未找到此订单!")
@@ -65,6 +68,7 @@ func Pay(ctx *jxcontext.Context, orderID string, payType int, vendorPayType stri
err = financial.AddUserBill(db, jxutils.GenBillID(), order.UserID)
}
err = payHandler.CreatePay()
globals.SugarLogger.Debugf("result : %v", utils.Format4Output(payHandler.WxPayParam, false))
return payHandler.WxPayParam, err
}

View File

@@ -106,6 +106,7 @@ func signParam(signType string, params map[string]interface{}) (sig string) {
sort.Sort(sort.StringSlice(valueList))
valueList = append(valueList, fmt.Sprintf("key=%s", globals.WxpayAppKey))
sig = strings.Join(valueList, "&")
fmt.Println("test111111111111111111111111111111111111111111111", sig)
var binSig []byte
if signType == sigTypeSha256 {
mac := hmac.New(sha256.New, []byte(globals.WxpayAppKey))