public function validate() { parent::validate(); $payment = array(); $params = array(); $payment = Mage::app()->getRequest()->getPOST('payment'); if ($payment['method'] == $this->_code) { if (empty($payment[$this->_code . '_holder'])) { Mage::throwException($this->_getHelper()->__('Please specify a account holder')); } if (empty($payment[$this->_code . '_iban'])) { Mage::throwException($this->_getHelper()->__('Please specify a iban or account')); } if (empty($payment[$this->_code . '_bic'])) { Mage::throwException($this->_getHelper()->__('Please specify a bic or bank code')); } $params['ACCOUNT.HOLDER'] = $payment[$this->_code . '_holder']; if (preg_match('#^[\\d]#', $payment[$this->_code . '_iban'])) { $params['ACCOUNT.NUMBER'] = $payment[$this->_code . '_iban']; } else { $params['ACCOUNT.IBAN'] = $payment[$this->_code . '_iban']; } if (preg_match('#^[\\d]#', $payment[$this->_code . '_bic'])) { $params['ACCOUNT.BANK'] = $payment[$this->_code . '_bic']; $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry(); } else { $params['ACCOUNT.BIC'] = $payment[$this->_code . '_bic']; } $this->saveCustomerData($params); return $this; } return $this; }
public function isAvailable($quote = null) { $currency_code = $this->getQuote()->getQuoteCurrencyCode(); if (!empty($currency_code) && $currency_code != 'TRY') { return false; } return parent::isAvailable($quote); }
public function isAvailable($quote = null) { $billing = $this->getQuote()->getBillingAddress(); $shipping = $this->getQuote()->getShippingAddress(); if ($billing->getFirstname() != $shipping->getFirstname() or $billing->getLastname() != $shipping->getLastname() or $billing->getStreet() != $shipping->getStreet() or $billing->getPostcode() != $shipping->getPostcode() or $billing->getCity() != $shipping->getCity() or $billing->getCountry() != $shipping->getCountry()) { return false; } return parent::isAvailable($quote); }
public function validate() { parent::validate(); $payment = Mage::app()->getRequest()->getPOST('payment'); if (empty($payment[$this->_code . '_pf'])) { $errorCode = 'invalid_data'; $errorMsg = $this->_getHelper()->__('No Postfinance method selected'); Mage::throwException($errorMsg); return $this; } $this->saveCustomerData(array('ACCOUNT.BRAND' => $payment[$this->_code . '_pf'])); return $this; }
public function validate() { parent::validate(); $payment = array(); $params = array(); $payment = Mage::app()->getRequest()->getPOST('payment'); if ($payment['method'] == $this->_code) { if (empty($payment[$this->_code . '_holder'])) { Mage::throwException($this->_getHelper()->__('Please specify a account holder')); } $params['ACCOUNT.HOLDER'] = $payment[$this->_code . '_holder']; $params['ACCOUNT.BANKNAME'] = $payment[$this->_code . '_bank']; $params['ACCOUNT.COUNTRY'] = $this->getQuote()->getBillingAddress()->getCountry(); $this->saveCustomerData($params); return $this; } return $this; }
public function getUser($order, $isReg = false) { $user = array(); $user = parent::getUser($order, $isReg); $adress = $order->getShippingAddress() == false ? $order->getBillingAddress() : $order->getShippingAddress(); $email = $adress->getEmail() ? $adress->getEmail() : $order->getCustomerEmail(); $user['IDENTIFICATION.SHOPPERID'] = $adress->getCustomerId(); if ($adress->getCompany() == true) { $user['NAME.COMPANY'] = trim($adress->getCompany()); } $user['NAME.GIVEN'] = trim($adress->getFirstname()); $user['NAME.FAMILY'] = trim($adress->getLastname()); $user['ADDRESS.STREET'] = $adress->getStreet1() . " " . $adress->getStreet2(); $user['ADDRESS.ZIP'] = $adress->getPostcode(); $user['ADDRESS.CITY'] = $adress->getCity(); $user['ADDRESS.COUNTRY'] = $adress->getCountry(); $user['CONTACT.EMAIL'] = $email; return $user; }