Skip to content

Commit

Permalink
dev/financial#131 Give deprecation notice if the payment processor re…
Browse files Browse the repository at this point in the history
…turns an error

This notice will show up on dev sites & should highlight the expectation that processors throw errors
  • Loading branch information
eileenmcnaughton committed Jun 13, 2020
1 parent d4b99fb commit 560a6a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ public function doPayment(&$params, $component = 'contribute') {
}
}
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;
Expand Down

0 comments on commit 560a6a0

Please sign in to comment.