feat: update
This commit is contained in:
2
backend/.gitignore
vendored
2
backend/.gitignore
vendored
@@ -27,3 +27,5 @@ go.work.sum
|
||||
# vendor/
|
||||
|
||||
fixtures/*
|
||||
|
||||
quyun
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
BIN
backend/quyun
BIN
backend/quyun
Binary file not shown.
Reference in New Issue
Block a user