feat: add refund statuses

This commit is contained in:
Rogee
2025-05-06 20:23:06 +08:00
parent b7ebdf1ce6
commit 41cdc821da
13 changed files with 266 additions and 114 deletions

View File

@@ -61,9 +61,11 @@ func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
meta.RefundResp = resp
order.Meta = fields.ToJson(meta)
order.RefundTransactionID = resp.RefundId
order.Status = fields.OrderStatusRefundProcessing
if err := models.Orders.Update(ctx.Context(), order); err != nil {
return err
}
return nil
}

View File

@@ -5,6 +5,7 @@ import (
"quyun/providers/app"
"quyun/providers/job"
"quyun/providers/jwt"
"quyun/providers/wepay"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
@@ -35,8 +36,12 @@ func Provide(opts ...opt.Option) error {
}); err != nil {
return err
}
if err := container.Container.Provide(func() (*orders, error) {
obj := &orders{}
if err := container.Container.Provide(func(
wepay *wepay.Client,
) (*orders, error) {
obj := &orders{
wepay: wepay,
}
return obj, nil
}); err != nil {