Adyen Klarna capture transaction fails when canceling line item from shipping order
Trailblazer Community

Adyen Klarna capture transaction fails when canceling line item from shipping order

Salesforce Order Management

Last updated 8 days ago ·Reference W-7722706 ·Reported By 1 users

In Review

Summary
Orders that have a line item cancelled from shipping orders are failing capture payments with an error "Attempted to divide by zero." All orders contain at least 1 cancelled item. The payment processor used is Adyen and payment method used is Klarna. In the capture transactions if we pass the same capture amount after canceling item then we are getting error.

Repro
1. Create json order for Adyen processor using Klarna payment method and import order in OM with at least 2 items
2. Allocate both items to a fulfillment site.
3. Create Shipping Order and keep in waiting approval state.
4. Edit the Shipping Order and set quantity=0 on one of the products.
5. In Customer Service cancel that same item on the order.
6. Go to OM and open the Order and open the Invoice.
7. Click on payment.
8. Add the amount which is equal to invoice amount and click on process payment.
9. Divide by Zero error will occur.

Workaround
None

Reported By (1)

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.