Add DummyPaymentProvider

This commit is contained in:
Yang Luo
2023-05-30 23:25:58 +08:00
parent 10e66f8020
commit fb1db7823b
6 changed files with 72 additions and 9 deletions

View File

@ -210,6 +210,11 @@ func BuyProduct(id string, providerName string, user *User, host string) (string
ReturnUrl: product.ReturnUrl,
State: "Created",
}
if provider.Type == "Dummy" {
payment.State = "Paid"
}
affected, err := AddPayment(&payment)
if err != nil {
return "", err