Look at the Step 1 here:
https://developers.klarna.com/en/se/kco-v2/checkout/2-embed-the-checkout#add-cart-items
It uses the $order
object variable without it initialization in the $order->create($create)
statement:
The $order
variable is initalized only in the Step 3 here:
https://developers.klarna.com/en/se/kco-v2/checkout/2-embed-the-checkout#create-checkout-order
This error is only in the PHP code, the same Step 1 in the other 4 programming languages (Java, Python, .NET, ASP) is correct.