From 23de1ac098f62001327fc1bd6aac2db04ee327a3 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 26 May 2015 12:21:03 +1200 Subject: [PATCH] CRM-16566 upgrade authorize.net to support new style IPNS --- CRM/Core/Payment.php | 7 ++++++- CRM/Core/Payment/AuthorizeNet.php | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index dab234fbe5..ce5e23091b 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -570,6 +570,9 @@ abstract class CRM_Core_Payment { * @param string $method * 'PaymentNotification' or 'PaymentCron' * @param array $params + * + * @throws \CRM_Core_Exception + * @throws \Exception */ public static function handlePaymentMethod($method, $params = array()) { if (!isset($params['processor_id']) && !isset($params['processor_name'])) { @@ -579,7 +582,9 @@ abstract class CRM_Core_Payment { $params['processor_id'] = $_GET['processor_id'] = $lastParam; } else { - throw new CRM_Core_Exception("Either 'processor_id' or 'processor_name' param is required for payment callback"); + throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is + required + for payment callback"); } } diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index cc9cf7cd5c..c0ad5f2049 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -742,6 +742,14 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { return TRUE; } + /** + * Process incoming notification. + */ + static public function handlePaymentNotification() { + $ipnClass = new CRM_Core_Payment_AuthorizeNetIPN(array_merge($_GET, $_REQUEST)); + $ipnClass->main(); + } + /** * @param string $message * @param array $params -- 2.25.1