dev/financial#131 Give deprecation notice if the payment processor returns an error
authoreileen <emcnaughton@wikimedia.org>
Sat, 13 Jun 2020 01:18:11 +0000 (13:18 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 13 Jun 2020 01:18:11 +0000 (13:18 +1200)
This notice will show up on dev sites & should highlight the expectation that processors throw errors

CRM/Core/Payment.php

index c4e4deb2c583126aa1ee2ce6abef3f4d142de747..ab955db1497f6a89e92b7ce9616cc8b8ffc9b958 100644 (file)
@@ -1375,6 +1375,7 @@ abstract class CRM_Core_Payment {
       }
     }
     if (is_a($result, 'CRM_Core_Error')) {
+      CRM_Core_Error::deprecatedFunctionWarning('payment processors should throw exceptions rather than return errors');
       throw new PaymentProcessorException(CRM_Core_Error::getMessages($result));
     }
     return $result;