通联宝支付
This commit is contained in:
@@ -47,22 +47,6 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
|
|||||||
result, err := api.TLpayAPI.CreateUnitorderOrder(param)
|
result, err := api.TLpayAPI.CreateUnitorderOrder(param)
|
||||||
result2 := &tonglianpayapi.PayInfo{}
|
result2 := &tonglianpayapi.PayInfo{}
|
||||||
json.Unmarshal([]byte(result.PayInfo), &result2)
|
json.Unmarshal([]byte(result.PayInfo), &result2)
|
||||||
plainText, err := RSADecrypt([]byte(result2.PaySign))
|
|
||||||
// file, err := ioutil.ReadFile("conf/rsa_key.pem")
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// prk, err := x509.ParsePKCS1PrivateKey(file)
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
// paySign, err := rsa.DecryptOAEP(md5.New(), rand.Reader, prk, []byte(result2.PaySign), nil)
|
|
||||||
// if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
// }
|
|
||||||
result2.PaySign = string(plainText)
|
|
||||||
str, err := json.Marshal(result2)
|
|
||||||
result.PayInfo = string(str)
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
result2 := &wxpayapi.CreateOrderResult{}
|
result2 := &wxpayapi.CreateOrderResult{}
|
||||||
json.Unmarshal([]byte(result.PayInfo), &result2)
|
json.Unmarshal([]byte(result.PayInfo), &result2)
|
||||||
@@ -80,6 +64,10 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
|
|||||||
TotalFee: int(order.ActualPayPrice),
|
TotalFee: int(order.ActualPayPrice),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
plainText, err := RSADecrypt([]byte(result2.PaySign))
|
||||||
|
result2.PaySign = string(plainText)
|
||||||
|
str, err := json.Marshal(result2)
|
||||||
|
result.PayInfo = string(str)
|
||||||
return orderPay, err
|
return orderPay, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user