feat: update

This commit is contained in:
Rogee
2025-04-30 21:17:44 +08:00
parent 9a66277dd7
commit 9bd5fe04ad
4 changed files with 4 additions and 28 deletions

2
backend/.gitignore vendored
View File

@@ -27,3 +27,5 @@ go.work.sum
# vendor/
fixtures/*
quyun

View File

@@ -30,7 +30,7 @@ func (s WechatPayNotify) InsertOpts() InsertOpts {
}
}
func (WechatPayNotify) Kind() string { return "wechat_callback" }
func (WechatPayNotify) Kind() string { return "wechat_pay_notify" }
func (a WechatPayNotify) UniqueID() string { return a.Kind() }
var _ Worker[WechatPayNotify] = (*WechatPayNotifyWorker)(nil)

View File

@@ -7,9 +7,6 @@ import (
"quyun/app/models"
"quyun/app/service/testx"
"quyun/providers/ali"
"quyun/providers/app"
"quyun/providers/job"
"quyun/providers/wepay"
. "github.com/riverqueue/river"
@@ -24,9 +21,6 @@ type WechatPayNotifySuiteInjectParams struct {
dig.In
Initials []contracts.Initial `group:"initials"` // nolint:structcheck
Job *job.Job
Oss *ali.OSSClient
App *app.Config
}
type WechatPayNotifySuite struct {
@@ -46,27 +40,7 @@ func Test_WechatPayNotify(t *testing.T) {
func (t *WechatPayNotifySuite) Test_Work() {
Convey("test_work", t.T(), func() {
Convey("step 1", func() {
notify := `{
"mchid": "1702644947",
"appid": "wx47649361b6eba174",
"out_trade_no": "20250430192543",
"transaction_id": "4200002602202504300651871941",
"trade_type": "JSAPI",
"trade_state": "SUCCESS",
"trade_state_desc": "支付成功",
"bank_type": "OTHERS",
"attach": "",
"success_time": "2025-04-30T19:25:51+08:00",
"payer": {
"openid": "o5Bzk644x3LOMJsKSZRlqWin74IU"
},
"amount": {
"total": 1,
"payer_total": 1,
"currency": "CNY",
"payer_currency": "CNY"
}
}`
notify := `{ "mchid": "1702644947", "appid": "wx47649361b6eba174", "out_trade_no": "20250430192543", "transaction_id": "4200002602202504300651871941", "trade_type": "JSAPI", "trade_state": "SUCCESS", "trade_state_desc": "支付成功", "bank_type": "OTHERS", "attach": "", "success_time": "2025-04-30T19:25:51+08:00", "payer": { "openid": "o5Bzk644x3LOMJsKSZRlqWin74IU" }, "amount": { "total": 1, "payer_total": 1, "currency": "CNY", "payer_currency": "CNY" } }`
var payNotify wepay.PayNotify
err := json.Unmarshal([]byte(notify), &payNotify)

Binary file not shown.