Skip to content

[Klarna Checkout] Cart is set OnHold in ValidateOrder #79

Description

@patkleef

It's a bit confusing now that the cart is set to on hold. Especially that a purchase order (see below) is created with the name OnHold (copied from the cart during creation) instead of the default name. This means that you can't retrieve the order without defining the name (OnHold).

var list = _orderRepository.Load<IPurchaseOrder>(orderGroupId, "OnHold");

Validate Order
"Reason why we create an OnHold cart is to prevent that the customer can change/ see their cart after clicking the 'Place Order' button in the Klarna Checkout widget. The ICartService only loads the DEFAULT cart."

https://github.com/Geta/Klarna/blob/master/src/Klarna.Checkout/KlarnaCheckoutService.cs#L415

Demo project creating purchase order
https://github.com/Geta/Klarna/blob/master/demo/Sources/EPiServer.Reference.Commerce.Site/Features/Checkout/Services/CheckoutService.cs#L243

Probably make this behavior clear in the documentation or create a method in the package that reset the cart name and create/ save an order.

cart.Name = "DEFAULT"; var orderReference = _orderRepository.SaveAsPurchaseOrder(cart);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions