better
Some checks failed
Build and Publish / BuildAndDeployAmd64 (push) Successful in 42s
Build and Publish / BuildAndDeployArm64 (push) Has been cancelled

This commit is contained in:
matst80
2025-12-04 18:08:34 +01:00
parent 9a61b088c9
commit 3d9d703a76

View File

@@ -35,6 +35,11 @@ func HandlePaymentStarted(g *CheckoutGrain, m *messages.PaymentStarted) error {
payment, found := g.FindPayment(paymentID) payment, found := g.FindPayment(paymentID)
var sessionData *json.RawMessage
if m.SessionData != nil {
sessionData = (*json.RawMessage)(&m.SessionData.Value)
}
if found { if found {
if payment.Status != "pending" { if payment.Status != "pending" {
return fmt.Errorf("PaymentStarted: payment already started") return fmt.Errorf("PaymentStarted: payment already started")
@@ -54,7 +59,7 @@ func HandlePaymentStarted(g *CheckoutGrain, m *messages.PaymentStarted) error {
payment.Method = method payment.Method = method
} }
if m.SessionData != nil { if m.SessionData != nil {
payment.SessionData = (*json.RawMessage)(&m.SessionData.Value) payment.SessionData = sessionData
} }
payment.StartedAt = &startedAt payment.StartedAt = &startedAt
@@ -64,7 +69,7 @@ func HandlePaymentStarted(g *CheckoutGrain, m *messages.PaymentStarted) error {
PaymentId: paymentID, PaymentId: paymentID,
Status: "pending", Status: "pending",
Amount: m.Amount, Amount: m.Amount,
SessionData: (*json.RawMessage)(&m.SessionData.Value), SessionData: sessionData,
Currency: currency, Currency: currency,
Provider: provider, Provider: provider,
Method: method, Method: method,