Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
patkleef opened this issue Jan 10, 2020 · 0 comments
Open

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

patkleef opened this issue Jan 10, 2020 · 0 comments

Comments

@patkleef
Copy link
Contributor

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);

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

No branches or pull requests

1 participant