通联宝支付测试

This commit is contained in:
苏尹岚
2020-02-27 10:38:18 +08:00
parent ab0625b21b
commit b187122ba7

View File

@@ -45,10 +45,8 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
param.Acct = authInfo.GetAuthID()
}
result, err := api.TLpayAPI.CreateUnitorderOrder(param)
result2 := &tonglianpayapi.PayInfo{}
json.Unmarshal([]byte(result.PayInfo), &result2)
if err == nil {
result2 := &wxpayapi.CreateOrderResult{}
result2 := &tonglianpayapi.PayInfo{}
json.Unmarshal([]byte(result.PayInfo), &result2)
orderPay = &model.OrderPay{
PayOrderID: param.Reqsn,
@@ -63,11 +61,11 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200),
TotalFee: int(order.ActualPayPrice),
}
plainText, err := RSADecrypt([]byte(result2.PaySign))
result2.PaySign = string(plainText)
str, err := json.Marshal(result2)
result.PayInfo = string(str)
}
plainText, err := RSADecrypt([]byte(result2.PaySign))
result2.PaySign = string(plainText)
str, err := json.Marshal(result2)
result.PayInfo = string(str)
return orderPay, err
}