コード例 #1
0
ファイル: Checkout.php プロジェクト: ksaltik/tooldexlive
 /**
  * Set create billing agreement flag to api call
  *
  * @return Mage_Paypal_Model_Express_Checkout
  */
 protected function _setBillingAgreementRequest()
 {
     if (!$this->_customerId || $this->_quote->hasNominalItems()) {
         return $this;
     }
     $isRequested = $this->_isBARequested || $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT);
     if (!($this->_config->allow_ba_signup == Mage_Paypal_Model_Config::EC_BA_SIGNUP_AUTO || $isRequested && $this->_config->shouldAskToCreateBillingAgreement())) {
         return $this;
     }
     if (!Mage::getModel('sales/billing_agreement')->needToCreateForCustomer($this->_customerId)) {
         return $this;
     }
     $this->_api->setBillingType($this->_api->getBillingAgreementType());
     return $this;
 }