- Issue created by @Ahmed Eldesoky
- 🇪🇬Egypt Ahmed Eldesoky
This patch fixes the problem , and return FALSE in case of failure to load the payment method
- 🇭🇷Croatia tamerzg
We tested the patch on our website and it works as expected.
Steps to reproduce , when the option of saving cards for future usage is enabled
you will get this error
Error: Call to a member function getType() on null in Drupal\commerce_stripe\Plugin\Commerce\PaymentGateway\StripePaymentElement->canCapturePayment()
Traceback of the error points to this line
https://git.drupalcode.org/project/commerce_stripe/-/blob/8.x-1.2/src/Pl...
because it couldn't retrieve the deleted payment method
the function canCapturePayment is called in the context of the order payments page because it is needed to build the operations associated with the payment which includes the capture operation
Active
1.2
Code
This patch fixes the problem , and return FALSE in case of failure to load the payment method
We tested the patch on our website and it works as expected.