Fatal error on payment refund if payment method has been deleted

Created on 25 October 2024, about 2 months ago

Problem/Motivation

If you try to refund a payment on an order which has had it's payment method deleted since the payment was created it will result in a fatal error.
Error: Call to a member function getBillingProfile() on null in Drupal\commerce_authnet\Plugin\Commerce\PaymentGateway\AcceptJs->refundPayment()

Steps to reproduce

Create an order. Delete the payment method used for that order. Attempt to refund the order.

Proposed resolution

Add a check to the code to ensure the payment method exists before trying to continue. Add an error message if payment method doesn't exist.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

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