From 29acc4416040bacaf6d7951ba0d4950b473b61e7 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Mon, 21 Mar 2016 18:20:19 -0400 Subject: [PATCH] CRM-18107 PayPal Standard IPN fails if payment processor id != payment processor type id --- CRM/Core/Payment/PayPalIPN.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 87df34f040..0de616173e 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -321,11 +321,17 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { $ids['onbehalf_dupe_alert'] = self::retrieve('onBehalfDupeAlert', 'Integer', 'GET', FALSE); } - $paymentProcessorID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', - 'PayPal_Standard', 'id', 'name' + $processorParams = array( + 'user_name' => self::retrieve('receiver_email', 'String', 'POST', FALSE), + 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'PayPal_Standard', 'id', 'name'), + 'is_test' => empty($input['is_test']) ? 0 : 1, ); + $processorInfo = array(); + if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) { + return FALSE; + } - if (!$this->validateData($input, $ids, $objects, TRUE, $paymentProcessorID)) { + if (!$this->validateData($input, $ids, $objects, TRUE, $processorInfo['id'])) { return FALSE; } -- 2.25.1