Duplicate getPaymentHandler calls do not check if a handler exists

Affected version
2.1, 2.2

NikitOS

Active member
Hello.

All calls to PaymentProfile :: getPaymentHandler do not check if the handler exists, so we get this error:
Error: Call to a member function initiatePayment() on null in src/XF/Pub/Controller/Purchase.php:30

If the provider was added by the add-on and its developer, during the uninstallation of the add-on, also delete the associated payment profiles, we will see another error:
Please choose a valid payment profile to continue with your purchase.

In this case, we see another bug: payment profiles with unavailable providers are also available for selection. There is a similar bug in this report.
 

Mike

XenForo developer
Staff member
I have made a few other tweaks, but I'm mostly going to call this a duplicate of this bug because the changes there more or less resolve this in practice:


If the provider was added by the add-on and its developer, during the uninstallation of the add-on, also delete the associated payment profiles, we will see another error:
Overall, I wouldn't really consider this a bug or unexpected as there isn't really much that can be done. If you're actively using a payment handler from an add-on and you disable or uninstall it, this will have a knock on effect on systems that depended on that. There isn't really anything that can be done about that.
 
Top