Example #1
0
 /**
  * Call centinel api lookup method
  *
  * @return Mage_Centinel_Model_Api
  */
 public function callLookup($data)
 {
     $result = new Varien_Object();
     $month = strlen($data->getCardExpMonth()) == 1 ? '0' . $data->getCardExpMonth() : $data->getCardExpMonth();
     $currencyCode = $data->getCurrencyCode();
     $currencyNumber = isset(self::$_iso4217Currencies[$currencyCode]) ? self::$_iso4217Currencies[$currencyCode] : '';
     if (!$currencyNumber) {
         return $result->setErrorNo(1)->setErrorDesc(Mage::helper('payment')->__('Unsupported currency code: %s.', $currencyCode));
     }
     $clientResponse = $this->_call('cmpi_lookup', array('Amount' => round($data->getAmount() * 100), 'CurrencyCode' => $currencyNumber, 'CardNumber' => $data->getCardNumber(), 'CardExpMonth' => $month, 'CardExpYear' => $data->getCardExpYear(), 'OrderNumber' => $data->getOrderNumber()));
     $result->setErrorNo($clientResponse->getValue('ErrorNo'));
     $result->setErrorDesc($clientResponse->getValue('ErrorDesc'));
     $result->setTransactionId($clientResponse->getValue('TransactionId'));
     $result->setEnrolled($clientResponse->getValue('Enrolled'));
     $result->setAcsUrl($clientResponse->getValue('ACSUrl'));
     $result->setPayload($clientResponse->getValue('Payload'));
     $result->setEciFlag($clientResponse->getValue('EciFlag'));
     return $result;
 }