response "CAPTURE_NOT_ALLOWED" leads to WSOD

Created on 6 June 2024, 22 days ago

Problem/Motivation

When checking out an order, we got an WSOD. The watchdog log shows us:

Drupal\commerce_payment\Exception\PaymentGatewayException: [403] Client error: `POST https://api.klarna.com/ordermanagement/v1/orders/ORDER_ID/captures` resulted in a `403 Forbidden` response: {"error_code":"CAPTURE_NOT_ALLOWED","error_messages":["Captured amount is higher than the remaining authorized amount. C (truncated...) in Drupal\commerce_klarna_payments\Plugin\Commerce\PaymentGateway\Klarna->capturePayment() (Zeile 363 in /var/www/html/web/modules/contrib/commerce_klarna_payments/src/Plugin/Commerce/PaymentGateway/Klarna.php).

Proposed resolution

Drupal should show a meaningful error message, that the payment was not possible instead of an WSOD.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany onfire84

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024