There is an error when you try to invoice an order and consequently capture it when your order is placed using Klarna APM
After debugging I found out that there is two issues in code that leads to incorrect API request:
Incorrect API endpoint. In documentation is described klarna-external/orders/{payment_id}/captures but in code it uses payments/{payment_id}/capture inside of Checkout\Models\Payments\Capture set on MODEL_REQUEST_URL constant
Lack of klarna field in request body. Documentation says that klarna field is required but any field inside of it is optional, so it is enough to add empty object under klarna field
I tried to deliver fixes for that and request worked fine and order was captured correctly. Also tried using Postman and request performed successfully
There is an error when you try to invoice an order and consequently capture it when your order is placed using Klarna APM
After debugging I found out that there is two issues in code that leads to incorrect API request:
klarna-external/orders/{payment_id}/captures
but in code it usespayments/{payment_id}/capture
inside ofCheckout\Models\Payments\Capture
set onMODEL_REQUEST_URL
constantklarna
field in request body. Documentation says that klarnafield
is required but any field inside of it is optional, so it is enough to add empty object underklarna
fieldI tried to deliver fixes for that and request worked fine and order was captured correctly. Also tried using Postman and request performed successfully