Skip to content
Snippets Groups Projects
Commit a3bf0691 authored by mattwire's avatar mattwire
Browse files

Don't trigger exception if payment processor ID not found for IPN, use debug...

Don't trigger exception if payment processor ID not found for IPN, use debug function because we don't have access to getPaymentProcessorLabel() function
parent f6a1c63a
No related branches found
No related tags found
1 merge request!90.9
......@@ -38,7 +38,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* The IPN event type
* @var string
*/
protected $event_type = NULL;
protected $eventType = NULL;
/**
* Exit on exceptions (TRUE), or just throw them (FALSE).
......@@ -89,15 +89,15 @@ trait CRM_Core_Payment_MJWIPNTrait {
/**
* Get the payment processor
* The $_GET['processor_id'] value is set by CRM_Core_Payment::handlePaymentMethod.
*
* @throws \CRM_Core_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
protected function getPaymentProcessor() {
$paymentProcessorId = CRM_Utils_Request::retrieveValue('processor_id', 'Positive', NULL, FALSE, 'GET');
if (empty($paymentProcessorId)) {
$this->exception('Failed to get payment processor id');
}
$paymentProcessorID = CRM_Utils_Request::retrieveValue('processor_id', 'Positive', NULL, TRUE, 'GET');
try {
$this->_paymentProcessor = \Civi\Payment\System::singleton()->getById($paymentProcessorId);
$this->_paymentProcessor = \Civi\Payment\System::singleton()->getById($paymentProcessorID);
}
catch(Exception $e) {
$this->exception('Failed to get payment processor');
......@@ -399,7 +399,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
protected function exception($message) {
$errorMessage = $this->_paymentProcessor->getPaymentProcessorLabel() . ' Exception: Event: ' . $this->event_type . ' Error: ' . $message;
$errorMessage = $this->_paymentProcessor->getPaymentProcessorLabel() . ' Exception: Event: ' . $this->eventType . ' Error: ' . $message;
Civi::log()->debug($errorMessage);
if ($this->exitOnException) {
http_response_code(400);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment