Skip to content

Commit

Permalink
Merge pull request #22900 from MegaphoneJon/paymentprocessor-error-bu…
Browse files Browse the repository at this point in the history
…bble-up

Expose payment processor error from PaymentProcessor.pay
  • Loading branch information
seamuslee001 authored Mar 7, 2022
2 parents db66639 + fe3055a commit 76f3518
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/v3/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ function civicrm_api3_payment_processor_pay($params) {
if (empty($code)) {
$code = 'EXTERNAL_FAILURE';
}
throw new API_Exception('Payment failed', $code, $errorData, $e);
$message = $e->getMessage() ?? 'Payment Failed';
throw new API_Exception($message, $code, $errorData, $e);
}
return civicrm_api3_create_success(array($result), $params);
}
Expand Down

0 comments on commit 76f3518

Please sign in to comment.