通联支付测试
This commit is contained in:
@@ -52,12 +52,12 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp
|
|||||||
CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200),
|
CodeURL: utils.LimitUTF8StringLen(result.PayInfo, 3200),
|
||||||
TotalFee: int(order.ActualPayPrice),
|
TotalFee: int(order.ActualPayPrice),
|
||||||
}
|
}
|
||||||
plainText, err2 := RSADecrypt([]byte(result2.PaySign))
|
// plainText, err2 := RSADecrypt([]byte(result2.PaySign))
|
||||||
result2.PaySign = string(plainText)
|
// result2.PaySign = string(plainText)
|
||||||
globals.SugarLogger.Debugf("pay4OrderByTL2, [%v]", string(plainText))
|
// globals.SugarLogger.Debugf("pay4OrderByTL2, [%v]", string(plainText))
|
||||||
str, err2 := json.Marshal(result2)
|
// str, err2 := json.Marshal(result2)
|
||||||
result.PayInfo = string(str)
|
// result.PayInfo = string(str)
|
||||||
err = err2
|
// err = err2
|
||||||
}
|
}
|
||||||
return orderPay, err
|
return orderPay, err
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,6 @@ func RSADecrypt(pub []byte) (plainText []byte, err error) {
|
|||||||
// buf := make([]byte, info.Size())
|
// buf := make([]byte, info.Size())
|
||||||
// file.Read(buf)
|
// file.Read(buf)
|
||||||
buf, err := ioutil.ReadFile("conf/rsa_key.pem")
|
buf, err := ioutil.ReadFile("conf/rsa_key.pem")
|
||||||
globals.SugarLogger.Debugf("pay4OrderByTL3, [%v]", string(buf))
|
|
||||||
//pem解码
|
//pem解码
|
||||||
block, _ := pem.Decode(buf)
|
block, _ := pem.Decode(buf)
|
||||||
//X509解码
|
//X509解码
|
||||||
|
|||||||
Reference in New Issue
Block a user