CRM-16566 upgrade authorize.net to support new style IPNS
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 26 May 2015 00:21:03 +0000 (12:21 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 26 May 2015 00:21:03 +0000 (12:21 +1200)
CRM/Core/Payment.php
CRM/Core/Payment/AuthorizeNet.php

index dab234fbe5be2ee9e29bff15d58678c3ce7ee475..ce5e23091bbcdfce96a1c870f716fcca4e49d904 100644 (file)
@@ -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");
       }
     }
 
index cc9cf7cd5c87984abc9d620f182ba5bf8e22e0b3..c0ad5f2049a8c210a0904ac73c9c8afa3fc33555 100644 (file)
@@ -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