feat: 更新钱包充值逻辑,自动处理充值订单支付,模拟支付成功返回

This commit is contained in:
2025-12-31 12:00:38 +08:00
parent a6b870bc8f
commit 95bc5bdb5d
2 changed files with 53 additions and 36 deletions

View File

@@ -96,9 +96,15 @@ func (s *wallet) Recharge(
return nil, errorx.ErrDatabaseError.WithCause(err)
}
// MOCK: Automatically pay for recharge order to close the loop
// In production, this would be a callback from payment gateway
if err := Order.ProcessExternalPayment(ctx, cast.ToString(order.ID), "mock_auto_pay"); err != nil {
return nil, err
}
// Mock Pay Params
return &user_dto.RechargeResponse{
PayParams: "mock_recharge_url",
PayParams: "mock_paid_success",
OrderID: cast.ToString(order.ID),
}, nil
}