X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FUpdateBilling.php;h=86e6b49596573d268a6189873e69fb4370010c41;hb=1761553f7e28866ef0c0a9f54abbb222487cea5c;hp=bc0d9e48c02fc72179b1c0f2be2fc4d9fc3aebae;hpb=a25baa53d60763b3b36f5fd8ca6ad256c93eb999;p=civicrm-core.git diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index bc0d9e48c0..86e6b49596 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -1,7 +1,7 @@ _coid = CRM_Utils_Request::retrieve('coid', 'Integer', $this, FALSE); if ($this->_coid) { $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'info'); - $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'obj'); + $this->_paymentProcessor['object'] = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_coid, 'contribute', 'obj'); $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_coid, 'contribution'); } if ($this->_mid) { $this->_paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'info'); - $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'obj'); + $this->_paymentProcessor['object'] = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_mid, 'membership', 'obj'); $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_mid, 'membership'); $membershipTypes = CRM_Member_PseudoConstant::membershipType(); $membershipTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->_mid, 'membership_type_id'); @@ -101,9 +105,9 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $this->_selfService = TRUE; } - if (!$this->_paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) { + if (!$this->_paymentProcessor['object']->isSupported('updateSubscriptionBillingInfo')) { CRM_Core_Error::fatal(ts("%1 processor doesn't support updating subscription billing details.", - array(1 => $this->_paymentProcessorObj->_processorName) + array(1 => $this->_paymentProcessor['object']->_processorName) )); } $this->assign('paymentProcessor', $this->_paymentProcessor); @@ -142,7 +146,6 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $this->_defaults = array(); if ($this->_subscriptionDetails->contact_id) { - $options = array(); $fields = array(); $names = array( 'first_name', 'middle_name', 'last_name', "street_address-{$this->_bltID}", "city-{$this->_bltID}", @@ -172,21 +175,17 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { } } - $config = CRM_Core_Config::singleton(); // set default country from config if no country set if (empty($this->_defaults["billing_country_id-{$this->_bltID}"])) { $this->_defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry; } - // now fix all state country selectors - CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults); - return $this->_defaults; } /** - * Function to build the form + * Build the form object * * @return void * @access public @@ -210,18 +209,17 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { ) ); - CRM_Core_Payment_Form::buildCreditCard($this); + CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor['object'], TRUE); $this->addFormRule(array('CRM_Contribute_Form_UpdateBilling', 'formRule'), $this); } /** - * global form rule + * Global form rule * * @param array $fields the input form values * @param array $files the uploaded files if any * @param $self * - * @internal param array $options additional user data * * @return true if no errors, else array of errors * @access public