public function getGwapPaymentData($payment) { $data = new Varien_Object(); if ($payment->getCcType()) { $data->setCcType($payment->getCcType()); } if ($payment->getCcOwner()) { $data->setCcOwner($payment->getCcOwner()); } if ($payment->getCcLast4()) { $data->setCcLast4($payment->getCcLast4()); } if (Mage::getModel('core/session')->getGwapCcCcNumber()) { $data->setCcNumber(Mage::getModel('core/session')->getGwapCcCcNumber()); } if (Mage::getModel('core/session')->getGwapCcId()) { $data->setCcCid(Mage::getModel('core/session')->getGwapCcId()); } if ($payment->getCcParcelas()) { $data->setCcParcelas($payment->getCcParcelas()); } if ($payment->getCcExpMonth()) { $data->setCcExpMonth($payment->getCcExpMonth()); } if ($payment->getCcExpYear()) { $data->setCcExpYear($payment->getCcExpYear()); } if ($payment->getAdditionalInformation('GwapBoletoType')) { $data->setGwapBoletoType($payment->getAdditionalInformation('GwapBoletoType')); } if ($payment->getAdditionalInformation('GwapCheckOneclick')) { $data->setGwapCcCheckOneclick($payment->getAdditionalInformation('GwapCheckOneclick')); } if ($payment->getAdditionalInformation('GwapOneclickSelected')) { $data->setGwapOneclickSelected($payment->getAdditionalInformation('GwapOneclickSelected')); } if ($payment->getAdditionalInformation('GwapSessionId')) { $data->setGwapSessionId($payment->getAdditionalInformation('GwapSessionId')); } Mage::getModel('core/session')->setGwapCcId(); Mage::getModel('core/session')->setGwapCcCcNumber(); if ($payment->getMethod() == 'gwap_2cc') { $data->setCcAmount($payment->getAdditionalInformation('gwapCcAmount')); $data->setCcType2($payment->getAdditionalInformation('gwapCcType2')); $data->setCcOwner2($payment->getAdditionalInformation('gwapCcOwner2')); $data->setCcLast4_2($payment->getAdditionalInformation('gwapCcLast4_2')); $data->setCcNumber2($payment->getAdditionalInformation('gwapCcNumber2')); $data->setCcParcelas2($payment->getAdditionalInformation('gwapCcParcelas2')); $data->setCcCid2($payment->getAdditionalInformation('gwapCcCid2')); $data->setCcExpMonth2($payment->getAdditionalInformation('gwapCcExpMonth2')); $data->setCcExpYear2($payment->getAdditionalInformation('gwapCcExpYear2')); $payment->setAdditionalInformation('gwapCcNumber2', ''); $payment->setAdditionalInformation('gwapCcCid2', ''); } if ($payment->getMethod() == 'gwap_oneclick') { $data->setCcType($payment->getAdditionalInformation('oneclickType')); } return $data; }