fix checkout again
All checks were successful
Build and Publish / Metadata (push) Successful in 5s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 47s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m0s

This commit is contained in:
matst80
2025-10-10 16:00:20 +00:00
parent 09a68db8d5
commit f8c8ad56c7
4 changed files with 29 additions and 128 deletions

View File

@@ -249,20 +249,20 @@ func main() {
return
}
cartId := ToCartId(cookie.Value)
_, err = syncedServer.pool.Apply(cartId, getCheckoutOrder(r.Host, cartId))
order, err = syncedServer.CreateOrUpdateCheckout(r.Host, cartId)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
}
// v2: Apply now returns *CartGrain; order creation handled inside grain (no payload to unmarshal)
} else {
prevOrder, err := KlarnaInstance.GetOrder(orderId)
order, err = KlarnaInstance.GetOrder(orderId)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(err.Error()))
return
}
order = prevOrder
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.Header().Set("Permissions-Policy", "payment=(self \"https://js.stripe.com\" \"https://m.stripe.network\" \"https://js.playground.kustom.co\")")