CRM-12353
authorDonald A. Lobo <lobo@civicrm.org>
Mon, 15 Apr 2013 01:37:28 +0000 (18:37 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Mon, 15 Apr 2013 01:37:28 +0000 (18:37 -0700)
----------------------------------------
* CRM-12353: installments array value not set
  http://issues.civicrm.org/jira/browse/CRM-12353

CRM/Core/Payment/PayPalImpl.php

index 7a7d3f3586a6f9f91c40f1d94452ee07dca7b4ed..323eea0bc3c54fe2d61d516c2ed5175000b3b9eb 100644 (file)
@@ -466,8 +466,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
     return FALSE;
   }
 
-  function changeSubscriptionAmount(&$message = '', $params = array(
-    )) {
+  function changeSubscriptionAmount(&$message = '', $params = array()) {
     if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') {
       $config = CRM_Core_Config::singleton();
       $args = array();
@@ -610,12 +609,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
 
       $paypalParams += array(
         'cmd' => '_xclick-subscriptions',
-        'a3' => $params['amount'],
-        'p3' => $params['frequency_interval'],
-        't3' => ucfirst(substr($params['frequency_unit'], 0, 1)),
+        'a3'  => $params['amount'],
+        'p3'  => $params['frequency_interval'],
+        't3'  => ucfirst(substr($params['frequency_unit'], 0, 1)),
         'src' => 1,
         'sra' => 1,
-        'srt' => ($params['installments'] > 0) ? $params['installments'] : NULL,
+        'srt' => CRM_Utils_Array::value('installments', $params),
         'no_note' => 1,
         'modify' => 0,
       );