From bee989fe64164f558f315bbaf6c3a11056deece9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 12:19:24 +0000 Subject: [PATCH 1/2] mod: bump github.com/smartwalle/alipay/v3 from 3.2.20 to 3.2.29 Bumps [github.com/smartwalle/alipay/v3](https://github.com/smartwalle/alipay) from 3.2.20 to 3.2.29. - [Commits](https://github.com/smartwalle/alipay/compare/v3.2.20...v3.2.29) --- updated-dependencies: - dependency-name: github.com/smartwalle/alipay/v3 dependency-version: 3.2.29 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 082199f1..5af62401 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/redis/rueidis v1.0.64 github.com/robfig/cron/v3 v3.0.1 github.com/sirupsen/logrus v1.9.3 - github.com/smartwalle/alipay/v3 v3.2.20 + github.com/smartwalle/alipay/v3 v3.2.29 github.com/sourcegraph/conc v0.3.0 github.com/spf13/cobra v1.9.1 github.com/spf13/viper v1.20.1 @@ -145,7 +145,7 @@ require ( github.com/rs/xid v1.6.0 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/smartwalle/ncrypto v1.0.4 // indirect - github.com/smartwalle/ngx v1.0.9 // indirect + github.com/smartwalle/ngx v1.1.0 // indirect github.com/smartwalle/nsign v1.0.9 // indirect github.com/spf13/afero v1.12.0 // indirect github.com/spf13/cast v1.7.1 // indirect diff --git a/go.sum b/go.sum index 1ba59890..7206b025 100644 --- a/go.sum +++ b/go.sum @@ -298,12 +298,12 @@ github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsF github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartwalle/alipay/v3 v3.2.20 h1:IjpG3YYgUgzCfS0z/EHlUbbr0OlrmOBHUst/3FzToYE= -github.com/smartwalle/alipay/v3 v3.2.20/go.mod h1:KWg91KsY+eIOf26ZfZeH7bed1bWulGpGrL1ErHF3jWo= +github.com/smartwalle/alipay/v3 v3.2.29 h1:roGFqlml8hDa//0TpFmlyxZhndTYs7rbYLu/HlNFNJo= +github.com/smartwalle/alipay/v3 v3.2.29/go.mod h1:XarBLuAkwK3ah7mYjVtghRu+ysxzlex9sRkgqNMzMRU= github.com/smartwalle/ncrypto v1.0.4 h1:P2rqQxDepJwgeO5ShoC+wGcK2wNJDmcdBOWAksuIgx8= github.com/smartwalle/ncrypto v1.0.4/go.mod h1:Dwlp6sfeNaPMnOxMNayMTacvC5JGEVln3CVdiVDgbBk= -github.com/smartwalle/ngx v1.0.9 h1:pUXDvWRZJIHVrCKA1uZ15YwNti+5P4GuJGbpJ4WvpMw= -github.com/smartwalle/ngx v1.0.9/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= +github.com/smartwalle/ngx v1.1.0 h1:q8nANgWSPRGeI/u+ixBoA4mf68DrUq6vZ+n9L5UKv9I= +github.com/smartwalle/ngx v1.1.0/go.mod h1:mx/nz2Pk5j+RBs7t6u6k22MPiBG/8CtOMpCnALIG8Y0= github.com/smartwalle/nsign v1.0.9 h1:8poAgG7zBd8HkZy9RQDwasC6XZvJpDGQWSjzL2FZL6E= github.com/smartwalle/nsign v1.0.9/go.mod h1:eY6I4CJlyNdVMP+t6z1H6Jpd4m5/V+8xi44ufSTxXgc= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From 7bfc2a1dbd3994e5068d9d179863e6a721912885 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 06:41:08 +0000 Subject: [PATCH 2/2] fix: pass context.Context to alipay TradePreCreate call The smartwalle/alipay/v3 Client.TradePreCreate method signature requires a context.Context as its first argument. Add a Ctx field to UserRechargeLinkReq, populate it from the HTTP request context in Bind, and forward it to the TradePreCreate call to fix the build failure. --- internal/model/web/alipay.go | 6 ++++-- internal/servants/web/alipay.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/model/web/alipay.go b/internal/model/web/alipay.go index 803a66fd..4d6d6586 100644 --- a/internal/model/web/alipay.go +++ b/internal/model/web/alipay.go @@ -27,8 +27,9 @@ type UserWalletBillsResp base.PageResp type UserRechargeLinkReq struct { BaseInfo `json:"-" form:"-" binding:"-"` - Host string `json:"-" form:"-" binding:"-"` - Amount int64 `json:"amount" form:"amount" binding:"required"` + Ctx context.Context `json:"-" form:"-" binding:"-"` + Host string `json:"-" form:"-" binding:"-"` + Amount int64 `json:"amount" form:"amount" binding:"required"` } type UserRechargeLinkResp struct { @@ -82,6 +83,7 @@ func (r *UserWalletBillsReq) Bind(c *gin.Context) error { func (r *UserRechargeLinkReq) Bind(c *gin.Context) error { r.Host = c.Request.Host + r.Ctx = c.Request.Context() return bindAny(c, r) } diff --git a/internal/servants/web/alipay.go b/internal/servants/web/alipay.go index 3734d2d9..d88eafbc 100644 --- a/internal/servants/web/alipay.go +++ b/internal/servants/web/alipay.go @@ -80,7 +80,7 @@ func (s *alipayPrivSrv) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.Use p.Subject = "PaoPao用户钱包充值" p.TotalAmount = fmt.Sprintf("%.2f", float64(recharge.Amount)/100.0) p.NotifyURL = "https://" + req.Host + "/v1/alipay/notify" - rsp, err := s.alipayClient.TradePreCreate(p) + rsp, err := s.alipayClient.TradePreCreate(req.Ctx, p) if err != nil { logrus.Errorf("client.TradePreCreate err: %v\n", err) return nil, web.ErrRechargeReqFail