Purchase order missing discount or shipping

Vote:
 

Hi!

We have a strange problem. 

We are using KlarnaCheckout and it works like this that the cart is calculated with shipping and discount before the amount is sent to Klarna. That works just fine and the correct amount is calculated and the order is sent to Klarna.
Klarna then sends an order push when the order is ok at their part and when we get this push, we take the cart and creates a purchase order from it using SaveAsPurchaseOrder();

And here we sometimes have a problem that the shipping or discount is left out, so the amount on the purchase order differs from the amount in Klarna and the amount in the cart. Very strange! It doesn't happen very often but from time to time.

Has anyone had this problem?

Thanks!

/Kristoffer

#181615
Aug 25, 2017 12:24
Vote:
 

Sounds like some sort of context problem when you get the order push from Klarna. Either the market is off, so the shipping discount no longer applies, or something in the discount is depending on the customer (some visitor group?). Seeing as it is server to server, you don't have the same web context as you have when the customer sees the cart on your site.

So start checking if the market is correct in the callback. And if you have visitor groups, you'll need to build the context for that :)

#181627
Aug 25, 2017 13:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.