* @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'])) {
$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");
}
}
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