update
This commit is contained in:
16
pkg/cart/mutation_payment_declined.go
Normal file
16
pkg/cart/mutation_payment_declined.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package cart
|
||||
|
||||
import (
|
||||
"time"
|
||||
messages "git.tornberg.me/go-cart-actor/pkg/messages"
|
||||
)
|
||||
|
||||
func PaymentDeclined(grain *CartGrain, req *messages.PaymentDeclined) error {
|
||||
grain.PaymentStatus = "declined"
|
||||
grain.PaymentDeclinedAt = time.Now()
|
||||
// Optionally clear checkout order if in progress
|
||||
if grain.CheckoutOrderId != "" {
|
||||
grain.CheckoutOrderId = ""
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user