Files
go-cart-actor/pkg/cart/mutation_payment_declined.go
matst80 60cd6cfd51
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 44s
Build and Publish / BuildAndDeployArm64 (push) Successful in 5m3s
update
2025-11-20 21:20:35 +01:00

17 lines
370 B
Go

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
}