more functions
This commit is contained in:
@@ -2,12 +2,17 @@ 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()
|
||||
grain.PaymentDeclinedNotices = append(grain.PaymentDeclinedNotices, Notice{
|
||||
Timestamp: time.Now(),
|
||||
Message: req.Message,
|
||||
Code: req.Code,
|
||||
})
|
||||
// Optionally clear checkout order if in progress
|
||||
if grain.CheckoutOrderId != "" {
|
||||
grain.CheckoutOrderId = ""
|
||||
|
||||
Reference in New Issue
Block a user