- 🇫🇮Finland tuutti
This should be fixed in 3.x branch now. I haven't tested it properly yet tho.
- Status changed to Fixed
almost 2 years ago 5:36am 7 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.
Authorization fails when applying shipping promotions that are not included in the price as the un-adjusted shipping amount is sent to Klarna.
Add a shipping promotion that is not included in the price
- Select offer type 'Fixed amount off shipment amount.' or 'Percentage off the shipment amount'
- Select "Only show the discount on the order total summary."
Add product to your cart.
Navigate to checkout.
Apply the shipping promotion (use coupon or fulfill condition defined when adding the promotion).
Proceed to pay with Klarna.
You will receive the error "An unknown error occurred. Please contact store administration if the problem persists."
In the Klarna logs you will see a 400 response with the error code BAD_VALUE, as the order total is not equal to the sum of the line items.
Modify the Drupal\commerce_klarna_payments\Request\Payment\RequestBuilder::createShippingOrderLine($shipment) method to call $shipment->getAdjustedAmount() instead of $shipment->getAmount(). This will then handle shipping promotions using the adjusted price analogously to how the createOrderLine() method indirectly handles order item based promotions using the adjusted price.
A merge request is to follow.
None.
None.
None.
Fixed
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This should be fixed in 3.x branch now. I haven't tested it properly yet tho.
Automatically closed - issue fixed for 2 weeks with no activity.