fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package checkout
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -52,19 +53,23 @@ func HandlePaymentStarted(g *CheckoutGrain, m *messages.PaymentStarted) error {
|
||||
if method != nil {
|
||||
payment.Method = method
|
||||
}
|
||||
if m.SessionData != nil {
|
||||
payment.SessionData = (*json.RawMessage)(&m.SessionData.Value)
|
||||
}
|
||||
payment.StartedAt = &startedAt
|
||||
payment.CompletedAt = nil
|
||||
payment.ProcessorReference = nil
|
||||
} else {
|
||||
g.PaymentInProgress++
|
||||
g.Payments = append(g.Payments, &Payment{
|
||||
PaymentId: paymentID,
|
||||
Status: "pending",
|
||||
Amount: m.Amount,
|
||||
Currency: currency,
|
||||
Provider: provider,
|
||||
Method: method,
|
||||
StartedAt: &startedAt,
|
||||
PaymentId: paymentID,
|
||||
Status: "pending",
|
||||
Amount: m.Amount,
|
||||
SessionData: (*json.RawMessage)(&m.SessionData.Value),
|
||||
Currency: currency,
|
||||
Provider: provider,
|
||||
Method: method,
|
||||
StartedAt: &startedAt,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user