Add logging for payment failures during checkout

Created on 11 February 2020, almost 5 years ago
Updated 7 December 2023, 11 months ago

This builds upon โœจ Add payment logging to orders Fixed . During checkout, payment gateways throw payment gateway exceptions that are logged. It would be helpful to also create Order logs that can be viewed along with the rest of the order history.

I've created a new CUSTOMER_PAYMENT_FAILURE payment event. It gets dispatched by the PaymentProcess checkout pane (for failures creating payments), the PaymentCheckoutController (for off-site payment gateways), and the PaymentMethodAddForm plugin form (for failures creating payment methods).

The Order entity, PaymentGatewayException exception, and Payment gateway entity are all set when the event is dispatched. The Payment entity is an optional parameter that is set when available. For the PaymentMethodAddForm, we can get the Order from the route; if the order isn't available, the event is not dispatched.

The log that is generated displays the payment amount (the order balance), The payment gateway label, and the exception label. For example:

Payment failed: $253.59. Payment gateway: Braintree. Error: Do Not Honor.

โœจ Feature request
Status

Fixed

Version

2.0

Component

Payment

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States lisastreeter

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024