From ab0625b21b3843f7174b5f664453ca23601a7a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Thu, 27 Feb 2020 10:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=81=94=E5=AE=9D=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/jx/localjx/tonglianpay.go | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/business/partner/purchase/jx/localjx/tonglianpay.go b/business/partner/purchase/jx/localjx/tonglianpay.go index 78460c1fd..a9bae3406 100644 --- a/business/partner/purchase/jx/localjx/tonglianpay.go +++ b/business/partner/purchase/jx/localjx/tonglianpay.go @@ -47,22 +47,6 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp result, err := api.TLpayAPI.CreateUnitorderOrder(param) result2 := &tonglianpayapi.PayInfo{} 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 { result2 := &wxpayapi.CreateOrderResult{} json.Unmarshal([]byte(result.PayInfo), &result2) @@ -80,6 +64,10 @@ func pay4OrderByTL(ctx *jxcontext.Context, order *model.GoodsOrder, vendorPayTyp 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 }