Esempio n. 1
0
 /**
  * Coverts payment instance to authorize.net array
  * @param Mage_Sales_Model_Quote_Payment $Payment
  * @return array
  */
 protected function _convertPayment(Mage_Sales_Model_Quote_Payment $Payment)
 {
     $cardNumber = Mage::getSingleton('customer/session')->getSarpCcNumber();
     $cid = Mage::getSingleton('customer/session')->getSarpCcCid();
     $an_payment = array('creditCard' => array('cardNumber' => $cardNumber, 'expirationDate' => $Payment->getMethodInstance()->getInfoInstance()->getCcExpYear() . "-" . $this->_addZero($Payment->getMethodInstance()->getInfoInstance()->getCcExpMonth()), 'cardCode' => $cid));
     return $an_payment;
 }
Esempio n. 2
0
 public function exportPaymentTo(Mage_Sales_Model_Quote_Payment $payment)
 {
     $resource = $this->getPayment();
     if (!$resource->getMethod()) {
         return $this;
     }
     $countryId = $this->getAddress()->getCountryId();
     $payment->setMethod($resource->getMethod());
     $method = $payment->getMethodInstance();
     if (!$method->isAvailable($payment->getQuote()) || !$method->canUseForCountry($countryId)) {
         $payment->unsMethod();
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * Encrypt the payment data for the given payment model
  *
  * @param Mage_Sales_Model_Quote_Payment|Mage_Sales_Model_Order_Payment $payment Payment Model
  */
 protected function _encryptPaymentData($payment)
 {
     try {
         $method = $payment->getMethodInstance();
     } catch (Exception $e) {
         return $this;
     }
     if ($method instanceof Itabs_Debit_Model_Debit) {
         $info = $method->getInfoInstance();
         if ($payment->getData('debit_swift') != '') {
             $payment->setData('debit_swift', $info->encrypt($payment->getData('debit_swift')));
         }
         if ($payment->getData('debit_iban') != '') {
             $payment->setData('debit_iban', $info->encrypt($payment->getData('debit_iban')));
         }
     }
 }