17 lines
370 B
Go
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
|
|
}
|