pay result
This commit is contained in:
@@ -3,6 +3,8 @@ package cms
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxstore/financial"
|
"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,
|
VendorPayType: vendorPayType,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
globals.SugarLogger.Debugf("pay begin……")
|
||||||
err = dao.GetEntity(db, order, "OrderID")
|
err = dao.GetEntity(db, order, "OrderID")
|
||||||
if order.ID == 0 {
|
if order.ID == 0 {
|
||||||
return result, fmt.Errorf("未找到此订单!")
|
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 = financial.AddUserBill(db, jxutils.GenBillID(), order.UserID)
|
||||||
}
|
}
|
||||||
err = payHandler.CreatePay()
|
err = payHandler.CreatePay()
|
||||||
|
globals.SugarLogger.Debugf("result : %v", utils.Format4Output(payHandler.WxPayParam, false))
|
||||||
return payHandler.WxPayParam, err
|
return payHandler.WxPayParam, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ func signParam(signType string, params map[string]interface{}) (sig string) {
|
|||||||
sort.Sort(sort.StringSlice(valueList))
|
sort.Sort(sort.StringSlice(valueList))
|
||||||
valueList = append(valueList, fmt.Sprintf("key=%s", globals.WxpayAppKey))
|
valueList = append(valueList, fmt.Sprintf("key=%s", globals.WxpayAppKey))
|
||||||
sig = strings.Join(valueList, "&")
|
sig = strings.Join(valueList, "&")
|
||||||
|
fmt.Println("test111111111111111111111111111111111111111111111", sig)
|
||||||
var binSig []byte
|
var binSig []byte
|
||||||
if signType == sigTypeSha256 {
|
if signType == sigTypeSha256 {
|
||||||
mac := hmac.New(sha256.New, []byte(globals.WxpayAppKey))
|
mac := hmac.New(sha256.New, []byte(globals.WxpayAppKey))
|
||||||
|
|||||||
Reference in New Issue
Block a user