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

Issue fork commerce-3410195

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review

alexpott changed the visibility of the branch 3410195-3.0.x to hidden.

alexpott’s picture

Hid the 3.0.x MR because it'd be great if this addition could land in 8.x-2.x as well as 3.0.x.

alexpott’s picture

Issue summary: View changes
alexpott’s picture

Added a change record for payment gateway authors - https://www.drupal.org/node/3426339

jsacksick’s picture

Status: Needs review » Fixed

Thanks a lot! Committed! Should have edited the commit message as it looks weird but too late for that :).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.