Compare commits

...

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
95832c532b Remove special handling of Dummy payment provider
The dummy provider should work like real payment providers, where payment completion is handled through the notification flow rather than being instant. Only Balance provider should have instant payment processing.

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
2026-02-13 01:34:15 +00:00
copilot-swe-agent[bot]
aa685b2321 Initial plan 2026-02-13 01:29:47 +00:00

View File

@@ -276,7 +276,7 @@ func PayOrder(providerName, host, paymentEnv string, order *Order, lang string)
OutOrderId: payResp.OrderId,
}
if provider.Type == "Dummy" || provider.Type == "Balance" {
if provider.Type == "Balance" {
payment.State = pp.PaymentStatePaid
}
@@ -351,7 +351,7 @@ func PayOrder(providerName, host, paymentEnv string, order *Order, lang string)
}
order.Payment = payment.Name
if provider.Type == "Dummy" || provider.Type == "Balance" {
if provider.Type == "Balance" {
order.State = "Paid"
order.Message = "Payment successful"
order.UpdateTime = util.GetCurrentTime()
@@ -364,7 +364,7 @@ func PayOrder(providerName, host, paymentEnv string, order *Order, lang string)
}
// Update product stock after order state is persisted (for instant payment methods)
if provider.Type == "Dummy" || provider.Type == "Balance" {
if provider.Type == "Balance" {
err = UpdateProductStock(orderProductInfos)
if err != nil {
return nil, nil, err