From 3913f00b132851133254e317185f8076d8f15569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Tue, 10 Dec 2024 16:03:53 +0800 Subject: [PATCH] ysf --- plugins/alipay_redpack/internal/alipay_redpack.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/alipay_redpack/internal/alipay_redpack.go b/plugins/alipay_redpack/internal/alipay_redpack.go index 1538ad8..d698922 100644 --- a/plugins/alipay_redpack/internal/alipay_redpack.go +++ b/plugins/alipay_redpack/internal/alipay_redpack.go @@ -31,14 +31,17 @@ func (s *AlipayRedPackService) Order(ctx context.Context, request *proto.OrderRe if err != nil { return nil, err } + poReq, err := orderReq(request.Order, request.Product) if err != nil { return nil, proto.ErrorParamFail(err.Error()) } + param, err := c.paramReq(poReq, orderMethod) if err != nil { return nil, err } + uv, err := req(c, param) if err != nil { return nil, err @@ -67,6 +70,7 @@ func (s *AlipayRedPackService) Query(ctx context.Context, request *proto.QueryRe if err != nil { return nil, err } + uv, err := req(c, param) if err != nil { return nil, err @@ -90,18 +94,22 @@ func (s *AlipayRedPackService) Notify(_ context.Context, request *proto.NotifyRe if err != nil { return nil, err } + n := notifyReq(request) cert, err := alipay.GetCert(c.AppId) if err != nil { return nil, err } + b, err := Verify(n, cert.PublicKey) if err != nil { return nil, proto.ErrorSignFail(err.Error()) } + if !b { return nil, proto.ErrorSignFail("验签失败") } + return notifyResp(n) }