-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from macopedia/master
Refactor PayU_Account magento plugin
- Loading branch information
Showing
60 changed files
with
2,306 additions
and
2,491 deletions.
There are no files selected for viewing
48 changes: 25 additions & 23 deletions
48
app/code/community/PayU/Account/Block/Adminhtml/Sales/Order/View.php
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
73 changes: 30 additions & 43 deletions
73
app/code/community/PayU/Account/Block/Onestep/Checkout.php
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,53 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* ver. 1.9.0 | ||
* PayU One Step Checkout Block | ||
* ver. 1.9.0 | ||
* PayU One Step Checkout Block | ||
* | ||
* @copyright Copyright (c) 2011-2014 PayU | ||
* @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0) | ||
* http://www.payu.com | ||
* http://www.openpayu.com | ||
* http://twitter.com/openpayu | ||
* @copyright Copyright (c) 2011-2014 PayU | ||
* @license http://opensource.org/licenses/GPL-3.0 Open Software License (GPL 3.0) | ||
* http://www.payu.com | ||
* http://www.openpayu.com | ||
* http://twitter.com/openpayu | ||
*/ | ||
|
||
class PayU_Account_Block_Onestep_Checkout extends Mage_Core_Block_Template | ||
{ | ||
/** @var string Start One Step action */ | ||
protected $_startAction = 'newOneStep'; | ||
|
||
/** @var bool Whether the block should be eventually rendered */ | ||
protected $_shouldRender = true; | ||
|
||
/** | ||
* (non-PHPdoc) | ||
* @see magento/app/code/core/Mage/Core/Block/Mage_Core_Block_Template::_toHtml() | ||
*/ | ||
protected function _toHtml() | ||
{ | ||
if ($this->getRequest()->getParam('submitCustomCheckout')) { | ||
$billingAddress = $this->getRequest()->getParam('billing'); | ||
$billingAddress['use_for_shipping'] = 0; | ||
} | ||
|
||
/** @var PayU_Account_Model_Config $config */ | ||
$config = Mage::getModel('payu_account/config'); | ||
$this->setButtonSrc($config->getButtonSrc()); | ||
$this->setIsOneStepCheckoutEnabled($config->getIsOneStepCheckoutEnabled()); | ||
$this->setCheckoutUrl($config->getUrl($this->_startAction)); | ||
|
||
/** @var config variable */ | ||
protected $_config; | ||
|
||
/** @var string Start One Step action */ | ||
protected $_startAction = 'newOneStep'; | ||
|
||
/** @var bool Whether the block should be eventually rendered */ | ||
protected $_shouldRender = true; | ||
|
||
/** @var string Express checkout model factory name */ | ||
protected $_checkoutType = 'payu_account/express_checkout'; | ||
|
||
/** | ||
* (non-PHPdoc) | ||
* @see magento/app/code/core/Mage/Core/Block/Mage_Core_Block_Template::_toHtml() | ||
*/ | ||
protected function _toHtml() | ||
{ | ||
|
||
|
||
if($this->getRequest()->getParam('submitCustomCheckout')) | ||
{ | ||
$billingAddress = $this->getRequest()->getParam('billing'); | ||
$billingAddress['use_for_shipping'] = 0; | ||
$shippingAddress = $this->getRequest()->getParam('shipping'); | ||
} | ||
|
||
|
||
$this->_config = Mage::getModel('payu_account/config'); | ||
$this->setButtonSrc($this->_config->getButtonSrc()); | ||
$this->setIsOneStepCheckoutEnabled($this->_config->getIsOneStepCheckoutEnabled()); | ||
$this->setIsOneStepCheckoutAvailable($this->_config->getIsOneStepCheckoutAvailable()); | ||
$this->setCheckoutUrl($this->_config->getBaseUrl().$this->_startAction); | ||
|
||
return parent::_toHtml(); | ||
} | ||
} | ||
} |
Oops, something went wrong.