-
Notifications
You must be signed in to change notification settings - Fork 11
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
Marine PASQUIN
committed
Jun 20, 2013
1 parent
7c50cff
commit 9bd899f
Showing
34 changed files
with
2,482 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Block_Error extends Mage_Core_Block_Template | ||
{ | ||
} |
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,25 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Block_Form extends Mage_Payment_Block_Form | ||
{ | ||
protected function _construct() | ||
{ | ||
$this->setTemplate('cybermut/form.phtml'); | ||
parent::_construct(); | ||
} | ||
} |
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 | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Block_Redirect extends Mage_Core_Block_Abstract | ||
{ | ||
|
||
protected function _toHtml() | ||
{ | ||
$standard = Mage::getModel('cybermut/payment'); | ||
$form = new Varien_Data_Form(); | ||
$form->setAction($standard->getCybermutUrl()) | ||
->setId('cybermut_payment_checkout') | ||
->setName('cybermut_payment_checkout') | ||
->setMethod('POST') | ||
->setUseContainer(true); | ||
foreach ($standard->setOrder($this->getOrder())->getStandardCheckoutFormFields() as $field => $value) { | ||
$form->addField($field, 'hidden', array('name' => $field, 'value' => $value)); | ||
} | ||
|
||
$formHTML = $form->toHtml(); | ||
|
||
$html = '<html><body>'; | ||
$html.= $this->__('You will be redirected to Cybermut in a few seconds.'); | ||
$html.= $formHTML; | ||
$html.= '<script type="text/javascript">document.getElementById("cybermut_payment_checkout").submit();</script>'; | ||
$html.= '</body></html>'; | ||
|
||
if ($standard->getConfigData('debug_flag')) { | ||
Mage::getModel('cybermut/api_debug') | ||
->setRequestBody($formHTML) | ||
->save(); | ||
} | ||
|
||
return $html; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Helper_Data extends Mage_Core_Helper_Abstract | ||
{ | ||
|
||
} |
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,24 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Api_Debug extends Mage_Core_Model_Abstract | ||
{ | ||
protected function _construct() | ||
{ | ||
$this->_init('cybermut/api_debug'); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/code/community/Quadra/Cybermut/Model/Config/Data/Cybermut.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,29 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Config_Data_Cybermut extends Mage_Core_Model_Config_Data | ||
{ | ||
public function _beforeSave() { | ||
$filename = BP . DS . 'app' . DS . 'code' . DS . 'local' . DS . 'Mage' . DS . 'Cybermut' . DS . 'etc' . DS . 'config.xml'; | ||
|
||
if (file_exists($filename)) { | ||
Mage::getSingleton('adminhtml/session')->addError('Warning: the module Mage_Cybermut must be uninstalled.'); | ||
} | ||
|
||
return $this; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/code/community/Quadra/Cybermut/Model/Mysql4/Api/Debug.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,24 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Mysql4_Api_Debug extends Mage_Core_Model_Mysql4_Abstract | ||
{ | ||
protected function _construct() | ||
{ | ||
$this->_init('cybermut/api_debug', 'debug_id'); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
app/code/community/Quadra/Cybermut/Model/Mysql4/Api/Debug/Collection.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,24 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Mysql4_Api_Debug_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract | ||
{ | ||
protected function _construct() | ||
{ | ||
$this->_init('cybermut/api_debug'); | ||
} | ||
} |
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,20 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup | ||
{ | ||
} |
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,68 @@ | ||
<?php | ||
/* | ||
* 1997-2012 Quadra Informatique | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Open Software License (OSL 3.0) that is available | ||
* through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 | ||
* If you 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. | ||
* | ||
* @author Quadra Informatique <[email protected]> | ||
* @copyright 1997-2013 Quadra Informatique | ||
* @version Release: $Revision: 2.0.5 $ | ||
* @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Quadra_Cybermut_Model_Observer | ||
{ | ||
/** | ||
* Can redirect to Cybermut payment | ||
*/ | ||
public function initRedirect(Varien_Event_Observer $observer) | ||
{ | ||
Mage::getSingleton('checkout/session')->setCanRedirect(true); | ||
} | ||
|
||
/** | ||
* Return Orders Redirect URL | ||
* | ||
* @return string Orders Redirect URL | ||
*/ | ||
public function multishippingRedirectUrl(Varien_Event_Observer $observer) | ||
{ | ||
if (Mage::getSingleton('checkout/session')->getCanRedirect()) { | ||
$orderIds = Mage::getSingleton('core/session')->getOrderIds(); | ||
$orderIdsTmp = $orderIds; | ||
$key = array_pop($orderIdsTmp); | ||
$order = Mage::getModel('sales/order')->loadByIncrementId($key); | ||
|
||
if (!(strpos($order->getPayment()->getMethod(), 'cybermut') === false)) { | ||
Mage::getSingleton('checkout/session')->setRealOrderIds(implode(',', $orderIds)); | ||
Mage::app()->getResponse()->setRedirect(Mage::getUrl('cybermut/payment/redirect')); | ||
} | ||
} else { | ||
Mage::getSingleton('checkout/session')->unsRealOrderIds(); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Disables sending email after the order creation | ||
* | ||
* @return updated order | ||
*/ | ||
public function disableEmailForMultishipping(Varien_Event_Observer $observer) | ||
{ | ||
$order = $observer->getOrder(); | ||
|
||
if (!(strpos($order->getPayment()->getMethod(), 'cybermut') === false)) { | ||
$order->setCanSendNewEmailFlag(false)->save(); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
} |
Oops, something went wrong.