more
This commit is contained in:
@@ -102,6 +102,7 @@ type CheckoutGrain struct {
|
||||
Deliveries []*CheckoutDelivery `json:"deliveries,omitempty"`
|
||||
PaymentInProgress uint16 `json:"paymentInProgress"`
|
||||
AmountInCentsRemaining int64 `json:"amountRemaining"`
|
||||
AmountInCentsStarted int64 `json:"amountPaid"`
|
||||
InventoryReserved bool `json:"inventoryReserved"`
|
||||
Confirmation *ConfirmationStatus `json:"confirmationViewed,omitempty"`
|
||||
Payments []*Payment `json:"payments,omitempty"`
|
||||
|
||||
@@ -23,6 +23,7 @@ func HandlePaymentDeclined(g *CheckoutGrain, m *messages.PaymentDeclined) error
|
||||
payment.CompletedAt = asPointer(time.Now())
|
||||
payment.Status = "failed"
|
||||
g.PaymentInProgress--
|
||||
g.AmountInCentsStarted -= payment.Amount
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ func HandlePaymentStarted(g *CheckoutGrain, m *messages.PaymentStarted) error {
|
||||
})
|
||||
}
|
||||
|
||||
g.AmountInCentsStarted += m.Amount
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user