more customer
This commit is contained in:
@@ -239,15 +239,13 @@ func (s *CheckoutPoolServer) StartCheckoutHandler(w http.ResponseWriter, r *http
|
||||
return
|
||||
}
|
||||
|
||||
// Create checkout with same ID as cart
|
||||
var checkoutId checkout.CheckoutId = cart.MustNewCartId()
|
||||
cookie, err := r.Cookie(checkoutCookieName)
|
||||
if err == nil {
|
||||
parsed, ok := cart.ParseCartId(cookie.Value)
|
||||
if ok {
|
||||
checkoutId = parsed
|
||||
}
|
||||
}
|
||||
// The checkout grain is 1:1 with the cart it checks out (CheckoutId ==
|
||||
// CartId). Keying it by the cart id — not a lingering checkoutid cookie —
|
||||
// means a fresh cart always gets a fresh checkout, so the Klarna order
|
||||
// reflects the cart shown at /kassa. Reusing the cookie made a new cart's
|
||||
// checkout latch onto a previous cart's frozen snapshot (InitializeCheckout
|
||||
// silently refuses to re-snapshot a grain that already has a CartState).
|
||||
checkoutId := checkout.CheckoutId(cartId)
|
||||
|
||||
// Initialize checkout with cart state wrapped in Any
|
||||
cartStateAny := &messages.InitializeCheckout{
|
||||
|
||||
Reference in New Issue
Block a user