CRM-15537 - translate open ended installments to 9999 for authorize.net
authorJamie McClelland <jm@mayfirst.org>
Tue, 28 Oct 2014 21:21:28 +0000 (17:21 -0400)
committerJamie McClelland <jm@mayfirst.org>
Tue, 28 Oct 2014 21:21:28 +0000 (17:21 -0400)
----------------------------------------
* CRM-15537: editing recurring contribution for authorize.net with unlimited contributions throws error
  https://issues.civicrm.org/jira/browse/CRM-15537

CRM/Core/Payment/AuthorizeNet.php

index 16d2b6d7efeae398cc10c0ffd4ff5ec529173f5b..8fbacdffc55b2192c1158a6a4e5f7d75b798ff54 100644 (file)
@@ -757,7 +757,11 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
     $template->assign('paymentKey', $this->_getParam('paymentKey'));
 
     $template->assign('subscriptionId', $params['subscriptionId']);
-    $template->assign('totalOccurrences', $params['installments']);
+
+    // for open ended subscription totalOccurrences has to be 9999
+    $installments = empty($params['installments']) ? 9999 : $params['installments'];
+    $template->assign('totalOccurrences', $installments);
+
     $template->assign('amount', $params['amount']);
 
     $arbXML = $template->fetch('CRM/Contribute/Form/Contribution/AuthorizeNetARB.tpl');