Make it easy to add payment info to \Drupal\commerce_payment\Exception\PaymentGatewayException

Created on 21 December 2023, 11 months ago
Updated 21 March 2024, 8 months ago

Problem/Motivation

Now that we're logging failed payment let's make it easy to attach payments to the exception so we can get extra information.

This will allow reports about fail payments to track problems with specific card types.

Proposed resolution

PaymentGatewayException::createForPayment() to make passing payment info to the failed payment event easier.

Once this has landed I'll be working on

Remaining tasks

None

User interface changes

None

API changes

New method PaymentGatewayException::createForPayment() that attaches a payment or payment method to an exception. This in turn allows this information to get to the \Drupal\commerce_payment\Event\FailedPaymentEvent so there's more context about what has failed - if the payment gateway provides it.

Data model changes

None

📌 Task
Status

Fixed

Version

3.0

Component

Payment

Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024