From a2dd09cc88e72ce5af9360f32f0412d58529bc7f Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Sun, 5 May 2013 08:54:52 -0700 Subject: [PATCH] CRM-12494 ---------------------------------------- * CRM-12494: updating authorize.net recurring contribution with unlimited contributions throws error http://issues.civicrm.org/jira/browse/CRM-12494 --- CRM/Core/Payment/AuthorizeNet.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index 3b4047575d..e4b57240cb 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -274,9 +274,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { } $template->assign( 'startDate', $startDate->format('Y-m-d') ); - // for open ended subscription totalOccurrences has to be 9999 + $installments = $this->_getParam('installments'); - $template->assign('totalOccurrences', $installments ? $installments : 9999); + + // for open ended subscription totalOccurrences has to be 9999 + $installments = empty($installments) ? 9999 : $installments; + $template->assign('totalOccurrences', $installments); $template->assign('amount', $this->_getParam('amount')); @@ -554,8 +557,9 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { */ function _getParam($field, $xmlSafe = FALSE) { $value = CRM_Utils_Array::value($field, $this->_params, ''); - if ($xmlSafe) + if ($xmlSafe) { $value = str_replace(array( '&', '"', "'", '<', '>' ), '', $value); + } return $value; } -- 2.25.1