Skip to content

Commit

Permalink
Merge pull request #17596 from eileenmcnaughton/deprecation
Browse files Browse the repository at this point in the history
dev/financial#131 Give deprecation notice if the payment processor returns an error
  • Loading branch information
seamuslee001 authored Jun 14, 2020
2 parents 28f4802 + 560a6a0 commit 534731d
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 534731d

Please sign in to comment.