From 9916c644deb467b2da27e2b9aa21d1047b06d8bc Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Fri, 29 Dec 2023 17:40:33 +0800 Subject: [PATCH] fix --- app/mix/controller/alipay_callback.go | 7 ++++--- library/payclients/alipaycli/client.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/mix/controller/alipay_callback.go b/app/mix/controller/alipay_callback.go index 0b55921e..8da5b0f4 100644 --- a/app/mix/controller/alipay_callback.go +++ b/app/mix/controller/alipay_callback.go @@ -4,16 +4,17 @@ import ( "github.com/gin-gonic/gin" vasproto "service/api/proto/vas/proto" "service/app/mix/service" + "service/bizcommon/util" "service/library/logger" "service/library/payclients/alipaycli" ) func AlipayCallback(ctx *gin.Context) { - req, _ := ctx.GetRawData() - logger.Info("_AlipayCallback req: %v", string(req)) + //req, _ := ctx.GetRawData() + //logger.Info("_AlipayCallback req: %v", string(req)) bm, err := alipaycli.GetDefaultAlipayClient().ParseNotify(ctx.Request) if err != nil { - logger.Error("ParseNotify fail, req: %v, err: %v", string(req), err) + logger.Error("ParseNotify fail, req: %v, err: %v", util.ToJson(bm), err) return } diff --git a/library/payclients/alipaycli/client.go b/library/payclients/alipaycli/client.go index 7f5d67bd..9a2ef633 100644 --- a/library/payclients/alipaycli/client.go +++ b/library/payclients/alipaycli/client.go @@ -49,7 +49,7 @@ func (c *AlipayClient) ParseNotify(req *http.Request) (notify gopay.BodyMap, err return } // 验签 - ok, err := alipay.VerifySign("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAngPAA49Gqy81CuQd0eW6mzpF5vEwXtHSOl6Xn8Zx3jcpLBBYULlkxbUAOedJRo/1TMjUAtEfoC+lSv+UnYKJ88TMfGwvv9ZSFq5d0PBfiS7AFHDYegvlsw8O5uWEqxvd+tX9/ov4D1QuBkU88fdai3ZNckhmb/xqUlb+PZParQ/N4EQm8SauRWNUAPN1m+cZCaDMJfkpSrxSzcSCMz0IfQ7wxft9hU7FUIJt7F9ZbAK0wOMqe2OEhtwPJpDmp4nWF9SolGsDAVmg4GYtQjKUPmW298NAtLcQnmfHpOSXlMNhGBydGsDJxROvrzw5tSzSdA6HZL7Mxm5i710EtnjH1QIDAQAB", notifyTmp) + ok, err := alipay.VerifySign("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl9Pj5j6cNRdaDyWTWWFkcBViDqw/py1bDrqe7VykND1JywgLsFogeKGG0YhJfTfEeExAlGlP2DUV7z0uc8QhCMF7N+qdfXNb/RemFIpSs71i9kkaFIJEl20JnWipps96LwZLDpNRck3Nho/Xnbs4wuft3sQtd7T0sB2zEYyl7OyuTqehcoz3uAQp0JOYBosVPpgofaD6BN2RSZQ33QvqS37w3xHLif8P7hfYXdeIe+JxeHmchzQK22dRzJinYfU+pKE5J2Wm+dq1l3/ls4w8Xc3RyqvvW2UMx2lOMtSg2WWXDDi1skmHn/l1BbBP/uogNq4Avf50eoZ1UE6JxPrZpQIDAQAB", notifyTmp) if err != nil { logger.Error("VerifySign fail, bm: %v, err: %v", util.ToJson(notifyTmp), err) return