public function assignData($data) { if (!$data instanceof Varien_Object) { $data = new Varien_Object($data); } $info = $this->getInfoInstance(); $info->setCardToken($data->getCardToken())->setChargeAuthorization($data->getChargeAuthorization())->setCardMonthlyInstallments($data->getCardMonthlyInstallments())->setCcOwner($data->getCcOwner())->setCcLast4($data->getCcLast4())->setCcType($data->getCcType())->setCardBin($data->getCardBin()); return $this; }
public function assignData($data) { if (!$data instanceof Varien_Object) { $data = new Varien_Object($data); } $cardToken = $data->getCardToken(); $ipAddress = $data->getIpAddress(); $offlineTransId = $data->getOfflineTransactionId(); $type = $data->getType(); if (empty($cardToken) || empty($ipAddress)) { Mage::log('Payment could not be processed. Missing card token or IP', Zend_Log::ERR, self::$logFile); Mage::throwException(Mage::helper('pinpay')->__(self::GENERIC_PAYMENT_GATEWAY_ERROR)); } // Store the authorised card token and customer IP $this->getInfoInstance()->setAdditionalInformation("card_token", $data->getCardToken()); $this->getInfoInstance()->setAdditionalInformation("ip_address", $data->getIpAddress()); // Store the offline transaction ID if supplied if (Mage::app()->getStore()->isAdmin() && !empty($offlineTransId) && $type == self::OFFLINE) { $this->getInfoInstance()->setAdditionalInformation("offline_transaction_id", $offlineTransId); } return $this; }