-
Notifications
You must be signed in to change notification settings - Fork 2
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 #41 from compropago/refactor
Refactor
- Loading branch information
Showing
40 changed files
with
978 additions
and
477 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,6 @@ | ||
<?php | ||
|
||
class ComproPago_Base_Helper_Data extends Mage_Payment_Helper_Data | ||
{ | ||
|
||
} |
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,36 @@ | ||
<?php | ||
|
||
class ComproPago_Cash_Model_Oberver | ||
{ | ||
/** | ||
* Set ComproPago retro to config panel | ||
* @param $observer | ||
* @throws Varien_Exception | ||
*/ | ||
public function retro($observer) | ||
{ | ||
$session = Mage::getSingleton('adminhtml/session'); | ||
|
||
$config = [ | ||
"mode" => Mage::getStoreConfig('payment/base/mode'), | ||
"public_key" => Mage::getStoreConfig('payment/base/publickey'), | ||
"private_key" => Mage::getStoreConfig('payment/base/privatekey'), | ||
"cash_enable" => Mage::getStoreConfig('payment/cash/active') | ||
]; | ||
|
||
try { | ||
$this->validate($config); | ||
} catch (\Exception $e) { | ||
$session->addWarning($e->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Validate configuration | ||
* @param $config | ||
*/ | ||
private function validate($config) | ||
{ | ||
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,33 @@ | ||
<?xml version="1.0"?> | ||
<config> | ||
<modules> | ||
<ComproPago_Webhook> | ||
<version>0.0.0.1</version> | ||
</ComproPago_Webhook> | ||
</modules> | ||
|
||
<global> | ||
<helpers> | ||
<base> | ||
<class>ComproPago_Base_Helper</class> | ||
</base> | ||
</helpers> | ||
|
||
<models> | ||
<base> | ||
<class>ComproPago_Base_Model</class> | ||
</base> | ||
</models> | ||
|
||
<events> | ||
<admin_system_config_changed_section_payment> | ||
<observers> | ||
<cash_retro> | ||
<class>base/observer</class> | ||
<method>retro</method> | ||
</cash_retro> | ||
</observers> | ||
</admin_system_config_changed_section_payment> | ||
</events> | ||
</global> | ||
</config> |
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,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<config> | ||
<sections> | ||
<payment> | ||
<groups> | ||
<base translate="label" module="base"> | ||
<label>ComproPago Base Config</label> | ||
<frontend_type>text</frontend_type> | ||
<sort_order>100</sort_order> | ||
<show_in_default>1</show_in_default> | ||
<show_in_website>1</show_in_website> | ||
<show_in_store>1</show_in_store> | ||
|
||
<fields> | ||
<publickey translate="label"> | ||
<label>Llave Publica</label> | ||
<frontend_type>text</frontend_type> | ||
<sort_order>6</sort_order> | ||
<show_in_default>1</show_in_default> | ||
<show_in_website>1</show_in_website> | ||
<show_in_store>0</show_in_store> | ||
</publickey> | ||
|
||
<privatekey translate="label"> | ||
<label>Llave Privada</label> | ||
<frontend_type>text</frontend_type> | ||
<sort_order>7</sort_order> | ||
<show_in_default>1</show_in_default> | ||
<show_in_website>1</show_in_website> | ||
<show_in_store>0</show_in_store> | ||
</privatekey> | ||
|
||
<mode translate="label"> | ||
<label>Modo activo</label> | ||
<frontend_type>select</frontend_type> | ||
<comment>Estas generando pruebas? cambia a 'no'</comment> | ||
<source_model>adminhtml/system_config_source_yesno</source_model> | ||
<sort_order>8</sort_order> | ||
<show_in_default>1</show_in_default> | ||
<show_in_website>1</show_in_website> | ||
<show_in_store>0</show_in_store> | ||
</mode> | ||
</fields> | ||
</base> | ||
</groups> | ||
</payment> | ||
</sections> | ||
</config> |
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.