This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility with One Step Checkout Brasil 6 Pro (inovarti)
Merge pull request #67 from pagseguro/desenvolvimento
- Loading branch information
Showing
21 changed files
with
501 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* Form block for boleto payment | ||
*/ | ||
class UOL_PagSeguro_Block_Form_Boleto extends Mage_Payment_Block_Form | ||
{ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$paymentModel = Mage::getSingleton('UOL_PagSeguro_Model_PaymentMethod'); | ||
$this->setBoletoSession($paymentModel->getSession()); | ||
$this->setTemplate('uol/pagseguro/form/boleto.phtml'); | ||
} | ||
|
||
protected function _prepareLayout() | ||
{ | ||
if ($this->getLayout()->getBlock('head')) { | ||
$this->getLayout()->getBlock('head')->addItem('skin_js', 'uol/pagseguro/js/direct-payment.js'); | ||
$this->getLayout()->getBlock('head')->addItem('skin_js', 'uol/pagseguro/js/boleto.js'); | ||
$this->getLayout()->getBlock('head')->addItem('skin_css', 'uol/pagseguro/css/direct-payment.css'); | ||
|
||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->initializePagSeguro(); | ||
} | ||
} | ||
} | ||
|
||
protected function _prepareLayout() | ||
{ | ||
$paymentModel = Mage::getSingleton('UOL_PagSeguro_Model_PaymentMethod'); | ||
if ($paymentModel->getOneStepCheckoutIsEnabled()) { | ||
$directPaymentCss = 'uol/pagseguro/css/direct-payment-onestepcheckout.css'; | ||
} else { | ||
$directPaymentCss = 'uol/pagseguro/css/direct-payment.css'; | ||
} | ||
|
||
if ($this->getLayout()->getBlock('head')) { | ||
$this->getLayout()->getBlock('head')->addItem('skin_js', 'uol/pagseguro/js/direct-payment.js'); | ||
$this->getLayout()->getBlock('head')->addItem('skin_js', 'uol/pagseguro/js/boleto.js'); | ||
$this->getLayout()->getBlock('head')->addItem('skin_css', $directPaymentCss); | ||
} | ||
} | ||
|
||
/** | ||
* Set variables to be used in pagseguro boleto form (boleto.phtml) | ||
*/ | ||
private function initializePagSeguro() | ||
{ | ||
$paymentModel = Mage::getSingleton('UOL_PagSeguro_Model_PaymentMethod'); | ||
if ($paymentModel->getOneStepCheckoutIsEnabled()) { | ||
$this->setPagSeguroBeforeSaveJsSkinUrl($this->getSkinUrl('uol/pagseguro/js/pagseguro-onestepcheckout-before-save.js')); | ||
} else { | ||
$this->setPagSeguroBeforeSaveJsSkinUrl($this->getSkinUrl('uol/pagseguro/js/pagseguro-before-save.js')); | ||
} | ||
// if customer is loged, get his document info (taxvat) | ||
if (Mage::getSingleton('customer/session')->isLoggedIn()) { | ||
$customer = Mage::getSingleton('customer/session')->getCustomer(); | ||
$this->setBoletoDocument($customer->getData()['taxvat']); | ||
} | ||
// set boleto session | ||
$this->setBoletoSession($paymentModel->getSession()); | ||
// set template | ||
$this->setTemplate('uol/pagseguro/form/boleto.phtml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.