forked from OpenMage/magento-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61c419b
commit 52438d7
Showing
118 changed files
with
3,733 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Form extends Mage_Payment_Block_Form | ||
{ | ||
/** | ||
* Constructor. Set template. | ||
*/ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('moneybookers/form.phtml'); | ||
} | ||
|
||
/** | ||
* Return payment logo image src | ||
* | ||
* @param string $payment Payment Code | ||
* @return string|bool | ||
*/ | ||
public function getPaymentImageSrc($payment) | ||
{ | ||
$imageFilename = Mage::getDesign() | ||
->getFilename('images' . DS . 'moneybookers' . DS . $payment, array('_type' => 'skin')); | ||
|
||
if (file_exists($imageFilename . '.png')) { | ||
return $this->getSkinUrl('images/moneybookers/' . $payment . '.png'); | ||
} else if (file_exists($imageFilename . '.gif')) { | ||
return $this->getSkinUrl('images/moneybookers/' . $payment . '.gif'); | ||
} | ||
|
||
return false; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Info extends Mage_Payment_Block_Info | ||
{ | ||
/** | ||
* Constructor. Set template. | ||
*/ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('moneybookers/info.phtml'); | ||
} | ||
|
||
/** | ||
* Returns code of payment method | ||
* | ||
* @return string | ||
*/ | ||
public function getMethodCode() | ||
{ | ||
return $this->getInfo()->getMethodInstance()->getCode(); | ||
} | ||
|
||
/** | ||
* Build PDF content of info block | ||
* | ||
* @return string | ||
*/ | ||
public function toPdf() | ||
{ | ||
$this->setTemplate('moneybookers/pdf/info.phtml'); | ||
return $this->toHtml(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template | ||
{ | ||
/** | ||
* Include JS in head if section is moneybookers | ||
*/ | ||
protected function _prepareLayout() | ||
{ | ||
$section = $this->getAction()->getRequest()->getParam('section', false); | ||
if ($section == 'moneybookers') { | ||
$this->getLayout() | ||
->getBlock('head') | ||
->addJs('mage/adminhtml/moneybookers.js'); | ||
} | ||
parent::_prepareLayout(); | ||
} | ||
|
||
/** | ||
* Print init JS script into body | ||
* @return string | ||
*/ | ||
protected function _toHtml() | ||
{ | ||
$section = $this->getAction()->getRequest()->getParam('section', false); | ||
if ($section == 'moneybookers') { | ||
return parent::_toHtml(); | ||
} else { | ||
return ''; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Payment extends Mage_Core_Block_Template | ||
{ | ||
/** | ||
* Return Payment logo src | ||
* | ||
* @return string | ||
*/ | ||
public function getMoneybookersLogoSrc() | ||
{ | ||
$locale = Mage::getModel('moneybookers/acc')->getLocale(); | ||
$logoFilename = Mage::getDesign() | ||
->getFilename('images' . DS . 'moneybookers' . DS . 'banner_120_' . $locale . '.png', array('_type' => 'skin')); | ||
|
||
if (file_exists($logoFilename)) { | ||
return $this->getSkinUrl('images/moneybookers/banner_120_'.$locale.'.png'); | ||
} | ||
|
||
return $this->getSkinUrl('images/moneybookers/banner_120_int.png'); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
app/code/community/Phoenix/Moneybookers/Block/Placeform.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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Placeform extends Mage_Core_Block_Template | ||
{ | ||
/** | ||
* Return checkout session instance | ||
* | ||
* @return Mage_Checkout_Model_Session | ||
*/ | ||
protected function _getCheckout() | ||
{ | ||
return Mage::getSingleton('checkout/session'); | ||
} | ||
|
||
/** | ||
* Return order instance | ||
* | ||
* @return Mage_Sales_Model_Order|null | ||
*/ | ||
protected function _getOrder() | ||
{ | ||
if ($this->getOrder()) { | ||
return $this->getOrder(); | ||
} elseif ($orderIncrementId = $this->_getCheckout()->getLastRealOrderId()) { | ||
return Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* Get Form data by using ogone payment api | ||
* | ||
* @return array | ||
*/ | ||
public function getFormData() | ||
{ | ||
return $this->_getOrder()->getPayment()->getMethodInstance()->getFormFields(); | ||
} | ||
|
||
/** | ||
* Getting gateway url | ||
* | ||
* @return string | ||
*/ | ||
public function getFormAction() | ||
{ | ||
return $this->_getOrder()->getPayment()->getMethodInstance()->getUrl(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
app/code/community/Phoenix/Moneybookers/Block/Redirect.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Magento | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Phoenix | ||
* @package Phoenix_Moneybookers | ||
* @copyright Copyright (c) 2009 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template | ||
{ | ||
/** | ||
* Constructor. Set template. | ||
*/ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('moneybookers/redirect.phtml'); | ||
} | ||
} |
Oops, something went wrong.