Example #1
0
 /**
  * Assign data to info model instance
  *
  * @param   mixed $data
  * @return  Mage_Payment_Model_Info
  */
 public function assignData($data)
 {
     if (!$data instanceof Varien_Object) {
         $data = new Varien_Object($data);
     }
     $info = $this->getInfoInstance();
     $info->setCcType($data->getCcType())->setCcOwner($data->getCcOwner())->setCcLast4(substr($data->getCcNumber(), -4))->setCcNumber($data->getCcNumber())->setCcCid($data->getCcCid())->setCcExpMonth($data->getCcExpMonth())->setCcExpYear($data->getCcExpYear());
     if ($this->getConfigData('mobile_active') && $data->getNetsMobile()) {
         $this->getCheckout()->setNetsMobile(true);
     } else {
         $this->getCheckout()->setNetsMobile(false);
     }
     if ($data->getNetsEasypaymentCard() === "on") {
         $this->getCheckout()->setNetsEasypaymentCard(true);
     } else {
         $this->getCheckout()->setNetsEasypaymentCard(false);
     }
     return $this;
 }