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
- Paypal: #3412365: Use PaymentGatewayException:: createForPayment()
- Stripe: #3423811: Use PaymentGatewayException:: createForPayment()
- Braintree: #3410198: Use PaymentGatewayException:: createForPayment()
- Authorize.net: #3425496: Use PaymentGatewayException:: createForPayment()
- Square: #3425498: Use PaymentGatewayException:: createForPayment()
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
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:
- 3410195-make-it-easy changes, plain diff MR !211
- 3410195-3.0.x changes, plain diff MR !231
Comments
Comment #4
alexpottComment #6
alexpottHid 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.
Comment #7
alexpottComment #8
alexpottAdded a change record for payment gateway authors - https://www.drupal.org/node/3426339
Comment #11
jsacksick CreditAttribution: jsacksick at Centarro commentedThanks a lot! Committed! Should have edited the commit message as it looks weird but too late for that :).