CRM-19656 - Ensure user updates to subscription info succeed
authorJamie McClelland <jm@mayfirst.org>
Wed, 16 Nov 2016 16:59:10 +0000 (11:59 -0500)
committerJamie McClelland <jm@mayfirst.org>
Wed, 16 Nov 2016 16:59:10 +0000 (11:59 -0500)
Remove redundant variable and consistently use
_paymentProcessor['object']

CRM/Contribute/Form/UpdateBilling.php

index a46bb7a236762a099bec8dbfe61406aecfb85102..9852a1115dbf95396f15b9fcb0fab1c16304eccb 100644 (file)
@@ -50,8 +50,6 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
    */
   public $_paymentProcessor = array();
 
-  public $_paymentProcessorObj = NULL;
-
   /**
    * Set variables up before form is built.
    */
@@ -60,7 +58,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
     $this->_crid = CRM_Utils_Request::retrieve('crid', 'Integer', $this, FALSE);
     if ($this->_crid) {
       $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'info');
-      $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'obj');
+      $this->_paymentProcessor['object'] = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'obj');
       $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_crid);
 
       // Are we cancelling a recurring contribution that is linked to an auto-renew membership?
@@ -244,9 +242,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
     $processorParams['year'] = $processorParams['credit_card_exp_date']['Y'];
     $processorParams['subscriptionId'] = $this->_subscriptionDetails->subscription_id;
     $processorParams['amount'] = $this->_subscriptionDetails->amount;
-
-    $updateSubscription = $this->_paymentProcessorObj->updateSubscriptionBillingInfo($message, $processorParams);
-
+    $updateSubscription = $this->_paymentProcessor['object']->updateSubscriptionBillingInfo($message, $processorParams);
     if (is_a($updateSubscription, 'CRM_Core_Error')) {
       CRM_Core_Error::displaySessionError($updateSubscription);
     }