Version Notes
Support for PHP 5.6.4
Support for IWD_OPC checkout.
Support for OneStepCheckout.
Support for Monthly Installments and Config.
Support for fraud detection in all pages.
Add custom fields to card purchases for fraud detection.
Add fields to card module for Riskified compatibility.
Add fields to all modules for shipment details.
Add Webhook module management.
Add locale.
Add detailed payment information in admin.
Add detailed payment information on successful payment.
Download this release
Release Info
Developer | Mauricio Murga |
Extension | Conekta_Payment_Extension |
Version | 0.5.5 |
Comparing to | |
See all releases |
Version 0.5.5
- app/code/community/Conekta/.DS_Store +0 -0
- app/code/community/Conekta/Bank/.DS_Store +0 -0
- app/code/community/Conekta/Bank/Block/Adminhtml/System/Config/Date.php.back +21 -0
- app/code/community/Conekta/Bank/Block/Adminhtml/System/Config/Days.php +37 -0
- app/code/community/Conekta/Bank/Block/Form/Bank.php +9 -0
- app/code/community/Conekta/Bank/Block/Info/Bank.php +27 -0
- app/code/community/Conekta/Bank/Helper/Data.php +6 -0
- app/code/community/Conekta/Bank/Model/Bank.php +24 -0
- app/code/community/Conekta/Bank/Model/Observer.php +145 -0
- app/code/community/Conekta/Bank/etc/config.xml +136 -0
- app/code/community/Conekta/Bank/etc/system.xml +73 -0
- app/code/community/Conekta/Bank/sql/.DS_Store +0 -0
- app/code/community/Conekta/Bank/sql/bank_setup/.DS_Store +0 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-install-0.1.0.php +61 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.2.0-0.2.1.php +16 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.2.1-0.3.3.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.3-0.3.7.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.7-0.3.8.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.8-0.3.9.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.9-0.4.0.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.0-0.4.1.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.1-0.4.2.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.2-0.4.3.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.3-0.4.4.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.4-0.4.5.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.5-0.4.6.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.6-0.4.7.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.7-0.4.8.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.8-0.4.9.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.9-0.5.0.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.0-0.5.1.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.1-0.5.2.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.2-0.5.3.php +5 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.3-0.5.4.php +26 -0
- app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.4-0.5.5.php +5 -0
- app/code/community/Conekta/Card/.DS_Store +0 -0
- app/code/community/Conekta/Card/Block/Adminhtml/System/Config/Installments.php +37 -0
- app/code/community/Conekta/Card/Block/Form/Card.php +9 -0
- app/code/community/Conekta/Card/Block/Info/Card.php +24 -0
- app/code/community/Conekta/Card/Block/Page/Html/Head.php +116 -0
- app/code/community/Conekta/Card/Helper/Data.php +6 -0
- app/code/community/Conekta/Card/Model/Card.php +27 -0
- app/code/community/Conekta/Card/Model/Observer.php +150 -0
- app/code/community/Conekta/Card/etc/config.xml +147 -0
- app/code/community/Conekta/Card/etc/system.xml +109 -0
- app/code/community/Conekta/Card/sql/.DS_Store +0 -0
- app/code/community/Conekta/Card/sql/card_setup/.DS_Store +0 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-install-0.1.0.php +41 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.1.0-0.3.3.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.3-0.3.7.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.7-0.3.8.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.8-0.3.9.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.9-0.4.0.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.0-0.4.1.php +16 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.1-0.4.2.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.2-0.4.3.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.3-0.4.4.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.4-0.4.5.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.5-0.4.6.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.6-0.4.7.php +16 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.7-0.4.8.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.8-0.4.9.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.9-0.5.0.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.0-0.5.1.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.1-0.5.2.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.2-0.5.3.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.3-0.5.4.php +5 -0
- app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.4-0.5.5.php +5 -0
- app/code/community/Conekta/Oxxo/.DS_Store +0 -0
- app/code/community/Conekta/Oxxo/Block/Adminhtml/System/Config/Date.php.back +21 -0
- app/code/community/Conekta/Oxxo/Block/Adminhtml/System/Config/Days.php +37 -0
- app/code/community/Conekta/Oxxo/Block/Form/Oxxo.php +9 -0
- app/code/community/Conekta/Oxxo/Block/Info/Oxxo.php +27 -0
- app/code/community/Conekta/Oxxo/Helper/Data.php +6 -0
- app/code/community/Conekta/Oxxo/Model/Observer.php +140 -0
- app/code/community/Conekta/Oxxo/Model/Oxxo.php +22 -0
- app/code/community/Conekta/Oxxo/etc/config.xml +131 -0
- app/code/community/Conekta/Oxxo/etc/system.xml +73 -0
- app/code/community/Conekta/Oxxo/sql/.DS_Store +0 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/.DS_Store +0 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-install-0.1.0.php +39 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.1.8-0.1.9.php +18 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.1.9-0.3.3.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.3-0.3.7.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.7-0.3.8.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.8-0.3.9.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.9-0.4.0.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.0-0.4.1.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.1-0.4.2.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.2-0.4.3.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.3-0.4.4.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.4-0.4.5.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.5-0.4.6.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.6-0.4.7.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.7-0.4.8.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.8-0.4.9.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.9-0.5.0.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.0-0.5.1.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.1-0.5.2.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.2-0.5.3.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.3-0.5.4.php +5 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.4-0.5.5.php +5 -0
- app/code/community/Conekta/Realtime/.DS_Store +0 -0
- app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Date.php.back +21 -0
- app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Days.php +37 -0
- app/code/community/Conekta/Realtime/Block/Form/Realtime.php +9 -0
- app/code/community/Conekta/Realtime/Block/Info/Realtime.php +27 -0
- app/code/community/Conekta/Realtime/Helper/Data.php +6 -0
- app/code/community/Conekta/Realtime/Model/Observer.php +143 -0
- app/code/community/Conekta/Realtime/Model/Realtime.php +23 -0
- app/code/community/Conekta/Realtime/etc/config.xml +134 -0
- app/code/community/Conekta/Realtime/etc/system.xml +73 -0
- app/code/community/Conekta/Realtime/sql/.DS_Store +0 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/.DS_Store +0 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-install-0.1.0.php +60 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.1.0-0.3.3.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.3-0.3.7.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.7-0.3.8.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.8-0.3.9.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.9-0.4.0.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.0-0.4.1.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.1-0.4.2.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.2-0.4.3.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.3-0.4.4.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.4-0.4.5.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.5-0.4.6.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.6-0.4.7.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.7-0.4.8.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.8-0.4.9.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.9-0.5.0.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.0-0.5.1.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.1-0.5.2.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.2-0.5.3.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.3-0.5.4.php +5 -0
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.4-0.5.5.php +5 -0
- app/code/community/Conekta/Spei/.DS_Store +0 -0
- app/code/community/Conekta/Spei/Block/Adminhtml/System/Config/Date.php.back +21 -0
- app/code/community/Conekta/Spei/Block/Adminhtml/System/Config/Days.php +37 -0
- app/code/community/Conekta/Spei/Block/Form/Spei.php +9 -0
- app/code/community/Conekta/Spei/Block/Info/Spei.php +27 -0
- app/code/community/Conekta/Spei/Helper/Data.php +6 -0
- app/code/community/Conekta/Spei/Model/Observer.php +137 -0
- app/code/community/Conekta/Spei/Model/Spei.php +21 -0
- app/code/community/Conekta/Spei/etc/config.xml +128 -0
- app/code/community/Conekta/Spei/etc/system.xml +73 -0
- app/code/community/Conekta/Spei/sql/.DS_Store +0 -0
- app/code/community/Conekta/Spei/sql/spei_setup/.DS_Store +0 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-install-0.1.0.php +39 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.2.5-0.2.6.php +18 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.2.6-0.3.0.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.0-0.3.1.php +19 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.1-0.3.2.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.2-0.3.3.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.3-0.3.7.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.7-0.3.8.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.8-0.3.9.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.9-0.4.0.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.0-0.4.1.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.1-0.4.2.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.2-0.4.3.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.3-0.4.4.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.4-0.4.5.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.5-0.4.6.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.6-0.4.7.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.7-0.4.8.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.8-0.4.9.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.9-0.5.0.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.0-0.5.1.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.1-0.5.2.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.2-0.5.3.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.3-0.5.4.php +5 -0
- app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.4-0.5.5.php +5 -0
- app/code/community/Conekta/Webhook/.DS_Store +0 -0
- app/code/community/Conekta/Webhook/Block/Adminhtml/Sales/Order/View/Tab/Info.php +18 -0
- app/code/community/Conekta/Webhook/Block/Adminhtml/System/Config/Url.php +76 -0
- app/code/community/Conekta/Webhook/Helper/Data.php +6 -0
- app/code/community/Conekta/Webhook/controllers/AjaxController.php +56 -0
- app/code/community/Conekta/Webhook/etc/.DS_Store +0 -0
- app/code/community/Conekta/Webhook/etc/config.xml +43 -0
- app/code/community/Conekta/Webhook/etc/system.xml +44 -0
- app/design/frontend/base/default/layout/card.xml +50 -0
- app/design/frontend/base/default/layout/oxxo.xml +10 -0
- app/design/frontend/base/default/layout/realtime.xml +10 -0
- app/design/frontend/base/default/layout/spei.xml +10 -0
- app/design/frontend/base/default/template/card/form/card.phtml +127 -0
- app/design/frontend/base/default/template/card/info/card.phtml +56 -0
- app/design/frontend/base/default/template/card/token.phtml +138 -0
- app/design/frontend/base/default/template/checkout/success.phtml +163 -0
- app/design/frontend/base/default/template/oxxo/form/oxxo.phtml +27 -0
- app/design/frontend/base/default/template/oxxo/info/oxxo.phtml +56 -0
- app/design/frontend/base/default/template/realtime/form/realtime.phtml +27 -0
- app/design/frontend/base/default/template/realtime/info/realtime.phtml +57 -0
- app/design/frontend/base/default/template/spei/form/spei.phtml +27 -0
- app/design/frontend/base/default/template/spei/info/spei.phtml +54 -0
- app/design/frontend/default/default/layout/card.xml +50 -0
- app/design/frontend/default/default/layout/oxxo.xml +10 -0
- app/design/frontend/default/default/layout/realtime.xml +10 -0
- app/design/frontend/default/default/layout/spei.xml +10 -0
- app/design/frontend/default/default/template/card/form/card.phtml +127 -0
- app/design/frontend/default/default/template/card/info/card.phtml +56 -0
- app/design/frontend/default/default/template/card/token.phtml +138 -0
- app/design/frontend/default/default/template/checkout/success.phtml +163 -0
- app/design/frontend/default/default/template/oxxo/form/oxxo.phtml +27 -0
- app/design/frontend/default/default/template/oxxo/info/oxxo.phtml +56 -0
- app/design/frontend/default/default/template/realtime/form/realtime.phtml +27 -0
- app/design/frontend/default/default/template/realtime/info/realtime.phtml +57 -0
- app/design/frontend/default/default/template/spei/form/spei.phtml +27 -0
- app/design/frontend/default/default/template/spei/info/spei.phtml +54 -0
- app/etc/modules/Conekta_Card.xml +9 -0
- app/etc/modules/Conekta_Oxxo.xml +9 -0
- app/etc/modules/Conekta_Spei.xml +9 -0
- app/etc/modules/Conekta_Webhook.xml +9 -0
- app/locale/en_US/Conekta_Bank.csv +10 -0
- app/locale/en_US/Conekta_Card.csv +33 -0
- app/locale/en_US/Conekta_Oxxo.csv +7 -0
- app/locale/en_US/Conekta_Realtime.csv +7 -0
- app/locale/en_US/Conekta_Spei.csv +7 -0
- app/locale/es_MX/Conekta_Bank.csv +10 -0
- app/locale/es_MX/Conekta_Card.csv +33 -0
- app/locale/es_MX/Conekta_Oxxo.csv +7 -0
- app/locale/es_MX/Conekta_Realtime.csv +7 -0
- app/locale/es_MX/Conekta_Spei.csv +7 -0
- lib/Conekta/.gitignore +12 -0
- lib/Conekta/CHANGELOG +57 -0
- lib/Conekta/LICENSE +21 -0
- lib/Conekta/README.md +86 -0
- lib/Conekta/composer.json +29 -0
- lib/Conekta/lib/Conekta.php +37 -0
- lib/Conekta/lib/Conekta/Address.php +5 -0
- lib/Conekta/lib/Conekta/Card.php +31 -0
- lib/Conekta/lib/Conekta/Charge.php +57 -0
- lib/Conekta/lib/Conekta/Conekta.php +25 -0
- lib/Conekta/lib/Conekta/Customer.php +79 -0
- lib/Conekta/lib/Conekta/Error.php +73 -0
- lib/Conekta/lib/Conekta/Event.php +21 -0
- lib/Conekta/lib/Conekta/Method.php +5 -0
- lib/Conekta/lib/Conekta/Object.php +70 -0
- lib/Conekta/lib/Conekta/Payee.php +57 -0
- lib/Conekta/lib/Conekta/PaymentMethod.php +5 -0
- lib/Conekta/lib/Conekta/Payout.php +25 -0
- lib/Conekta/lib/Conekta/PayoutMethod.php +31 -0
- lib/Conekta/lib/Conekta/Plan.php +52 -0
- lib/Conekta/lib/Conekta/Requestor.php +120 -0
- lib/Conekta/lib/Conekta/Resource.php +157 -0
- lib/Conekta/lib/Conekta/Subscription.php +40 -0
- lib/Conekta/lib/Conekta/Token.php +28 -0
- lib/Conekta/lib/Conekta/Util.php +68 -0
- lib/Conekta/lib/Conekta/Webhook.php +35 -0
- lib/Conekta/lib/Conekta/WebhookLog.php +5 -0
- lib/Conekta/lib/locales/Lang.php +49 -0
- lib/Conekta/lib/locales/messages/en.php +14 -0
- lib/Conekta/lib/locales/messages/es.php +14 -0
- lib/Conekta/lib/ssl_data/ca_bundle.crt +66 -0
- lib/Conekta/readme_files/cover.png +0 -0
- lib/Conekta/test/Conekta.php +52 -0
- lib/Conekta/test/Conekta/ChargeTest.php +179 -0
- lib/Conekta/test/Conekta/CustomerTest.php +157 -0
- lib/Conekta/test/Conekta/ErrorTest.php +85 -0
- lib/Conekta/test/Conekta/EventTest.php +12 -0
- lib/Conekta/test/Conekta/PayoutTest.php +59 -0
- lib/Conekta/test/Conekta/PlanTest.php +56 -0
- lib/Conekta/test/Conekta/TokenTest.php +11 -0
- lib/Conekta/test/Conekta/WebhookTest.php +31 -0
- package.xml +37 -0
app/code/community/Conekta/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/Block/Adminhtml/System/Config/Date.php.back
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Bank_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$date = new Varien_Data_Form_Element_Date;
|
7 |
+
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
8 |
+
|
9 |
+
$data = array(
|
10 |
+
'name' => $element->getName(),
|
11 |
+
'html_id' => $element->getId(),
|
12 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
13 |
+
);
|
14 |
+
$date->setData($data);
|
15 |
+
$date->setValue($element->getValue(), $format);
|
16 |
+
$date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
|
17 |
+
$date->setForm($element->getForm());
|
18 |
+
|
19 |
+
return $date->getElementHtml();
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Conekta/Bank/Block/Adminhtml/System/Config/Days.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Bank_Block_Adminhtml_System_Config_Days extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$days = new Varien_Data_Form_Element_Text;
|
7 |
+
$data = array(
|
8 |
+
'name' => $element->getName(),
|
9 |
+
'html_id' => $element->getId()
|
10 |
+
);
|
11 |
+
$days->setData($data);
|
12 |
+
if (is_numeric($element->getValue())) {
|
13 |
+
$days->setValue($element->getValue());
|
14 |
+
} else {
|
15 |
+
$days->setValue(30);
|
16 |
+
}
|
17 |
+
$days->setForm($element->getForm());
|
18 |
+
$html = $days->getElementHtml();
|
19 |
+
$javaScript = "
|
20 |
+
<script type=\"text/javascript\">
|
21 |
+
Event.observe(window, 'load', function() {
|
22 |
+
days=$('{$element->getHtmlId()}').value;
|
23 |
+
if (isNaN(days)) {
|
24 |
+
$('{$element->getHtmlId()}').value = '';
|
25 |
+
}
|
26 |
+
});
|
27 |
+
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
+
days=$('{$element->getHtmlId()}').value;
|
29 |
+
if (isNaN(days)) {
|
30 |
+
$('{$element->getHtmlId()}').value = '';
|
31 |
+
}
|
32 |
+
});
|
33 |
+
</script>";
|
34 |
+
$html .= $javaScript;
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Conekta/Bank/Block/Form/Bank.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Bank_Block_Form_Bank extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('bank/form/bank.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Conekta/Bank/Block/Info/Bank.php
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Bank_Block_Info_Bank extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('bank/info/bank.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareSpecificInformation($transport = null)
|
12 |
+
{
|
13 |
+
if (null !== $this->_paymentSpecificInformation) {
|
14 |
+
return $this->_paymentSpecificInformation;
|
15 |
+
}
|
16 |
+
$info = $this->getInfo();
|
17 |
+
$transport = new Varien_Object();
|
18 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
19 |
+
$transport->addData(array(
|
20 |
+
Mage::helper('payment')->__('Service Name') => $info->getBankServiceName(),
|
21 |
+
Mage::helper('payment')->__('Service Number') => $info->getBankServiceNumber(),
|
22 |
+
Mage::helper('payment')->__('Bank Name') => $info->getBankName(),
|
23 |
+
Mage::helper('payment')->__('Bank Name') => $info->getBankReference()
|
24 |
+
));
|
25 |
+
return $transport;
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Conekta/Bank/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Bank_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Bank/Model/Bank.php
ADDED
@@ -0,0 +1,24 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Bank_Model_Bank extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'bank';
|
5 |
+
protected $_formBlockType = 'bank/form_bank';
|
6 |
+
protected $_infoBlockType = 'bank/info_bank';
|
7 |
+
|
8 |
+
public function assignData($data)
|
9 |
+
{
|
10 |
+
if (!($data instanceof Varien_Object)) {
|
11 |
+
$data = new Varien_Object($data);
|
12 |
+
}
|
13 |
+
$info = $this->getInfoInstance();
|
14 |
+
$info->setBankExpiryDate($data->getBankExpiryDate())
|
15 |
+
->setBankServiceName($data->getBankServiceName())
|
16 |
+
->setBankServiceNumber($data->getBankServiceNumber())
|
17 |
+
->setBankName($data->getBankName())
|
18 |
+
->setBankReference($data->getBankReference())
|
19 |
+
;
|
20 |
+
return $this;
|
21 |
+
}
|
22 |
+
|
23 |
+
}
|
24 |
+
?>
|
app/code/community/Conekta/Bank/Model/Observer.php
ADDED
@@ -0,0 +1,145 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Bank_Model_Observer{
|
4 |
+
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta')) {
|
6 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
+
}
|
9 |
+
if($event->payment->getMethod() == Mage::getModel('Conekta_Bank_Model_Bank')->getCode()){
|
10 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
12 |
+
|
13 |
+
$order = $event->payment->getOrder();
|
14 |
+
$customer = $order->getCustomer();
|
15 |
+
$shipping_address = $order->getShippingAddress();
|
16 |
+
|
17 |
+
$billing = $order->getBillingAddress()->getData();
|
18 |
+
$email = $order->getCustomerEmail();
|
19 |
+
if ($shipping_address) {
|
20 |
+
$shipping_data = $shipping_address->getData();
|
21 |
+
}
|
22 |
+
$items = $order->getAllVisibleItems();
|
23 |
+
$line_items = array();
|
24 |
+
$i = 0;
|
25 |
+
foreach ($items as $itemId => $item){
|
26 |
+
$name = $item->getName();
|
27 |
+
$sku = $item->getSku();
|
28 |
+
$price = $item->getPrice();
|
29 |
+
$description = $item->getDescription();
|
30 |
+
$product_type = $item->getProductType();
|
31 |
+
$line_items = array_merge($line_items, array(array(
|
32 |
+
'name' => $name,
|
33 |
+
'sku' => $sku,
|
34 |
+
'unit_price' => $price,
|
35 |
+
'description' =>$description,
|
36 |
+
'quantity' => 1,
|
37 |
+
'type' => $product_type
|
38 |
+
))
|
39 |
+
);
|
40 |
+
$i = $i + 1;
|
41 |
+
}
|
42 |
+
$shipp = array();
|
43 |
+
if (empty($shipping_data) != true) {
|
44 |
+
$shipp = array(
|
45 |
+
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
46 |
+
'service' => $order->getShippingMethod(),
|
47 |
+
'carrier' => $order->getShippingDescription(),
|
48 |
+
'address' => array(
|
49 |
+
'street1' => $shipping_data['street'],
|
50 |
+
'city' => $shipping_data['city'],
|
51 |
+
'state' => $shipping_data['region'],
|
52 |
+
'country' => $shipping_data['country_id'],
|
53 |
+
'zip' => $shipping_data['postcode'],
|
54 |
+
'phone' =>$shipping_data['telephone'],
|
55 |
+
'email' =>$email
|
56 |
+
)
|
57 |
+
);
|
58 |
+
}
|
59 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
60 |
+
$expiry_date=Date('Y-m-d', strtotime("+".$days." days"));
|
61 |
+
try {
|
62 |
+
$charge = Conekta_Charge::create(array(
|
63 |
+
'bank'=>array(
|
64 |
+
'type'=>'banorte',
|
65 |
+
'expires_at'=>$expiry_date
|
66 |
+
),
|
67 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
68 |
+
'amount' => intval(((float) $event->payment->getOrder()->grandTotal) * 100),
|
69 |
+
'description' => 'Compra en Magento',
|
70 |
+
'reference_id' => $event->payment->getOrder()->getIncrementId(),
|
71 |
+
'details' => array(
|
72 |
+
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['firstname']),
|
73 |
+
'email' => $email,
|
74 |
+
'phone' => $billing['telephone'],
|
75 |
+
'billing_address' => array(
|
76 |
+
'company_name' => $billing['company'],
|
77 |
+
'street1' => $billing['street'],
|
78 |
+
'city' =>$billing['city'],
|
79 |
+
'state' =>$billing['region'],
|
80 |
+
'country' =>$billing['country_id'],
|
81 |
+
'zip' =>$billing['postcode'],
|
82 |
+
'phone' =>$billing['telephone'],
|
83 |
+
'email' =>$email
|
84 |
+
),
|
85 |
+
'line_items' => $line_items,
|
86 |
+
'shipment' => $shipp
|
87 |
+
),
|
88 |
+
'coupon_code' => $order->getCouponCode(),
|
89 |
+
'custom_fields' => array(
|
90 |
+
'customer' => array(
|
91 |
+
'website_id' => $customer->getWebsiteId(),
|
92 |
+
'entity_id' => $customer->getEntityId(),
|
93 |
+
'entity_type_id' => $customer->getEntityTypeId(),
|
94 |
+
'attribute_set_id' => $customer->getAttributeSetId(),
|
95 |
+
'email' => $customer->getEmail(),
|
96 |
+
'group_id' => $customer->getGroupId(),
|
97 |
+
'store_id' => $customer->getStoreId(),
|
98 |
+
'created_at' => $customer->getCreatedAt(),
|
99 |
+
'updated_at' => $customer->getUpdatedAt(),
|
100 |
+
'is_active' => $customer->getIsActive(),
|
101 |
+
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
102 |
+
'get_tax_vat' => $customer->getTaxvat(),
|
103 |
+
'created_in' => $customer->getCreatedIn(),
|
104 |
+
'gender' => $customer->getGender(),
|
105 |
+
'default_billing' => $customer->getDefaultBilling(),
|
106 |
+
'default_shipping' => $customer->getDefaultShipping(),
|
107 |
+
'dob' => $customer->getDob(),
|
108 |
+
'tax_class_id' => $customer->getTaxClassId()
|
109 |
+
),
|
110 |
+
'discount_description' => $order->getDiscountDescription(),
|
111 |
+
'discount_amount' => $order->getDiscountAmount(),
|
112 |
+
'shipping_amount' => $shipping_address->getShippingAmount(),
|
113 |
+
'shipping_description' => $shipping_address->getShippingDescription(),
|
114 |
+
'shipping_method' => $shipping_address->getShippingMethod()
|
115 |
+
)
|
116 |
+
)
|
117 |
+
);
|
118 |
+
} catch (Conekta_Error $e){
|
119 |
+
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
120 |
+
}
|
121 |
+
$event->payment->setBankExpiryDate($expiry_date);
|
122 |
+
$event->payment->setBankServiceName($charge->payment_method->service_name);
|
123 |
+
$event->payment->setBankServiceNumber($charge->payment_method->service_number);
|
124 |
+
$event->payment->setBankName($charge->payment_method->type);
|
125 |
+
$event->payment->setBankReference($charge->payment_method->reference);
|
126 |
+
$event->payment->setChargeId($charge->id);
|
127 |
+
|
128 |
+
//Update Quote
|
129 |
+
$order = $event->payment->getOrder();
|
130 |
+
$quote = $order->getQuote();
|
131 |
+
$payment = $quote->getPayment();
|
132 |
+
$payment->setBankExpiryDate($expiry_date);
|
133 |
+
$payment->setBankServiceName($charge->payment_method->service_name);
|
134 |
+
$payment->setBankServiceNumber($charge->payment_method->service_number);
|
135 |
+
$payment->setBankName($charge->payment_method->type);
|
136 |
+
$payment->setBankReference($charge->payment_method->reference);
|
137 |
+
$payment->setChargeId($charge->id);
|
138 |
+
$quote->collectTotals();
|
139 |
+
$quote->save();
|
140 |
+
$order->setQuote($quote);
|
141 |
+
$order->save();
|
142 |
+
}
|
143 |
+
return $event;
|
144 |
+
}
|
145 |
+
}
|
app/code/community/Conekta/Bank/etc/config.xml
ADDED
@@ -0,0 +1,136 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Bank>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Bank>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Conekta_Card>
|
12 |
+
<files>
|
13 |
+
<default>Conekta_Card.csv</default>
|
14 |
+
</files>
|
15 |
+
</Conekta_Card>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</adminhtml>
|
19 |
+
<frontend>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Conekta_Card>
|
23 |
+
<files>
|
24 |
+
<default>Conekta_Bank.csv</default>
|
25 |
+
</files>
|
26 |
+
</Conekta_Card>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
<routers>
|
30 |
+
<bank>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Conekta_Bank</module>
|
34 |
+
<frontName>bank</frontName>
|
35 |
+
</args>
|
36 |
+
</bank>
|
37 |
+
</routers>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<bank>
|
41 |
+
<file>bank.xml</file>
|
42 |
+
</bank>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<sales_order_payment_place_start>
|
49 |
+
<observers>
|
50 |
+
<bank>
|
51 |
+
<class>bank/observer</class>
|
52 |
+
<method>processPayment</method>
|
53 |
+
</bank>
|
54 |
+
</observers>
|
55 |
+
</sales_order_payment_place_start>
|
56 |
+
</events>
|
57 |
+
<fieldsets>
|
58 |
+
<sales_convert_quote_payment>
|
59 |
+
<bank_service_name>
|
60 |
+
<to_order_payment>*</to_order_payment>
|
61 |
+
</bank_service_name>
|
62 |
+
<bank_service_number>
|
63 |
+
<to_order_payment>*</to_order_payment>
|
64 |
+
</bank_service_number>
|
65 |
+
<bank_expiry_date>
|
66 |
+
<to_order_payment>*</to_order_payment>
|
67 |
+
</bank_expiry_date>
|
68 |
+
<bank_name>
|
69 |
+
<to_order_payment>*</to_order_payment>
|
70 |
+
</bank_name>
|
71 |
+
<bank_reference>
|
72 |
+
<to_order_payment>*</to_order_payment>
|
73 |
+
</bank_reference>
|
74 |
+
<charge_id>
|
75 |
+
<to_order_payment>*</to_order_payment>
|
76 |
+
</charge_id>
|
77 |
+
</sales_convert_quote_payment>
|
78 |
+
</fieldsets>
|
79 |
+
<models>
|
80 |
+
<bank>
|
81 |
+
<class>Conekta_Bank_Model</class>
|
82 |
+
<resourceModel>bank_mysql4</resourceModel>
|
83 |
+
</bank>
|
84 |
+
<bank_mysql4>
|
85 |
+
<class>Conekta_Bank_Model_Mysql4</class>
|
86 |
+
<entities>
|
87 |
+
<bank>
|
88 |
+
<table>bank</table>
|
89 |
+
</bank>
|
90 |
+
</entities>
|
91 |
+
</bank_mysql4>
|
92 |
+
</models>
|
93 |
+
<resources>
|
94 |
+
<bank_setup>
|
95 |
+
<setup>
|
96 |
+
<module>Conekta_Bank</module>
|
97 |
+
</setup>
|
98 |
+
<connection>
|
99 |
+
<use>core_setup</use>
|
100 |
+
</connection>
|
101 |
+
</bank_setup>
|
102 |
+
<bank_write>
|
103 |
+
<connection>
|
104 |
+
<use>core_write</use>
|
105 |
+
</connection>
|
106 |
+
</bank_write>
|
107 |
+
<bank_read>
|
108 |
+
<connection>
|
109 |
+
<use>core_read</use>
|
110 |
+
</connection>
|
111 |
+
</bank_read>
|
112 |
+
</resources>
|
113 |
+
<blocks>
|
114 |
+
<bank>
|
115 |
+
<class>Conekta_Bank_Block</class>
|
116 |
+
</bank>
|
117 |
+
</blocks>
|
118 |
+
<helpers>
|
119 |
+
<bank>
|
120 |
+
<class>Conekta_Bank_Helper</class>
|
121 |
+
</bank>
|
122 |
+
</helpers>
|
123 |
+
</global>
|
124 |
+
<default>
|
125 |
+
<payment>
|
126 |
+
<bank>
|
127 |
+
<active>1</active>
|
128 |
+
<model>bank/bank</model>
|
129 |
+
<order_status>pending</order_status>
|
130 |
+
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
131 |
+
<title>Bank Payment Method</title>
|
132 |
+
<sort_order>0</sort_order>
|
133 |
+
</bank>
|
134 |
+
</payment>
|
135 |
+
</default>
|
136 |
+
</config>
|
app/code/community/Conekta/Bank/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<bank translate="label" module="bank">
|
7 |
+
<label>Conekta Bank Payment Module</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>2</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<sort_order translate="label">
|
15 |
+
<label>Sort Order</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<frontend_class>validate-number</frontend_class>
|
22 |
+
</sort_order>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<order_status translate="label">
|
33 |
+
<label>New order status</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
+
<sort_order>2</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</order_status>
|
41 |
+
<webhook_notification_order_status translate="label">
|
42 |
+
<label>Order status when Conekta sends payment notification</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</webhook_notification_order_status>
|
50 |
+
<my_date translate="label comment">
|
51 |
+
<label>Expiry (# days)</label>
|
52 |
+
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
53 |
+
<frontend_model>bank/adminhtml_system_config_days</frontend_model> <!-- Specify our custom model -->
|
54 |
+
<sort_order>4</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<comment>Set the expiry of this offline payment</comment>
|
59 |
+
</my_date>
|
60 |
+
<title translate="label">
|
61 |
+
<label>Title</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>5</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>0</show_in_store>
|
67 |
+
</title>
|
68 |
+
</fields>
|
69 |
+
</bank>
|
70 |
+
</groups>
|
71 |
+
</payment>
|
72 |
+
</sections>
|
73 |
+
</config>
|
app/code/community/Conekta/Bank/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/sql/bank_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,61 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
|
9 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
+
'length' => '255',
|
12 |
+
'comment' => 'Charge Id'
|
13 |
+
));
|
14 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
+
'length' => '255',
|
17 |
+
'comment' => 'Card Id'
|
18 |
+
));
|
19 |
+
|
20 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'service_name', array(
|
21 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
22 |
+
'comment' => 'Bank Service Name'
|
23 |
+
));
|
24 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'service_name', array(
|
25 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
26 |
+
'comment' => 'Bank Service Name'
|
27 |
+
));
|
28 |
+
|
29 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'service_number', array(
|
30 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
31 |
+
'length' => '255',
|
32 |
+
'comment' => 'Bank Service Number'
|
33 |
+
));
|
34 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'service_number', array(
|
35 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
36 |
+
'length' => '255',
|
37 |
+
'comment' => 'Bank Service Number'
|
38 |
+
));
|
39 |
+
|
40 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'bank_name', array(
|
41 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
42 |
+
'length' => '255',
|
43 |
+
'comment' => 'Bank Name'
|
44 |
+
));
|
45 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'bank_name', array(
|
46 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
47 |
+
'length' => '255',
|
48 |
+
'comment' => 'Bank Name'
|
49 |
+
));
|
50 |
+
|
51 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'bank_reference', array(
|
52 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
53 |
+
'length' => '255',
|
54 |
+
'comment' => 'Bank Reference'
|
55 |
+
));
|
56 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'bank_reference', array(
|
57 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
58 |
+
'length' => '255',
|
59 |
+
'comment' => 'Bank Reference'
|
60 |
+
));
|
61 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.2.0-0.2.1.php
ADDED
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'bank_expiry_date', array(
|
9 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
10 |
+
'comment' => 'Bank Expiry Date'
|
11 |
+
));
|
12 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'bank_expiry_date', array(
|
13 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
14 |
+
'comment' => 'Bank Expiry Date'
|
15 |
+
));
|
16 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.2.1-0.3.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.3-0.3.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.7-0.3.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.8-0.3.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.3.9-0.4.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.0-0.4.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.1-0.4.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.2-0.4.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.3-0.4.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.4-0.4.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.5-0.4.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.6-0.4.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.7-0.4.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.8-0.4.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.4.9-0.5.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.0-0.5.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.1-0.5.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.2-0.5.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.3-0.5.4.php
ADDED
@@ -0,0 +1,26 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'bank_service_name', array(
|
9 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
10 |
+
'comment' => 'Bank Service Name'
|
11 |
+
));
|
12 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'bank_service_name', array(
|
13 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
14 |
+
'comment' => 'Bank Service Name'
|
15 |
+
));
|
16 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'bank_service_number', array(
|
17 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
18 |
+
'length' => '255',
|
19 |
+
'comment' => 'Bank Service Number'
|
20 |
+
));
|
21 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'bank_service_number', array(
|
22 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
23 |
+
'length' => '255',
|
24 |
+
'comment' => 'Bank Service Number'
|
25 |
+
));
|
26 |
+
$installer->endSetup();
|
app/code/community/Conekta/Bank/sql/bank_setup/mysql4-upgrade-0.5.4-0.5.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Card/Block/Adminhtml/System/Config/Installments.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Card_Block_Adminhtml_System_Config_Installments extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$installments = new Varien_Data_Form_Element_Text;
|
7 |
+
$data = array(
|
8 |
+
'name' => $element->getName(),
|
9 |
+
'html_id' => $element->getId()
|
10 |
+
);
|
11 |
+
$installments->setData($data);
|
12 |
+
if (is_numeric($element->getValue())) {
|
13 |
+
$installments->setValue($element->getValue());
|
14 |
+
} else {
|
15 |
+
$installments->setValue(300.0);
|
16 |
+
}
|
17 |
+
$installments->setForm($element->getForm());
|
18 |
+
$html = $installments->getElementHtml();
|
19 |
+
$javaScript = "
|
20 |
+
<script type=\"text/javascript\">
|
21 |
+
Event.observe(window, 'load', function() {
|
22 |
+
installments=$('{$element->getHtmlId()}').value;
|
23 |
+
if (isNaN(installments)) {
|
24 |
+
$('{$element->getHtmlId()}').value = '';
|
25 |
+
}
|
26 |
+
});
|
27 |
+
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
+
installments=$('{$element->getHtmlId()}').value;
|
29 |
+
if (isNaN(installments)) {
|
30 |
+
$('{$element->getHtmlId()}').value = '';
|
31 |
+
}
|
32 |
+
});
|
33 |
+
</script>";
|
34 |
+
$html .= $javaScript;
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Conekta/Card/Block/Form/Card.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Card_Block_Form_Card extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('card/form/card.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Conekta/Card/Block/Info/Card.php
ADDED
@@ -0,0 +1,24 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Card_Block_Info_Card extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('card/info/card.phtml');
|
8 |
+
}
|
9 |
+
|
10 |
+
protected function _prepareSpecificInformation($transport = null)
|
11 |
+
{
|
12 |
+
if (null !== $this->_paymentSpecificInformation) {
|
13 |
+
return $this->_paymentSpecificInformation;
|
14 |
+
}
|
15 |
+
$info = $this->getInfo();
|
16 |
+
$transport = new Varien_Object();
|
17 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
18 |
+
$transport->addData(array(
|
19 |
+
Mage::helper('payment')->__('Card Token') => $info->getCardToken(),
|
20 |
+
Mage::helper('payment')->__('Charge Authorization No#') => $info->getChargeAuthorization()
|
21 |
+
));
|
22 |
+
return $transport;
|
23 |
+
}
|
24 |
+
}
|
app/code/community/Conekta/Card/Block/Page/Html/Head.php
ADDED
@@ -0,0 +1,116 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/osl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category Mage
|
22 |
+
* @package Mage_Page
|
23 |
+
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Inchoo Xternal Html page block
|
30 |
+
*
|
31 |
+
* @category Inchoo
|
32 |
+
* @package Inchoo_Xternal
|
33 |
+
* @author Vedran Subotic, Inchoo <web@inchoo.net>
|
34 |
+
*/
|
35 |
+
class Conekta_Card_Block_Page_Html_Head extends Mage_Page_Block_Html_Head
|
36 |
+
{
|
37 |
+
/**
|
38 |
+
* Initialize template
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
protected function _construct()
|
42 |
+
{
|
43 |
+
$this->setTemplate('page/html/head.phtml');
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Add HEAD External Item
|
49 |
+
*
|
50 |
+
* Allowed types:
|
51 |
+
* - js
|
52 |
+
* - js_css
|
53 |
+
* - skin_js
|
54 |
+
* - skin_css
|
55 |
+
* - rss
|
56 |
+
*
|
57 |
+
* @param string $type
|
58 |
+
* @param string $name
|
59 |
+
* @param string $params
|
60 |
+
* @param string $if
|
61 |
+
* @param string $cond
|
62 |
+
* @return Mage_Page_Block_Html_Head
|
63 |
+
*/
|
64 |
+
public function addExternalItem($type, $name, $params=null, $if=null, $cond=null)
|
65 |
+
{
|
66 |
+
parent::addItem($type, $name, $params=null, $if=null, $cond=null);
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Remove External Item from HEAD entity
|
71 |
+
*
|
72 |
+
* @param string $type
|
73 |
+
* @param string $name
|
74 |
+
* @return Mage_Page_Block_Html_Head
|
75 |
+
*/
|
76 |
+
public function removeExternalItem($type, $name)
|
77 |
+
{
|
78 |
+
parent::removeItem($type, $name);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Classify HTML head item and queue it into "lines" array
|
83 |
+
*
|
84 |
+
* @see self::getCssJsHtml()
|
85 |
+
* @param array &$lines
|
86 |
+
* @param string $itemIf
|
87 |
+
* @param string $itemType
|
88 |
+
* @param string $itemParams
|
89 |
+
* @param string $itemName
|
90 |
+
* @param array $itemThe
|
91 |
+
*/
|
92 |
+
protected function _separateOtherHtmlHeadElements(&$lines, $itemIf, $itemType, $itemParams, $itemName, $itemThe)
|
93 |
+
{
|
94 |
+
$params = $itemParams ? ' ' . $itemParams : '';
|
95 |
+
$href = $itemName;
|
96 |
+
switch ($itemType) {
|
97 |
+
case 'rss':
|
98 |
+
$lines[$itemIf]['other'][] = sprintf('<link href="%s"%s rel="alternate" type="application/rss+xml" />',
|
99 |
+
$href, $params
|
100 |
+
);
|
101 |
+
break;
|
102 |
+
case 'link_rel':
|
103 |
+
$lines[$itemIf]['other'][] = sprintf('<link%s href="%s" />', $params, $href);
|
104 |
+
break;
|
105 |
+
|
106 |
+
case 'external_js':
|
107 |
+
$lines[$itemIf]['other'][] = sprintf('<script type="text/javascript" src="%s" %s></script>', $href, $params);
|
108 |
+
break;
|
109 |
+
|
110 |
+
case 'external_css':
|
111 |
+
$lines[$itemIf]['other'][] = sprintf('<link rel="stylesheet" type="text/css" href="%s" %s/>', $href, $params);
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
app/code/community/Conekta/Card/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Card_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Card/Model/Card.php
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Card_Model_Card extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'card';
|
5 |
+
protected $_formBlockType = 'card/form_card';
|
6 |
+
protected $_infoBlockType = 'card/info_card';
|
7 |
+
|
8 |
+
public function assignData($data)
|
9 |
+
{
|
10 |
+
if (!($data instanceof Varien_Object)) {
|
11 |
+
$data = new Varien_Object($data);
|
12 |
+
}
|
13 |
+
$info = $this->getInfoInstance();
|
14 |
+
$info->setCardToken($data->getCardToken())
|
15 |
+
->setChargeAuthorization($data->getChargeAuthorization())
|
16 |
+
->setCardMonthlyInstallments($data->getCardMonthlyInstallments())
|
17 |
+
->setCcOwner($data->getCcOwner())
|
18 |
+
->setCcLast4($data->getCcLast4())
|
19 |
+
->setCcType($data->getCcType())
|
20 |
+
->setCardBin($data->getCardBin())
|
21 |
+
;
|
22 |
+
|
23 |
+
return $this;
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
?>
|
app/code/community/Conekta/Card/Model/Observer.php
ADDED
@@ -0,0 +1,150 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Card_Model_Observer{
|
4 |
+
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta')) {
|
6 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
+
}
|
9 |
+
if($event->payment->getMethod() == Mage::getModel('Conekta_Card_Model_Card')->getCode()){
|
10 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
Conekta::setApiVersion("1.0.0");
|
12 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
13 |
+
|
14 |
+
$order = $event->payment->getOrder();
|
15 |
+
$customer = $order->getCustomer();
|
16 |
+
$shipping_address = $order->getShippingAddress();
|
17 |
+
|
18 |
+
$billing = $order->getBillingAddress()->getData();
|
19 |
+
$email = $order->getCustomerEmail();
|
20 |
+
if ($shipping_address) {
|
21 |
+
$shipping_data = $shipping_address->getData();
|
22 |
+
}
|
23 |
+
$items = $order->getAllVisibleItems();
|
24 |
+
$line_items = array();
|
25 |
+
$i = 0;
|
26 |
+
foreach ($items as $itemId => $item){
|
27 |
+
$name = $item->getName();
|
28 |
+
$sku = $item->getSku();
|
29 |
+
$price = $item->getPrice();
|
30 |
+
$description = Mage::getModel('catalog/product')->load($item->getProductId())->getDescription();
|
31 |
+
$product_type = $item->getProductType();
|
32 |
+
$line_items = array_merge($line_items, array(array(
|
33 |
+
'name' => $name,
|
34 |
+
'sku' => $sku,
|
35 |
+
'unit_price' => $price,
|
36 |
+
'description' =>$description,
|
37 |
+
'quantity' => 1,
|
38 |
+
'type' => $product_type
|
39 |
+
))
|
40 |
+
);
|
41 |
+
$i = $i + 1;
|
42 |
+
}
|
43 |
+
$shipp = array();
|
44 |
+
if (empty($shipping_data) != true) {
|
45 |
+
$shipp = array(
|
46 |
+
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
47 |
+
'service' => $order->getShippingMethod(),
|
48 |
+
'carrier' => $order->getShippingDescription(),
|
49 |
+
'address' => array(
|
50 |
+
'street1' => $shipping_data['street'],
|
51 |
+
'city' => $shipping_data['city'],
|
52 |
+
'state' => $shipping_data['region'],
|
53 |
+
'country' => $shipping_data['country_id'],
|
54 |
+
'zip' => $shipping_data['postcode'],
|
55 |
+
'phone' =>$shipping_data['telephone'],
|
56 |
+
'email' =>$email
|
57 |
+
)
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
try {
|
62 |
+
$params = array(
|
63 |
+
'card' => $_POST['payment']['conekta_token'],
|
64 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
65 |
+
'amount' => intval(((float) $order->grandTotal) * 100),
|
66 |
+
'description' => 'Compra en Magento',
|
67 |
+
'reference_id' => $order->getIncrementId(),
|
68 |
+
'details' => array(
|
69 |
+
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']),
|
70 |
+
'email' => $email,
|
71 |
+
'phone' => $billing['telephone'],
|
72 |
+
'billing_address' => array(
|
73 |
+
'company_name' => $billing['company'],
|
74 |
+
'street1' => $billing['street'],
|
75 |
+
'city' =>$billing['city'],
|
76 |
+
'state' =>$billing['region'],
|
77 |
+
'country' =>$billing['country_id'],
|
78 |
+
'zip' =>$billing['postcode'],
|
79 |
+
'phone' =>$billing['telephone'],
|
80 |
+
'email' =>$email
|
81 |
+
),
|
82 |
+
'line_items' => $line_items,
|
83 |
+
'shipment' => $shipp
|
84 |
+
),
|
85 |
+
'coupon_code' => $order->getCouponCode(),
|
86 |
+
'custom_fields' => array(
|
87 |
+
'customer' => array(
|
88 |
+
'website_id' => $customer->getWebsiteId(),
|
89 |
+
'entity_id' => $customer->getEntityId(),
|
90 |
+
'entity_type_id' => $customer->getEntityTypeId(),
|
91 |
+
'attribute_set_id' => $customer->getAttributeSetId(),
|
92 |
+
'email' => $customer->getEmail(),
|
93 |
+
'group_id' => $customer->getGroupId(),
|
94 |
+
'store_id' => $customer->getStoreId(),
|
95 |
+
'created_at' => $customer->getCreatedAt(),
|
96 |
+
'updated_at' => $customer->getUpdatedAt(),
|
97 |
+
'is_active' => $customer->getIsActive(),
|
98 |
+
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
99 |
+
'get_tax_vat' => $customer->getTaxvat(),
|
100 |
+
'created_in' => $customer->getCreatedIn(),
|
101 |
+
'gender' => $customer->getGender(),
|
102 |
+
'default_billing' => $customer->getDefaultBilling(),
|
103 |
+
'default_shipping' => $customer->getDefaultShipping(),
|
104 |
+
'dob' => $customer->getDob(),
|
105 |
+
'tax_class_id' => $customer->getTaxClassId()
|
106 |
+
),
|
107 |
+
'discount_description' => $order->getDiscountDescription(),
|
108 |
+
'discount_amount' => $order->getDiscountAmount(),
|
109 |
+
'shipping_amount' => $shipping_address->getShippingAmount(),
|
110 |
+
'shipping_description' => $shipping_address->getShippingDescription(),
|
111 |
+
'shipping_method' => $shipping_address->getShippingMethod()
|
112 |
+
)
|
113 |
+
);
|
114 |
+
if ($_POST['payment']['monthly_installments'] != 0) {
|
115 |
+
$params['monthly_installments'] = $_POST['payment']['monthly_installments'];
|
116 |
+
}
|
117 |
+
$charge = Conekta_Charge::create($params);
|
118 |
+
} catch (Conekta_Error $e) {
|
119 |
+
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
120 |
+
}
|
121 |
+
$event->payment->setCardToken($_POST['payment']['conekta_token']);
|
122 |
+
$event->payment->setCardMonthlyInstallments($charge->monthly_installments);
|
123 |
+
$event->payment->setChargeAuthorization($charge->payment_method->auth_code);
|
124 |
+
$event->payment->setChargeId($charge->id);
|
125 |
+
$event->payment->setCcOwner($charge->payment_method->name);
|
126 |
+
$event->payment->setCcLast4($charge->payment_method->last4);
|
127 |
+
$event->payment->setCcType($charge->payment_method->brand);
|
128 |
+
$event->payment->setCardBin($_POST['card']['bin']);
|
129 |
+
|
130 |
+
//Update Quote
|
131 |
+
$quote = $order->getQuote();
|
132 |
+
$payment = $quote->getPayment();
|
133 |
+
$payment->setCardToken($_POST['payment']['conekta_token']);
|
134 |
+
$payment->setCardMonthlyInstallments($charge->monthly_installments);
|
135 |
+
$payment->setChargeAuthorization($charge->payment_method->auth_code);
|
136 |
+
|
137 |
+
$payment->setCcOwner($charge->payment_method->name);
|
138 |
+
$payment->setCcLast4($charge->payment_method->last4);
|
139 |
+
$payment->setCcType($charge->payment_method->brand);
|
140 |
+
$payment->setCardBin($_POST['card']['bin']);
|
141 |
+
|
142 |
+
$payment->setChargeId($charge->id);
|
143 |
+
$quote->collectTotals();
|
144 |
+
$quote->save();
|
145 |
+
$order->setQuote($quote);
|
146 |
+
$order->save();
|
147 |
+
}
|
148 |
+
return $event;
|
149 |
+
}
|
150 |
+
}
|
app/code/community/Conekta/Card/etc/config.xml
ADDED
@@ -0,0 +1,147 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Card>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Card>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Conekta_Card>
|
12 |
+
<files>
|
13 |
+
<default>Conekta_Card.csv</default>
|
14 |
+
</files>
|
15 |
+
</Conekta_Card>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</adminhtml>
|
19 |
+
<frontend>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Conekta_Card>
|
23 |
+
<files>
|
24 |
+
<default>Conekta_Card.csv</default>
|
25 |
+
</files>
|
26 |
+
</Conekta_Card>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
<routers>
|
30 |
+
<card>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Conekta_Card</module>
|
34 |
+
<frontName>card</frontName>
|
35 |
+
</args>
|
36 |
+
</card>
|
37 |
+
</routers>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<card>
|
41 |
+
<file>card.xml</file>
|
42 |
+
</card>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<sales_order_payment_place_start>
|
49 |
+
<observers>
|
50 |
+
<card>
|
51 |
+
<class>card/observer</class>
|
52 |
+
<method>processPayment</method>
|
53 |
+
</card>
|
54 |
+
</observers>
|
55 |
+
</sales_order_payment_place_start>
|
56 |
+
</events>
|
57 |
+
<fieldsets>
|
58 |
+
<sales_convert_quote_payment>
|
59 |
+
<cc_owner>
|
60 |
+
<to_order_payment>*</to_order_payment>
|
61 |
+
</cc_owner>
|
62 |
+
<cc_last4>
|
63 |
+
<to_order_payment>*</to_order_payment>
|
64 |
+
</cc_last4>
|
65 |
+
<cc_type>
|
66 |
+
<to_order_payment>*</to_order_payment>
|
67 |
+
</cc_type>
|
68 |
+
<card_token>
|
69 |
+
<to_order_payment>*</to_order_payment>
|
70 |
+
</card_token>
|
71 |
+
<card_bin>
|
72 |
+
<to_order_payment>*</to_order_payment>
|
73 |
+
</card_bin>
|
74 |
+
<charge_authorization>
|
75 |
+
<to_order_payment>*</to_order_payment>
|
76 |
+
</charge_authorization>
|
77 |
+
<charge_id>
|
78 |
+
<to_order_payment>*</to_order_payment>
|
79 |
+
</charge_id>
|
80 |
+
<card_monthly_installments>
|
81 |
+
<to_order_payment>*</to_order_payment>
|
82 |
+
</card_monthly_installments>
|
83 |
+
</sales_convert_quote_payment>
|
84 |
+
</fieldsets>
|
85 |
+
<models>
|
86 |
+
<card>
|
87 |
+
<class>Conekta_Card_Model</class>
|
88 |
+
<resourceModel>card_mysql4</resourceModel>
|
89 |
+
</card>
|
90 |
+
<card_mysql4>
|
91 |
+
<class>Conekta_Card_Model_Mysql4</class>
|
92 |
+
<entities>
|
93 |
+
<card>
|
94 |
+
<table>card</table>
|
95 |
+
</card>
|
96 |
+
</entities>
|
97 |
+
</card_mysql4>
|
98 |
+
</models>
|
99 |
+
<resources>
|
100 |
+
<card_setup>
|
101 |
+
<setup>
|
102 |
+
<module>Conekta_Card</module>
|
103 |
+
</setup>
|
104 |
+
<connection>
|
105 |
+
<use>core_setup</use>
|
106 |
+
</connection>
|
107 |
+
</card_setup>
|
108 |
+
<card_write>
|
109 |
+
<connection>
|
110 |
+
<use>core_write</use>
|
111 |
+
</connection>
|
112 |
+
</card_write>
|
113 |
+
<card_read>
|
114 |
+
<connection>
|
115 |
+
<use>core_read</use>
|
116 |
+
</connection>
|
117 |
+
</card_read>
|
118 |
+
</resources>
|
119 |
+
<blocks>
|
120 |
+
<card>
|
121 |
+
<class>Conekta_Card_Block</class>
|
122 |
+
</card>
|
123 |
+
<page>
|
124 |
+
<rewrite>
|
125 |
+
<html_head>Conekta_Card_Block_Page_Html_Head</html_head>
|
126 |
+
</rewrite>
|
127 |
+
</page>
|
128 |
+
</blocks>
|
129 |
+
<helpers>
|
130 |
+
<card>
|
131 |
+
<class>Conekta_Card_Helper</class>
|
132 |
+
</card>
|
133 |
+
</helpers>
|
134 |
+
</global>
|
135 |
+
<default>
|
136 |
+
<payment>
|
137 |
+
<card>
|
138 |
+
<active>1</active>
|
139 |
+
<model>card/card</model>
|
140 |
+
<order_status>pending</order_status>
|
141 |
+
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
142 |
+
<title>Card Payment Method</title>
|
143 |
+
<sort_order>0</sort_order>
|
144 |
+
</card>
|
145 |
+
</payment>
|
146 |
+
</default>
|
147 |
+
</config>
|
app/code/community/Conekta/Card/etc/system.xml
ADDED
@@ -0,0 +1,109 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<card translate="label" module="card">
|
7 |
+
<label>Conekta Card Payment Module</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>1</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<sort_order translate="label">
|
15 |
+
<label>Sort Order</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<frontend_class>validate-number</frontend_class>
|
22 |
+
</sort_order>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<order_status translate="label">
|
33 |
+
<label>New order status</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
+
<sort_order>2</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</order_status>
|
41 |
+
<webhook_notification_order_status translate="label">
|
42 |
+
<label>Order status when Conekta sends payment notification</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</webhook_notification_order_status>
|
50 |
+
<title translate="label">
|
51 |
+
<label>Title</label>
|
52 |
+
<frontend_type>text</frontend_type>
|
53 |
+
<sort_order>4</sort_order>
|
54 |
+
<show_in_default>1</show_in_default>
|
55 |
+
<show_in_website>1</show_in_website>
|
56 |
+
<show_in_store>0</show_in_store>
|
57 |
+
</title>
|
58 |
+
<activate_installments_3 translate="label">
|
59 |
+
<label>Activate MSI 3</label>
|
60 |
+
<frontend_type>select</frontend_type>
|
61 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
62 |
+
<sort_order>5</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
<show_in_store>0</show_in_store>
|
66 |
+
</activate_installments_3>
|
67 |
+
<activate_installments_6 translate="label">
|
68 |
+
<label>Activate MSI 6</label>
|
69 |
+
<frontend_type>select</frontend_type>
|
70 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
71 |
+
<sort_order>6</sort_order>
|
72 |
+
<show_in_default>1</show_in_default>
|
73 |
+
<show_in_website>1</show_in_website>
|
74 |
+
<show_in_store>0</show_in_store>
|
75 |
+
</activate_installments_6>
|
76 |
+
<activate_installments_9 translate="label">
|
77 |
+
<label>Activate MSI 9</label>
|
78 |
+
<frontend_type>select</frontend_type>
|
79 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
80 |
+
<sort_order>7</sort_order>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>0</show_in_store>
|
84 |
+
</activate_installments_9>
|
85 |
+
<activate_installments_12 translate="label">
|
86 |
+
<label>Activate MSI 12</label>
|
87 |
+
<frontend_type>select</frontend_type>
|
88 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
89 |
+
<sort_order>8</sort_order>
|
90 |
+
<show_in_default>1</show_in_default>
|
91 |
+
<show_in_website>1</show_in_website>
|
92 |
+
<show_in_store>0</show_in_store>
|
93 |
+
</activate_installments_12>
|
94 |
+
<amount_installments translate="label comment">
|
95 |
+
<label>Minimum Amount for MSI</label>
|
96 |
+
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
97 |
+
<frontend_model>card/adminhtml_system_config_installments</frontend_model> <!-- Specify our custom model -->
|
98 |
+
<sort_order>9</sort_order>
|
99 |
+
<show_in_default>1</show_in_default>
|
100 |
+
<show_in_website>1</show_in_website>
|
101 |
+
<show_in_store>1</show_in_store>
|
102 |
+
<comment>Set minimum amount for MSI.</comment>
|
103 |
+
</amount_installments>
|
104 |
+
</fields>
|
105 |
+
</card>
|
106 |
+
</groups>
|
107 |
+
</payment>
|
108 |
+
</sections>
|
109 |
+
</config>
|
app/code/community/Conekta/Card/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Card/sql/card_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,41 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
|
9 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
+
'length' => '255',
|
12 |
+
'comment' => 'Charge Id'
|
13 |
+
));
|
14 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
+
'length' => '255',
|
17 |
+
'comment' => 'Charge Id'
|
18 |
+
));
|
19 |
+
|
20 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_authorization', array(
|
21 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
22 |
+
'length' => '255',
|
23 |
+
'comment' => 'Authorization Number'
|
24 |
+
));
|
25 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_authorization', array(
|
26 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
27 |
+
'length' => '255',
|
28 |
+
'comment' => 'Authorization Number'
|
29 |
+
));
|
30 |
+
|
31 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'card_token', array(
|
32 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
33 |
+
'length' => '255',
|
34 |
+
'comment' => 'Card Token'
|
35 |
+
));
|
36 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'card_token', array(
|
37 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
38 |
+
'length' => '255',
|
39 |
+
'comment' => 'Card Token'
|
40 |
+
));
|
41 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.1.0-0.3.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.3-0.3.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.7-0.3.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.8-0.3.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.3.9-0.4.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.0-0.4.1.php
ADDED
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$connection = $installer->getConnection();
|
6 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'card_monthly_installments', array(
|
7 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
8 |
+
'length' => '255',
|
9 |
+
'comment' => 'Monthly Installments'
|
10 |
+
));
|
11 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'card_monthly_installments', array(
|
12 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
13 |
+
'length' => '255',
|
14 |
+
'comment' => 'Monthly Installments'
|
15 |
+
));
|
16 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.1-0.4.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.2-0.4.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.3-0.4.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.4-0.4.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.5-0.4.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.6-0.4.7.php
ADDED
@@ -0,0 +1,16 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$connection = $installer->getConnection();
|
6 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'card_bin', array(
|
7 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
8 |
+
'length' => '255',
|
9 |
+
'comment' => 'Card Bin Number'
|
10 |
+
));
|
11 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'card_bin', array(
|
12 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
13 |
+
'length' => '255',
|
14 |
+
'comment' => 'Card Bin Number'
|
15 |
+
));
|
16 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.7-0.4.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.8-0.4.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.4.9-0.5.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.0-0.5.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.1-0.5.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.2-0.5.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.3-0.5.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Card/sql/card_setup/mysql4-upgrade-0.5.4-0.5.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Oxxo/Block/Adminhtml/System/Config/Date.php.back
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Oxxo_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$date = new Varien_Data_Form_Element_Date;
|
7 |
+
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
8 |
+
|
9 |
+
$data = array(
|
10 |
+
'name' => $element->getName(),
|
11 |
+
'html_id' => $element->getId(),
|
12 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
13 |
+
);
|
14 |
+
$date->setData($data);
|
15 |
+
$date->setValue($element->getValue(), $format);
|
16 |
+
$date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
|
17 |
+
$date->setForm($element->getForm());
|
18 |
+
|
19 |
+
return $date->getElementHtml();
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Conekta/Oxxo/Block/Adminhtml/System/Config/Days.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Oxxo_Block_Adminhtml_System_Config_Days extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$days = new Varien_Data_Form_Element_Text;
|
7 |
+
$data = array(
|
8 |
+
'name' => $element->getName(),
|
9 |
+
'html_id' => $element->getId()
|
10 |
+
);
|
11 |
+
$days->setData($data);
|
12 |
+
if (is_numeric($element->getValue())) {
|
13 |
+
$days->setValue($element->getValue());
|
14 |
+
} else {
|
15 |
+
$days->setValue(30);
|
16 |
+
}
|
17 |
+
$days->setForm($element->getForm());
|
18 |
+
$html = $days->getElementHtml();
|
19 |
+
$javaScript = "
|
20 |
+
<script type=\"text/javascript\">
|
21 |
+
Event.observe(window, 'load', function() {
|
22 |
+
days=$('{$element->getHtmlId()}').value;
|
23 |
+
if (isNaN(days)) {
|
24 |
+
$('{$element->getHtmlId()}').value = '';
|
25 |
+
}
|
26 |
+
});
|
27 |
+
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
+
days=$('{$element->getHtmlId()}').value;
|
29 |
+
if (isNaN(days)) {
|
30 |
+
$('{$element->getHtmlId()}').value = '';
|
31 |
+
}
|
32 |
+
});
|
33 |
+
</script>";
|
34 |
+
$html .= $javaScript;
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Conekta/Oxxo/Block/Form/Oxxo.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Oxxo_Block_Form_Oxxo extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('oxxo/form/oxxo.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Conekta/Oxxo/Block/Info/Oxxo.php
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Oxxo_Block_Info_Oxxo extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('oxxo/info/oxxo.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareSpecificInformation($transport = null)
|
12 |
+
{
|
13 |
+
if (null !== $this->_paymentSpecificInformation) {
|
14 |
+
return $this->_paymentSpecificInformation;
|
15 |
+
}
|
16 |
+
$info = $this->getInfo();
|
17 |
+
$transport = new Varien_Object();
|
18 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
19 |
+
$data = array();
|
20 |
+
$data[Mage::helper('payment')->__('Barcode Url')] = $info->getOxxoBarcodeUrl();
|
21 |
+
//$transport->addData(array(
|
22 |
+
//Mage::helper('payment')->__('Expiry Date') => $info->getOxxoExpiryDate(),
|
23 |
+
//Mage::helper('payment')->__('Barcode Url') => $info->getOxxoBarcodeUrl()
|
24 |
+
//));
|
25 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Conekta/Oxxo/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Oxxo_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Oxxo/Model/Observer.php
ADDED
@@ -0,0 +1,140 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Oxxo_Model_Observer{
|
4 |
+
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta')) {
|
6 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
+
}
|
9 |
+
if($event->payment->getMethod() == Mage::getModel('Conekta_Oxxo_Model_Oxxo')->getCode()){
|
10 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
12 |
+
|
13 |
+
$order = $event->payment->getOrder();
|
14 |
+
$customer = $order->getCustomer();
|
15 |
+
$shipping_address = $order->getShippingAddress();
|
16 |
+
|
17 |
+
$billing = $order->getBillingAddress()->getData();
|
18 |
+
$email = $order->getCustomerEmail();
|
19 |
+
if ($shipping_address) {
|
20 |
+
$shipping_data = $shipping_address->getData();
|
21 |
+
}
|
22 |
+
$items = $order->getAllVisibleItems();
|
23 |
+
$line_items = array();
|
24 |
+
$i = 0;
|
25 |
+
foreach ($items as $itemId => $item){
|
26 |
+
$name = $item->getName();
|
27 |
+
$sku = $item->getSku();
|
28 |
+
$price = $item->getPrice();
|
29 |
+
$description = $item->getDescription();
|
30 |
+
$product_type = $item->getProductType();
|
31 |
+
$line_items = array_merge($line_items, array(array(
|
32 |
+
'name' => $name,
|
33 |
+
'sku' => $sku,
|
34 |
+
'unit_price' => $price,
|
35 |
+
'description' =>$description,
|
36 |
+
'quantity' => 1,
|
37 |
+
'type' => $product_type
|
38 |
+
))
|
39 |
+
);
|
40 |
+
$i = $i + 1;
|
41 |
+
}
|
42 |
+
$shipp = array();
|
43 |
+
if (empty($shipping_data) != true) {
|
44 |
+
$shipp = array(
|
45 |
+
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
46 |
+
'service' => $order->getShippingMethod(),
|
47 |
+
'carrier' => $order->getShippingDescription(),
|
48 |
+
'address' => array(
|
49 |
+
'street1' => $shipping_data['street'],
|
50 |
+
'city' => $shipping_data['city'],
|
51 |
+
'state' => $shipping_data['region'],
|
52 |
+
'country' => $shipping_data['country_id'],
|
53 |
+
'zip' => $shipping_data['postcode'],
|
54 |
+
'phone' =>$shipping_data['telephone'],
|
55 |
+
'email' =>$email
|
56 |
+
)
|
57 |
+
);
|
58 |
+
}
|
59 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
60 |
+
$expiry_date=Date('Y-m-d', strtotime("+".$days." days"));
|
61 |
+
try {
|
62 |
+
$charge = Conekta_Charge::create(array(
|
63 |
+
'cash'=>array(
|
64 |
+
'type'=>'oxxo',
|
65 |
+
'expires_at'=>$expiry_date
|
66 |
+
),
|
67 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
68 |
+
'amount' => intval(((float) $order->grandTotal) * 100),
|
69 |
+
'description' => 'Compra en Magento',
|
70 |
+
'reference_id' => $order->getIncrementId(),
|
71 |
+
'details' => array(
|
72 |
+
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['firstname']),
|
73 |
+
'email' => $email,
|
74 |
+
'phone' => $billing['telephone'],
|
75 |
+
'billing_address' => array(
|
76 |
+
'company_name' => $billing['company'],
|
77 |
+
'street1' => $billing['street'],
|
78 |
+
'city' =>$billing['city'],
|
79 |
+
'state' =>$billing['region'],
|
80 |
+
'country' =>$billing['country_id'],
|
81 |
+
'zip' =>$billing['postcode'],
|
82 |
+
'phone' =>$billing['telephone'],
|
83 |
+
'email' =>$email
|
84 |
+
),
|
85 |
+
'line_items' => $line_items,
|
86 |
+
'shipment' => $shipp
|
87 |
+
),
|
88 |
+
'coupon_code' => $order->getCouponCode(),
|
89 |
+
'custom_fields' => array(
|
90 |
+
'customer' => array(
|
91 |
+
'website_id' => $customer->getWebsiteId(),
|
92 |
+
'entity_id' => $customer->getEntityId(),
|
93 |
+
'entity_type_id' => $customer->getEntityTypeId(),
|
94 |
+
'attribute_set_id' => $customer->getAttributeSetId(),
|
95 |
+
'email' => $customer->getEmail(),
|
96 |
+
'group_id' => $customer->getGroupId(),
|
97 |
+
'store_id' => $customer->getStoreId(),
|
98 |
+
'created_at' => $customer->getCreatedAt(),
|
99 |
+
'updated_at' => $customer->getUpdatedAt(),
|
100 |
+
'is_active' => $customer->getIsActive(),
|
101 |
+
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
102 |
+
'get_tax_vat' => $customer->getTaxvat(),
|
103 |
+
'created_in' => $customer->getCreatedIn(),
|
104 |
+
'gender' => $customer->getGender(),
|
105 |
+
'default_billing' => $customer->getDefaultBilling(),
|
106 |
+
'default_shipping' => $customer->getDefaultShipping(),
|
107 |
+
'dob' => $customer->getDob(),
|
108 |
+
'tax_class_id' => $customer->getTaxClassId()
|
109 |
+
),
|
110 |
+
'discount_description' => $order->getDiscountDescription(),
|
111 |
+
'discount_amount' => $order->getDiscountAmount(),
|
112 |
+
'shipping_amount' => $shipping_address->getShippingAmount(),
|
113 |
+
'shipping_description' => $shipping_address->getShippingDescription(),
|
114 |
+
'shipping_method' => $shipping_address->getShippingMethod()
|
115 |
+
)
|
116 |
+
)
|
117 |
+
);
|
118 |
+
} catch (Conekta_Error $e){
|
119 |
+
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
120 |
+
}
|
121 |
+
$event->payment->setOxxoExpiryDate($expiry_date);
|
122 |
+
$event->payment->setOxxoBarcodeUrl($charge->payment_method->barcode_url);
|
123 |
+
$event->payment->setOxxoBarcode($charge->payment_method->barcode);
|
124 |
+
$event->payment->setChargeId($charge->id);
|
125 |
+
//Update Quote
|
126 |
+
$order = $order;
|
127 |
+
$quote = $order->getQuote();
|
128 |
+
$payment = $quote->getPayment();
|
129 |
+
$payment->setOxxoExpiryDate($expiry_date);
|
130 |
+
$payment->setOxxoBarcodeUrl($charge->payment_method->barcode_url);
|
131 |
+
$payment->setOxxoBarcode($charge->payment_method->barcode);
|
132 |
+
$payment->setChargeId($charge->id);
|
133 |
+
$quote->collectTotals();
|
134 |
+
$quote->save();
|
135 |
+
$order->setQuote($quote);
|
136 |
+
$order->save();
|
137 |
+
}
|
138 |
+
return $event;
|
139 |
+
}
|
140 |
+
}
|
app/code/community/Conekta/Oxxo/Model/Oxxo.php
ADDED
@@ -0,0 +1,22 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Oxxo_Model_Oxxo extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'oxxo';
|
5 |
+
protected $_formBlockType = 'oxxo/form_oxxo';
|
6 |
+
protected $_infoBlockType = 'oxxo/info_oxxo';
|
7 |
+
|
8 |
+
public function assignData($data)
|
9 |
+
{
|
10 |
+
if (!($data instanceof Varien_Object)) {
|
11 |
+
$data = new Varien_Object($data);
|
12 |
+
}
|
13 |
+
$info = $this->getInfoInstance();
|
14 |
+
$info->setOxxoExpiryDate($data->getOxxoExpiryDate())
|
15 |
+
->setOxxoBarcodeUrl($data->getOxxoBarcodeUrl())
|
16 |
+
->setOxxoBarcode($data->getOxxoBarcode())
|
17 |
+
;
|
18 |
+
return $this;
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
22 |
+
?>
|
app/code/community/Conekta/Oxxo/etc/config.xml
ADDED
@@ -0,0 +1,131 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Oxxo>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Oxxo>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Conekta_Card>
|
12 |
+
<files>
|
13 |
+
<default>Conekta_Card.csv</default>
|
14 |
+
</files>
|
15 |
+
</Conekta_Card>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</adminhtml>
|
19 |
+
<frontend>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Conekta_Card>
|
23 |
+
<files>
|
24 |
+
<default>Conekta_Oxxo.csv</default>
|
25 |
+
</files>
|
26 |
+
</Conekta_Card>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
<routers>
|
30 |
+
<oxxo>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Conekta_Oxxo</module>
|
34 |
+
<frontName>oxxo</frontName>
|
35 |
+
</args>
|
36 |
+
</oxxo>
|
37 |
+
</routers>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<oxxo>
|
41 |
+
<file>oxxo.xml</file>
|
42 |
+
</oxxo>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<sales_order_payment_place_start>
|
49 |
+
<observers>
|
50 |
+
<oxxo>
|
51 |
+
<class>oxxo/observer</class>
|
52 |
+
<method>processPayment</method>
|
53 |
+
</oxxo>
|
54 |
+
</observers>
|
55 |
+
</sales_order_payment_place_start>
|
56 |
+
</events>
|
57 |
+
<fieldsets>
|
58 |
+
<sales_convert_quote_payment>
|
59 |
+
<oxxo_barcode_url>
|
60 |
+
<to_order_payment>*</to_order_payment>
|
61 |
+
</oxxo_barcode_url>
|
62 |
+
<oxxo_barcode>
|
63 |
+
<to_order_payment>*</to_order_payment>
|
64 |
+
</oxxo_barcode>
|
65 |
+
<oxxo_expiry_date>
|
66 |
+
<to_order_payment>*</to_order_payment>
|
67 |
+
</oxxo_expiry_date>
|
68 |
+
<charge_id>
|
69 |
+
<to_order_payment>*</to_order_payment>
|
70 |
+
</charge_id>
|
71 |
+
</sales_convert_quote_payment>
|
72 |
+
</fieldsets>
|
73 |
+
<models>
|
74 |
+
<oxxo>
|
75 |
+
<class>Conekta_Oxxo_Model</class>
|
76 |
+
<resourceModel>oxxo_mysql4</resourceModel>
|
77 |
+
</oxxo>
|
78 |
+
<oxxo_mysql4>
|
79 |
+
<class>Conekta_Oxxo_Model_Mysql4</class>
|
80 |
+
<entities>
|
81 |
+
<oxxo>
|
82 |
+
<table>oxxo</table>
|
83 |
+
</oxxo>
|
84 |
+
</entities>
|
85 |
+
</oxxo_mysql4>
|
86 |
+
</models>
|
87 |
+
<resources>
|
88 |
+
<oxxo_setup>
|
89 |
+
<setup>
|
90 |
+
<module>Conekta_Oxxo</module>
|
91 |
+
</setup>
|
92 |
+
<connection>
|
93 |
+
<use>core_setup</use>
|
94 |
+
</connection>
|
95 |
+
</oxxo_setup>
|
96 |
+
<oxxo_write>
|
97 |
+
<connection>
|
98 |
+
<use>core_write</use>
|
99 |
+
</connection>
|
100 |
+
</oxxo_write>
|
101 |
+
<oxxo_read>
|
102 |
+
<connection>
|
103 |
+
<use>core_read</use>
|
104 |
+
</connection>
|
105 |
+
</oxxo_read>
|
106 |
+
</resources>
|
107 |
+
<blocks>
|
108 |
+
<oxxo>
|
109 |
+
<class>Conekta_Oxxo_Block</class>
|
110 |
+
</oxxo>
|
111 |
+
</blocks>
|
112 |
+
<helpers>
|
113 |
+
<oxxo>
|
114 |
+
<class>Conekta_Oxxo_Helper</class>
|
115 |
+
</oxxo>
|
116 |
+
</helpers>
|
117 |
+
</global>
|
118 |
+
<default>
|
119 |
+
<payment>
|
120 |
+
<oxxo>
|
121 |
+
<active>1</active>
|
122 |
+
<model>oxxo/oxxo</model>
|
123 |
+
<order_status>pending</order_status>
|
124 |
+
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
125 |
+
<expiry_date></expiry_date>
|
126 |
+
<title>Oxxo Payment Method</title>
|
127 |
+
<sort_order>0</sort_order>
|
128 |
+
</oxxo>
|
129 |
+
</payment>
|
130 |
+
</default>
|
131 |
+
</config>
|
app/code/community/Conekta/Oxxo/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<oxxo translate="label" module="oxxo">
|
7 |
+
<label>Conekta Oxxo Payment Module</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>3</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<sort_order translate="label">
|
15 |
+
<label>Sort Order</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<frontend_class>validate-number</frontend_class>
|
22 |
+
</sort_order>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<order_status translate="label">
|
33 |
+
<label>New order status</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
+
<sort_order>2</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</order_status>
|
41 |
+
<webhook_notification_order_status translate="label">
|
42 |
+
<label>Order status when Conekta sends payment notification</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</webhook_notification_order_status>
|
50 |
+
<my_date translate="label comment">
|
51 |
+
<label>Expiry (# days)</label>
|
52 |
+
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
53 |
+
<frontend_model>oxxo/adminhtml_system_config_days</frontend_model> <!-- Specify our custom model -->
|
54 |
+
<sort_order>4</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<comment>Set the expiry of this offline payment</comment>
|
59 |
+
</my_date>
|
60 |
+
<title translate="label">
|
61 |
+
<label>Title</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>5</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>0</show_in_store>
|
67 |
+
</title>
|
68 |
+
</fields>
|
69 |
+
</oxxo>
|
70 |
+
</groups>
|
71 |
+
</payment>
|
72 |
+
</sections>
|
73 |
+
</config>
|
app/code/community/Conekta/Oxxo/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,39 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
|
9 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
+
'length' => '255',
|
12 |
+
'comment' => 'Charge Id'
|
13 |
+
));
|
14 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
+
'length' => '255',
|
17 |
+
'comment' => 'Card Id'
|
18 |
+
));
|
19 |
+
|
20 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'oxxo_expiry_date', array(
|
21 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
22 |
+
'comment' => 'Oxxo Expiry Date'
|
23 |
+
));
|
24 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'oxxo_expiry_date', array(
|
25 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
26 |
+
'comment' => 'Oxxo Expiry Date'
|
27 |
+
));
|
28 |
+
|
29 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'oxxo_barcode_url', array(
|
30 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
31 |
+
'length' => '255',
|
32 |
+
'comment' => 'Oxxo Barcode URL'
|
33 |
+
));
|
34 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'oxxo_barcode_url', array(
|
35 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
36 |
+
'length' => '255',
|
37 |
+
'comment' => 'Oxxo Barcode URL'
|
38 |
+
));
|
39 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.1.8-0.1.9.php
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'oxxo_barcode', array(
|
9 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
10 |
+
'length' => '255',
|
11 |
+
'comment' => 'Oxxo Reference'
|
12 |
+
));
|
13 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'oxxo_barcode', array(
|
14 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
15 |
+
'length' => '255',
|
16 |
+
'comment' => 'Oxxo Reference'
|
17 |
+
));
|
18 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.1.9-0.3.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.3-0.3.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.7-0.3.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.8-0.3.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.3.9-0.4.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.0-0.4.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.1-0.4.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.2-0.4.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.3-0.4.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.4-0.4.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.5-0.4.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.6-0.4.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.7-0.4.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.8-0.4.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.4.9-0.5.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.0-0.5.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.1-0.5.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.2-0.5.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.3-0.5.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/mysql4-upgrade-0.5.4-0.5.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Date.php.back
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Realtime_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$date = new Varien_Data_Form_Element_Date;
|
7 |
+
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
8 |
+
|
9 |
+
$data = array(
|
10 |
+
'name' => $element->getName(),
|
11 |
+
'html_id' => $element->getId(),
|
12 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
13 |
+
);
|
14 |
+
$date->setData($data);
|
15 |
+
$date->setValue($element->getValue(), $format);
|
16 |
+
$date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
|
17 |
+
$date->setForm($element->getForm());
|
18 |
+
|
19 |
+
return $date->getElementHtml();
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Days.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Realtime_Block_Adminhtml_System_Config_Days extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$days = new Varien_Data_Form_Element_Text;
|
7 |
+
$data = array(
|
8 |
+
'name' => $element->getName(),
|
9 |
+
'html_id' => $element->getId()
|
10 |
+
);
|
11 |
+
$days->setData($data);
|
12 |
+
if (is_numeric($element->getValue())) {
|
13 |
+
$days->setValue($element->getValue());
|
14 |
+
} else {
|
15 |
+
$days->setValue(30);
|
16 |
+
}
|
17 |
+
$days->setForm($element->getForm());
|
18 |
+
$html = $days->getElementHtml();
|
19 |
+
$javaScript = "
|
20 |
+
<script type=\"text/javascript\">
|
21 |
+
Event.observe(window, 'load', function() {
|
22 |
+
days=$('{$element->getHtmlId()}').value;
|
23 |
+
if (isNaN(days)) {
|
24 |
+
$('{$element->getHtmlId()}').value = '';
|
25 |
+
}
|
26 |
+
});
|
27 |
+
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
+
days=$('{$element->getHtmlId()}').value;
|
29 |
+
if (isNaN(days)) {
|
30 |
+
$('{$element->getHtmlId()}').value = '';
|
31 |
+
}
|
32 |
+
});
|
33 |
+
</script>";
|
34 |
+
$html .= $javaScript;
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Conekta/Realtime/Block/Form/Realtime.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Realtime_Block_Form_Realtime extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('realtime/form/realtime.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Conekta/Realtime/Block/Info/Realtime.php
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Realtime_Block_Info_Realtime extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('realtime/info/realtime.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareSpecificInformation($transport = null)
|
12 |
+
{
|
13 |
+
if (null !== $this->_paymentSpecificInformation) {
|
14 |
+
return $this->_paymentSpecificInformation;
|
15 |
+
}
|
16 |
+
$info = $this->getInfo();
|
17 |
+
$transport = new Varien_Object();
|
18 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
19 |
+
$data = array();
|
20 |
+
$data[Mage::helper('payment')->__('Barcode Url')] = $info->getRealtimeBarcodeUrl();
|
21 |
+
//$transport->addData(array(
|
22 |
+
//Mage::helper('payment')->__('Expiry Date') => $info->getRealtimeExpiryDate(),
|
23 |
+
//Mage::helper('payment')->__('Barcode Url') => $info->getRealtimeBarcodeUrl()
|
24 |
+
//));
|
25 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Conekta/Realtime/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Realtime_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Realtime/Model/Observer.php
ADDED
@@ -0,0 +1,143 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Realtime_Model_Observer{
|
4 |
+
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta')) {
|
6 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
+
}
|
9 |
+
if($event->payment->getMethod() == Mage::getModel('Conekta_Realtime_Model_Realtime')->getCode()){
|
10 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
Conekta::setApiVersion("1.0.0");
|
12 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
13 |
+
|
14 |
+
$order = $event->payment->getOrder();
|
15 |
+
$customer = $order->getCustomer();
|
16 |
+
$shipping_address = $order->getShippingAddress();
|
17 |
+
|
18 |
+
$billing = $order->getBillingAddress()->getData();
|
19 |
+
$email = $order->getCustomerEmail();
|
20 |
+
if ($shipping_address) {
|
21 |
+
$shipping_data = $order->getShippingAddress()->getData();
|
22 |
+
}
|
23 |
+
$items = $order->getAllVisibleItems();
|
24 |
+
$line_items = array();
|
25 |
+
$i = 0;
|
26 |
+
foreach ($items as $itemId => $item){
|
27 |
+
$name = $item->getName();
|
28 |
+
$sku = $item->getSku();
|
29 |
+
$price = $item->getPrice();
|
30 |
+
$description = $item->getDescription();
|
31 |
+
$product_type = $item->getProductType();
|
32 |
+
$line_items = array_merge($line_items, array(array(
|
33 |
+
'name' => $name,
|
34 |
+
'sku' => $sku,
|
35 |
+
'unit_price' => $price,
|
36 |
+
'description' =>$description,
|
37 |
+
'quantity' => 1,
|
38 |
+
'type' => $product_type
|
39 |
+
))
|
40 |
+
);
|
41 |
+
$i = $i + 1;
|
42 |
+
}
|
43 |
+
$shipp = array();
|
44 |
+
if (empty($shipping_data) != true) {
|
45 |
+
$shipp = array(
|
46 |
+
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
47 |
+
'service' => $order->getShippingMethod(),
|
48 |
+
'carrier' => $order->getShippingDescription(),
|
49 |
+
'address' => array(
|
50 |
+
'street1' => $shipping_data['street'],
|
51 |
+
'city' => $shipping_data['city'],
|
52 |
+
'state' => $shipping_data['region'],
|
53 |
+
'country' => $shipping_data['country_id'],
|
54 |
+
'zip' => $shipping_data['postcode'],
|
55 |
+
'phone' =>$shipping_data['telephone'],
|
56 |
+
'email' =>$email
|
57 |
+
)
|
58 |
+
);
|
59 |
+
}
|
60 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
61 |
+
$expiry_date=Date('Y-m-d', strtotime("+".$days." days"));
|
62 |
+
try {
|
63 |
+
$charge = Conekta_Charge::create(array(
|
64 |
+
'cash'=>array(
|
65 |
+
'type'=>'real_time',
|
66 |
+
'expires_at'=>$expiry_date
|
67 |
+
),
|
68 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
69 |
+
'amount' => intval(((float) $order->grandTotal) * 100),
|
70 |
+
'description' => 'Compra en Magento',
|
71 |
+
'reference_id' => $order->getIncrementId(),
|
72 |
+
'details' => array(
|
73 |
+
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['firstname']),
|
74 |
+
'email' => $email,
|
75 |
+
'phone' => $billing['telephone'],
|
76 |
+
'billing_address' => array(
|
77 |
+
'company_name' => $billing['company'],
|
78 |
+
'street1' => $billing['street'],
|
79 |
+
'city' =>$billing['city'],
|
80 |
+
'state' =>$billing['region'],
|
81 |
+
'country' =>$billing['country_id'],
|
82 |
+
'zip' =>$billing['postcode'],
|
83 |
+
'phone' =>$billing['telephone'],
|
84 |
+
'email' =>$email
|
85 |
+
),
|
86 |
+
'line_items' => $line_items,
|
87 |
+
'shipment' => $shipp
|
88 |
+
),
|
89 |
+
'coupon_code' => $order->getCouponCode(),
|
90 |
+
'custom_fields' => array(
|
91 |
+
'customer' => array(
|
92 |
+
'website_id' => $customer->getWebsiteId(),
|
93 |
+
'entity_id' => $customer->getEntityId(),
|
94 |
+
'entity_type_id' => $customer->getEntityTypeId(),
|
95 |
+
'attribute_set_id' => $customer->getAttributeSetId(),
|
96 |
+
'email' => $customer->getEmail(),
|
97 |
+
'group_id' => $customer->getGroupId(),
|
98 |
+
'store_id' => $customer->getStoreId(),
|
99 |
+
'created_at' => $customer->getCreatedAt(),
|
100 |
+
'updated_at' => $customer->getUpdatedAt(),
|
101 |
+
'is_active' => $customer->getIsActive(),
|
102 |
+
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
103 |
+
'get_tax_vat' => $customer->getTaxvat(),
|
104 |
+
'created_in' => $customer->getCreatedIn(),
|
105 |
+
'gender' => $customer->getGender(),
|
106 |
+
'default_billing' => $customer->getDefaultBilling(),
|
107 |
+
'default_shipping' => $customer->getDefaultShipping(),
|
108 |
+
'dob' => $customer->getDob(),
|
109 |
+
'tax_class_id' => $customer->getTaxClassId()
|
110 |
+
),
|
111 |
+
'discount_description' => $order->getDiscountDescription(),
|
112 |
+
'discount_amount' => $order->getDiscountAmount(),
|
113 |
+
'shipping_amount' => $shipping_address->getShippingAmount(),
|
114 |
+
'shipping_description' => $shipping_address->getShippingDescription(),
|
115 |
+
'shipping_method' => $shipping_address->getShippingMethod()
|
116 |
+
)
|
117 |
+
)
|
118 |
+
);
|
119 |
+
} catch (Conekta_Error $e){
|
120 |
+
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
121 |
+
}
|
122 |
+
$event->payment->setRealtimeExpiryDate($expiry_date);
|
123 |
+
$event->payment->setRealtimeBarcodeUrl($charge->payment_method->barcode_url);
|
124 |
+
$event->payment->setRealtimeBarcode($charge->payment_method->barcode);
|
125 |
+
$event->payment->setRealtimeStoreName($charge->payment_method->store_name);
|
126 |
+
$event->payment->setChargeId($charge->id);
|
127 |
+
//Update Quote
|
128 |
+
$order = $order;
|
129 |
+
$quote = $order->getQuote();
|
130 |
+
$payment = $quote->getPayment();
|
131 |
+
$payment->setRealtimeExpiryDate($expiry_date);
|
132 |
+
$payment->setRealtimeBarcodeUrl($charge->payment_method->barcode_url);
|
133 |
+
$payment->setRealtimeBarcode($charge->payment_method->barcode);
|
134 |
+
$payment->setRealtimeStoreName($charge->payment_method->store_name);
|
135 |
+
$payment->setChargeId($charge->id);
|
136 |
+
$quote->collectTotals();
|
137 |
+
$quote->save();
|
138 |
+
$order->setQuote($quote);
|
139 |
+
$order->save();
|
140 |
+
}
|
141 |
+
return $event;
|
142 |
+
}
|
143 |
+
}
|
app/code/community/Conekta/Realtime/Model/Realtime.php
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Realtime_Model_Realtime extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'realtime';
|
5 |
+
protected $_formBlockType = 'realtime/form_realtime';
|
6 |
+
protected $_infoBlockType = 'realtime/info_realtime';
|
7 |
+
|
8 |
+
public function assignData($data)
|
9 |
+
{
|
10 |
+
if (!($data instanceof Varien_Object)) {
|
11 |
+
$data = new Varien_Object($data);
|
12 |
+
}
|
13 |
+
$info = $this->getInfoInstance();
|
14 |
+
$info->setRealtimeExpiryDate($data->getRealtimeExpiryDate())
|
15 |
+
->setRealtimeBarcodeUrl($data->getRealtimeBarcodeUrl())
|
16 |
+
->setRealtimeBarcode($data->getRealtimeBarcode())
|
17 |
+
->setRealtimeStoreName($data->getRealtimeStoreName())
|
18 |
+
;
|
19 |
+
return $this;
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
23 |
+
?>
|
app/code/community/Conekta/Realtime/etc/config.xml
ADDED
@@ -0,0 +1,134 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Realtime>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Realtime>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Conekta_Card>
|
12 |
+
<files>
|
13 |
+
<default>Conekta_Card.csv</default>
|
14 |
+
</files>
|
15 |
+
</Conekta_Card>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</adminhtml>
|
19 |
+
<frontend>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Conekta_Card>
|
23 |
+
<files>
|
24 |
+
<default>Conekta_Realtime.csv</default>
|
25 |
+
</files>
|
26 |
+
</Conekta_Card>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
<routers>
|
30 |
+
<realtime>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Conekta_Realtime</module>
|
34 |
+
<frontName>realtime</frontName>
|
35 |
+
</args>
|
36 |
+
</realtime>
|
37 |
+
</routers>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<realtime>
|
41 |
+
<file>realtime.xml</file>
|
42 |
+
</realtime>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<sales_order_payment_place_start>
|
49 |
+
<observers>
|
50 |
+
<realtime>
|
51 |
+
<class>realtime/observer</class>
|
52 |
+
<method>processPayment</method>
|
53 |
+
</realtime>
|
54 |
+
</observers>
|
55 |
+
</sales_order_payment_place_start>
|
56 |
+
</events>
|
57 |
+
<fieldsets>
|
58 |
+
<sales_convert_quote_payment>
|
59 |
+
<realtime_barcode_url>
|
60 |
+
<to_order_payment>*</to_order_payment>
|
61 |
+
</realtime_barcode_url>
|
62 |
+
<realtime_barcode>
|
63 |
+
<to_order_payment>*</to_order_payment>
|
64 |
+
</realtime_barcode>
|
65 |
+
<realtime_store_name>
|
66 |
+
<to_order_payment>*</to_order_payment>
|
67 |
+
</realtime_store_name>
|
68 |
+
<realtime_expiry_date>
|
69 |
+
<to_order_payment>*</to_order_payment>
|
70 |
+
</realtime_expiry_date>
|
71 |
+
<charge_id>
|
72 |
+
<to_order_payment>*</to_order_payment>
|
73 |
+
</charge_id>
|
74 |
+
</sales_convert_quote_payment>
|
75 |
+
</fieldsets>
|
76 |
+
<models>
|
77 |
+
<realtime>
|
78 |
+
<class>Conekta_Realtime_Model</class>
|
79 |
+
<resourceModel>realtime_mysql4</resourceModel>
|
80 |
+
</realtime>
|
81 |
+
<realtime_mysql4>
|
82 |
+
<class>Conekta_Realtime_Model_Mysql4</class>
|
83 |
+
<entities>
|
84 |
+
<realtime>
|
85 |
+
<table>realtime</table>
|
86 |
+
</realtime>
|
87 |
+
</entities>
|
88 |
+
</realtime_mysql4>
|
89 |
+
</models>
|
90 |
+
<resources>
|
91 |
+
<realtime_setup>
|
92 |
+
<setup>
|
93 |
+
<module>Conekta_Realtime</module>
|
94 |
+
</setup>
|
95 |
+
<connection>
|
96 |
+
<use>core_setup</use>
|
97 |
+
</connection>
|
98 |
+
</realtime_setup>
|
99 |
+
<realtime_write>
|
100 |
+
<connection>
|
101 |
+
<use>core_write</use>
|
102 |
+
</connection>
|
103 |
+
</realtime_write>
|
104 |
+
<realtime_read>
|
105 |
+
<connection>
|
106 |
+
<use>core_read</use>
|
107 |
+
</connection>
|
108 |
+
</realtime_read>
|
109 |
+
</resources>
|
110 |
+
<blocks>
|
111 |
+
<realtime>
|
112 |
+
<class>Conekta_Realtime_Block</class>
|
113 |
+
</realtime>
|
114 |
+
</blocks>
|
115 |
+
<helpers>
|
116 |
+
<realtime>
|
117 |
+
<class>Conekta_Realtime_Helper</class>
|
118 |
+
</realtime>
|
119 |
+
</helpers>
|
120 |
+
</global>
|
121 |
+
<default>
|
122 |
+
<payment>
|
123 |
+
<realtime>
|
124 |
+
<active>1</active>
|
125 |
+
<model>realtime/realtime</model>
|
126 |
+
<order_status>pending</order_status>
|
127 |
+
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
128 |
+
<expiry_date></expiry_date>
|
129 |
+
<title>Realtime Payment Method</title>
|
130 |
+
<sort_order>0</sort_order>
|
131 |
+
</realtime>
|
132 |
+
</payment>
|
133 |
+
</default>
|
134 |
+
</config>
|
app/code/community/Conekta/Realtime/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<realtime translate="label" module="realtime">
|
7 |
+
<label>Conekta Realtime Payment Module</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>4</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<sort_order translate="label">
|
15 |
+
<label>Sort Order</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<frontend_class>validate-number</frontend_class>
|
22 |
+
</sort_order>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<order_status translate="label">
|
33 |
+
<label>New order status</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
+
<sort_order>2</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</order_status>
|
41 |
+
<webhook_notification_order_status translate="label">
|
42 |
+
<label>Order status when Conekta sends payment notification</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</webhook_notification_order_status>
|
50 |
+
<my_date translate="label comment">
|
51 |
+
<label>Expiry (# days)</label>
|
52 |
+
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
53 |
+
<frontend_model>realtime/adminhtml_system_config_days</frontend_model> <!-- Specify our custom model -->
|
54 |
+
<sort_order>4</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<comment>Set the expiry of this offline payment</comment>
|
59 |
+
</my_date>
|
60 |
+
<title translate="label">
|
61 |
+
<label>Title</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>5</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>0</show_in_store>
|
67 |
+
</title>
|
68 |
+
</fields>
|
69 |
+
</realtime>
|
70 |
+
</groups>
|
71 |
+
</payment>
|
72 |
+
</sections>
|
73 |
+
</config>
|
app/code/community/Conekta/Realtime/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Realtime/sql/realtime_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,60 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
|
9 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
+
'length' => '255',
|
12 |
+
'comment' => 'Charge Id'
|
13 |
+
));
|
14 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
+
'length' => '255',
|
17 |
+
'comment' => 'Card Id'
|
18 |
+
));
|
19 |
+
|
20 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_expiry_date', array(
|
21 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
22 |
+
'comment' => 'Realtime Expiry Date'
|
23 |
+
));
|
24 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_expiry_date', array(
|
25 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
26 |
+
'comment' => 'Realtime Expiry Date'
|
27 |
+
));
|
28 |
+
|
29 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_barcode_url', array(
|
30 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
31 |
+
'length' => '255',
|
32 |
+
'comment' => 'Realtime Barcode URL'
|
33 |
+
));
|
34 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_barcode_url', array(
|
35 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
36 |
+
'length' => '255',
|
37 |
+
'comment' => 'Realtime Barcode URL'
|
38 |
+
));
|
39 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_barcode', array(
|
40 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
41 |
+
'length' => '255',
|
42 |
+
'comment' => 'Realtime Reference'
|
43 |
+
));
|
44 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_barcode', array(
|
45 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
46 |
+
'length' => '255',
|
47 |
+
'comment' => 'Realtime Reference'
|
48 |
+
));
|
49 |
+
|
50 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_store_name', array(
|
51 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
52 |
+
'length' => '255',
|
53 |
+
'comment' => 'Realtime Store Name'
|
54 |
+
));
|
55 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_store_name', array(
|
56 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
57 |
+
'length' => '255',
|
58 |
+
'comment' => 'Realtime Store Name'
|
59 |
+
));
|
60 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.1.0-0.3.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.3-0.3.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.7-0.3.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.8-0.3.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.9-0.4.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.0-0.4.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.1-0.4.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.2-0.4.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.3-0.4.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.4-0.4.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.5-0.4.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.6-0.4.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.7-0.4.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.8-0.4.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.9-0.5.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.0-0.5.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.1-0.5.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.2-0.5.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.3-0.5.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.4-0.5.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Spei/Block/Adminhtml/System/Config/Date.php.back
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Spei_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$date = new Varien_Data_Form_Element_Date;
|
7 |
+
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
8 |
+
|
9 |
+
$data = array(
|
10 |
+
'name' => $element->getName(),
|
11 |
+
'html_id' => $element->getId(),
|
12 |
+
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
13 |
+
);
|
14 |
+
$date->setData($data);
|
15 |
+
$date->setValue($element->getValue(), $format);
|
16 |
+
$date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
|
17 |
+
$date->setForm($element->getForm());
|
18 |
+
|
19 |
+
return $date->getElementHtml();
|
20 |
+
}
|
21 |
+
}
|
app/code/community/Conekta/Spei/Block/Adminhtml/System/Config/Days.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Spei_Block_Adminhtml_System_Config_Days extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
+
{
|
4 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
+
{
|
6 |
+
$days = new Varien_Data_Form_Element_Text;
|
7 |
+
$data = array(
|
8 |
+
'name' => $element->getName(),
|
9 |
+
'html_id' => $element->getId()
|
10 |
+
);
|
11 |
+
$days->setData($data);
|
12 |
+
if (is_numeric($element->getValue())) {
|
13 |
+
$days->setValue($element->getValue());
|
14 |
+
} else {
|
15 |
+
$days->setValue(30);
|
16 |
+
}
|
17 |
+
$days->setForm($element->getForm());
|
18 |
+
$html = $days->getElementHtml();
|
19 |
+
$javaScript = "
|
20 |
+
<script type=\"text/javascript\">
|
21 |
+
Event.observe(window, 'load', function() {
|
22 |
+
days=$('{$element->getHtmlId()}').value;
|
23 |
+
if (isNaN(days)) {
|
24 |
+
$('{$element->getHtmlId()}').value = '';
|
25 |
+
}
|
26 |
+
});
|
27 |
+
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
+
days=$('{$element->getHtmlId()}').value;
|
29 |
+
if (isNaN(days)) {
|
30 |
+
$('{$element->getHtmlId()}').value = '';
|
31 |
+
}
|
32 |
+
});
|
33 |
+
</script>";
|
34 |
+
$html .= $javaScript;
|
35 |
+
return $html;
|
36 |
+
}
|
37 |
+
}
|
app/code/community/Conekta/Spei/Block/Form/Spei.php
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Spei_Block_Form_Spei extends Mage_Payment_Block_Form
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->setTemplate('spei/form/spei.phtml');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Conekta/Spei/Block/Info/Spei.php
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Spei_Block_Info_Spei extends Mage_Payment_Block_Info
|
3 |
+
{
|
4 |
+
|
5 |
+
protected function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->setTemplate('spei/info/spei.phtml');
|
9 |
+
}
|
10 |
+
|
11 |
+
protected function _prepareSpecificInformation($transport = null)
|
12 |
+
{
|
13 |
+
if (null !== $this->_paymentSpecificInformation) {
|
14 |
+
return $this->_paymentSpecificInformation;
|
15 |
+
}
|
16 |
+
$info = $this->getInfo();
|
17 |
+
$transport = new Varien_Object();
|
18 |
+
$transport = parent::_prepareSpecificInformation($transport);
|
19 |
+
$data = array();
|
20 |
+
$data[Mage::helper('payment')->__('CLABE')] = $info->getSpeiClabe();
|
21 |
+
//$transport->addData(array(
|
22 |
+
//Mage::helper('payment')->__('Expiry Date') => $info->getSpeiExpiryDate(),
|
23 |
+
//Mage::helper('payment')->__('Barcode Url') => $info->getSpeiBarcodeUrl()
|
24 |
+
//));
|
25 |
+
return $transport->setData(array_merge($data, $transport->getData()));
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Conekta/Spei/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Spei_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Spei/Model/Observer.php
ADDED
@@ -0,0 +1,137 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Spei_Model_Observer{
|
4 |
+
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta')) {
|
6 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
+
}
|
9 |
+
if($event->payment->getMethod() == Mage::getModel('Conekta_Spei_Model_Spei')->getCode()){
|
10 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
Conekta::setApiVersion("1.0.0");
|
12 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
13 |
+
|
14 |
+
$order = $event->payment->getOrder();
|
15 |
+
$customer = $order->getCustomer();
|
16 |
+
$shipping_address = $order->getShippingAddress();
|
17 |
+
|
18 |
+
$billing = $order->getBillingAddress()->getData();
|
19 |
+
$email = $order->getCustomerEmail();
|
20 |
+
if ($shipping_address) {
|
21 |
+
$shipping_data = $shipping_address->getData();
|
22 |
+
}
|
23 |
+
$items = $order->getAllVisibleItems();
|
24 |
+
$line_items = array();
|
25 |
+
$i = 0;
|
26 |
+
foreach ($items as $itemId => $item){
|
27 |
+
$name = $item->getName();
|
28 |
+
$sku = $item->getSku();
|
29 |
+
$price = $item->getPrice();
|
30 |
+
$description = $item->getDescription();
|
31 |
+
$product_type = $item->getProductType();
|
32 |
+
$line_items = array_merge($line_items, array(array(
|
33 |
+
'name' => $name,
|
34 |
+
'sku' => $sku,
|
35 |
+
'unit_price' => $price,
|
36 |
+
'description' =>$description,
|
37 |
+
'quantity' => 1,
|
38 |
+
'type' => $product_type
|
39 |
+
))
|
40 |
+
);
|
41 |
+
$i = $i + 1;
|
42 |
+
}
|
43 |
+
$shipp = array();
|
44 |
+
if (empty($shipping_data) != true) {
|
45 |
+
$shipp = array(
|
46 |
+
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
47 |
+
'service' => $order->getShippingMethod(),
|
48 |
+
'carrier' => $order->getShippingDescription(),
|
49 |
+
'address' => array(
|
50 |
+
'street1' => $shipping_data['street'],
|
51 |
+
'city' => $shipping_data['city'],
|
52 |
+
'state' => $shipping_data['region'],
|
53 |
+
'country' => $shipping_data['country_id'],
|
54 |
+
'zip' => $shipping_data['postcode'],
|
55 |
+
'phone' =>$shipping_data['telephone'],
|
56 |
+
'email' =>$email
|
57 |
+
)
|
58 |
+
);
|
59 |
+
}
|
60 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
61 |
+
try {
|
62 |
+
$charge = Conekta_Charge::create(array(
|
63 |
+
'bank'=>array(
|
64 |
+
'type'=>'spei'
|
65 |
+
),
|
66 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
67 |
+
'amount' => intval(((float) $order->grandTotal) * 100),
|
68 |
+
'description' => 'Compra en Magento',
|
69 |
+
'reference_id' => $order->getIncrementId(),
|
70 |
+
'details' => array(
|
71 |
+
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['firstname']),
|
72 |
+
'email' => $email,
|
73 |
+
'phone' => $billing['telephone'],
|
74 |
+
'billing_address' => array(
|
75 |
+
'company_name' => $billing['company'],
|
76 |
+
'street1' => $billing['street'],
|
77 |
+
'city' =>$billing['city'],
|
78 |
+
'state' =>$billing['region'],
|
79 |
+
'country' =>$billing['country_id'],
|
80 |
+
'zip' =>$billing['postcode'],
|
81 |
+
'phone' =>$billing['telephone'],
|
82 |
+
'email' =>$email
|
83 |
+
),
|
84 |
+
'line_items' => $line_items,
|
85 |
+
'shipment' => $shipp
|
86 |
+
),
|
87 |
+
'coupon_code' => $order->getCouponCode(),
|
88 |
+
'custom_fields' => array(
|
89 |
+
'customer' => array(
|
90 |
+
'website_id' => $customer->getWebsiteId(),
|
91 |
+
'entity_id' => $customer->getEntityId(),
|
92 |
+
'entity_type_id' => $customer->getEntityTypeId(),
|
93 |
+
'attribute_set_id' => $customer->getAttributeSetId(),
|
94 |
+
'email' => $customer->getEmail(),
|
95 |
+
'group_id' => $customer->getGroupId(),
|
96 |
+
'store_id' => $customer->getStoreId(),
|
97 |
+
'created_at' => $customer->getCreatedAt(),
|
98 |
+
'updated_at' => $customer->getUpdatedAt(),
|
99 |
+
'is_active' => $customer->getIsActive(),
|
100 |
+
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
101 |
+
'get_tax_vat' => $customer->getTaxvat(),
|
102 |
+
'created_in' => $customer->getCreatedIn(),
|
103 |
+
'gender' => $customer->getGender(),
|
104 |
+
'default_billing' => $customer->getDefaultBilling(),
|
105 |
+
'default_shipping' => $customer->getDefaultShipping(),
|
106 |
+
'dob' => $customer->getDob(),
|
107 |
+
'tax_class_id' => $customer->getTaxClassId()
|
108 |
+
),
|
109 |
+
'discount_description' => $order->getDiscountDescription(),
|
110 |
+
'discount_amount' => $order->getDiscountAmount(),
|
111 |
+
'shipping_amount' => $shipping_address->getShippingAmount(),
|
112 |
+
'shipping_description' => $shipping_address->getShippingDescription(),
|
113 |
+
'shipping_method' => $shipping_address->getShippingMethod()
|
114 |
+
)
|
115 |
+
)
|
116 |
+
);
|
117 |
+
} catch (Conekta_Error $e){
|
118 |
+
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
119 |
+
}
|
120 |
+
$event->payment->setSpeiClabe($charge->payment_method->clabe);
|
121 |
+
$event->payment->setSpeiBank($charge->payment_method->bank);
|
122 |
+
$event->payment->setChargeId($charge->id);
|
123 |
+
//Update Quote
|
124 |
+
$order = $order;
|
125 |
+
$quote = $order->getQuote();
|
126 |
+
$payment = $quote->getPayment();
|
127 |
+
$payment->setSpeiClabe($charge->payment_method->clabe);
|
128 |
+
$payment->setSpeiBank($charge->payment_method->bank);
|
129 |
+
$payment->setChargeId($charge->id);
|
130 |
+
$quote->collectTotals();
|
131 |
+
$quote->save();
|
132 |
+
$order->setQuote($quote);
|
133 |
+
$order->save();
|
134 |
+
}
|
135 |
+
return $event;
|
136 |
+
}
|
137 |
+
}
|
app/code/community/Conekta/Spei/Model/Spei.php
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Spei_Model_Spei extends Mage_Payment_Model_Method_Abstract
|
3 |
+
{
|
4 |
+
protected $_code = 'spei';
|
5 |
+
protected $_formBlockType = 'spei/form_spei';
|
6 |
+
protected $_infoBlockType = 'spei/info_spei';
|
7 |
+
|
8 |
+
public function assignData($data)
|
9 |
+
{
|
10 |
+
if (!($data instanceof Varien_Object)) {
|
11 |
+
$data = new Varien_Object($data);
|
12 |
+
}
|
13 |
+
$info = $this->getInfoInstance();
|
14 |
+
$info->setSpeiClabe($data->getSpeiClabe())
|
15 |
+
->setSpeiBank($data->getSpeiBank())
|
16 |
+
;
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
21 |
+
?>
|
app/code/community/Conekta/Spei/etc/config.xml
ADDED
@@ -0,0 +1,128 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Spei>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Spei>
|
7 |
+
</modules>
|
8 |
+
<adminhtml>
|
9 |
+
<translate>
|
10 |
+
<modules>
|
11 |
+
<Conekta_Card>
|
12 |
+
<files>
|
13 |
+
<default>Conekta_Card.csv</default>
|
14 |
+
</files>
|
15 |
+
</Conekta_Card>
|
16 |
+
</modules>
|
17 |
+
</translate>
|
18 |
+
</adminhtml>
|
19 |
+
<frontend>
|
20 |
+
<translate>
|
21 |
+
<modules>
|
22 |
+
<Conekta_Card>
|
23 |
+
<files>
|
24 |
+
<default>Conekta_Spei.csv</default>
|
25 |
+
</files>
|
26 |
+
</Conekta_Card>
|
27 |
+
</modules>
|
28 |
+
</translate>
|
29 |
+
<routers>
|
30 |
+
<spei>
|
31 |
+
<use>standard</use>
|
32 |
+
<args>
|
33 |
+
<module>Conekta_Spei</module>
|
34 |
+
<frontName>spei</frontName>
|
35 |
+
</args>
|
36 |
+
</spei>
|
37 |
+
</routers>
|
38 |
+
<layout>
|
39 |
+
<updates>
|
40 |
+
<spei>
|
41 |
+
<file>spei.xml</file>
|
42 |
+
</spei>
|
43 |
+
</updates>
|
44 |
+
</layout>
|
45 |
+
</frontend>
|
46 |
+
<global>
|
47 |
+
<events>
|
48 |
+
<sales_order_payment_place_start>
|
49 |
+
<observers>
|
50 |
+
<spei>
|
51 |
+
<class>spei/observer</class>
|
52 |
+
<method>processPayment</method>
|
53 |
+
</spei>
|
54 |
+
</observers>
|
55 |
+
</sales_order_payment_place_start>
|
56 |
+
</events>
|
57 |
+
<fieldsets>
|
58 |
+
<sales_convert_quote_payment>
|
59 |
+
<spei_clabe>
|
60 |
+
<to_order_payment>*</to_order_payment>
|
61 |
+
</spei_clabe>
|
62 |
+
<spei_expiry_date>
|
63 |
+
<to_order_payment>*</to_order_payment>
|
64 |
+
</spei_expiry_date>
|
65 |
+
<charge_id>
|
66 |
+
<to_order_payment>*</to_order_payment>
|
67 |
+
</charge_id>
|
68 |
+
</sales_convert_quote_payment>
|
69 |
+
</fieldsets>
|
70 |
+
<models>
|
71 |
+
<spei>
|
72 |
+
<class>Conekta_Spei_Model</class>
|
73 |
+
<resourceModel>spei_mysql4</resourceModel>
|
74 |
+
</spei>
|
75 |
+
<spei_mysql4>
|
76 |
+
<class>Conekta_Spei_Model_Mysql4</class>
|
77 |
+
<entities>
|
78 |
+
<spei>
|
79 |
+
<table>spei</table>
|
80 |
+
</spei>
|
81 |
+
</entities>
|
82 |
+
</spei_mysql4>
|
83 |
+
</models>
|
84 |
+
<resources>
|
85 |
+
<spei_setup>
|
86 |
+
<setup>
|
87 |
+
<module>Conekta_Spei</module>
|
88 |
+
</setup>
|
89 |
+
<connection>
|
90 |
+
<use>core_setup</use>
|
91 |
+
</connection>
|
92 |
+
</spei_setup>
|
93 |
+
<spei_write>
|
94 |
+
<connection>
|
95 |
+
<use>core_write</use>
|
96 |
+
</connection>
|
97 |
+
</spei_write>
|
98 |
+
<spei_read>
|
99 |
+
<connection>
|
100 |
+
<use>core_read</use>
|
101 |
+
</connection>
|
102 |
+
</spei_read>
|
103 |
+
</resources>
|
104 |
+
<blocks>
|
105 |
+
<spei>
|
106 |
+
<class>Conekta_Spei_Block</class>
|
107 |
+
</spei>
|
108 |
+
</blocks>
|
109 |
+
<helpers>
|
110 |
+
<spei>
|
111 |
+
<class>Conekta_Spei_Helper</class>
|
112 |
+
</spei>
|
113 |
+
</helpers>
|
114 |
+
</global>
|
115 |
+
<default>
|
116 |
+
<payment>
|
117 |
+
<spei>
|
118 |
+
<active>1</active>
|
119 |
+
<model>spei/spei</model>
|
120 |
+
<order_status>pending</order_status>
|
121 |
+
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
122 |
+
<expiry_date></expiry_date>
|
123 |
+
<title>Spei Payment Method</title>
|
124 |
+
<sort_order>0</sort_order>
|
125 |
+
</spei>
|
126 |
+
</payment>
|
127 |
+
</default>
|
128 |
+
</config>
|
app/code/community/Conekta/Spei/etc/system.xml
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<spei translate="label" module="spei">
|
7 |
+
<label>Conekta Spei Payment Module</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>5</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<sort_order translate="label">
|
15 |
+
<label>Sort Order</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<sort_order>0</sort_order>
|
18 |
+
<show_in_default>1</show_in_default>
|
19 |
+
<show_in_website>1</show_in_website>
|
20 |
+
<show_in_store>1</show_in_store>
|
21 |
+
<frontend_class>validate-number</frontend_class>
|
22 |
+
</sort_order>
|
23 |
+
<active translate="label">
|
24 |
+
<label>Enabled</label>
|
25 |
+
<frontend_type>select</frontend_type>
|
26 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
+
<sort_order>1</sort_order>
|
28 |
+
<show_in_default>1</show_in_default>
|
29 |
+
<show_in_website>1</show_in_website>
|
30 |
+
<show_in_store>0</show_in_store>
|
31 |
+
</active>
|
32 |
+
<order_status translate="label">
|
33 |
+
<label>New order status</label>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
+
<sort_order>2</sort_order>
|
37 |
+
<show_in_default>1</show_in_default>
|
38 |
+
<show_in_website>1</show_in_website>
|
39 |
+
<show_in_store>0</show_in_store>
|
40 |
+
</order_status>
|
41 |
+
<webhook_notification_order_status translate="label">
|
42 |
+
<label>Order status when Conekta sends payment notification</label>
|
43 |
+
<frontend_type>select</frontend_type>
|
44 |
+
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
+
<sort_order>3</sort_order>
|
46 |
+
<show_in_default>1</show_in_default>
|
47 |
+
<show_in_website>1</show_in_website>
|
48 |
+
<show_in_store>0</show_in_store>
|
49 |
+
</webhook_notification_order_status>
|
50 |
+
<my_date translate="label comment">
|
51 |
+
<label>Expiry (# days)</label>
|
52 |
+
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
53 |
+
<frontend_model>spei/adminhtml_system_config_days</frontend_model> <!-- Specify our custom model -->
|
54 |
+
<sort_order>4</sort_order>
|
55 |
+
<show_in_default>1</show_in_default>
|
56 |
+
<show_in_website>1</show_in_website>
|
57 |
+
<show_in_store>1</show_in_store>
|
58 |
+
<comment>Set the expiry of this offline payment</comment>
|
59 |
+
</my_date>
|
60 |
+
<title translate="label">
|
61 |
+
<label>Title</label>
|
62 |
+
<frontend_type>text</frontend_type>
|
63 |
+
<sort_order>5</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>0</show_in_store>
|
67 |
+
</title>
|
68 |
+
</fields>
|
69 |
+
</spei>
|
70 |
+
</groups>
|
71 |
+
</payment>
|
72 |
+
</sections>
|
73 |
+
</config>
|
app/code/community/Conekta/Spei/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Spei/sql/spei_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,39 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
|
9 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
+
'length' => '255',
|
12 |
+
'comment' => 'Charge Id'
|
13 |
+
));
|
14 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
+
'length' => '255',
|
17 |
+
'comment' => 'Card Id'
|
18 |
+
));
|
19 |
+
|
20 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'spei_expiry_date', array(
|
21 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
22 |
+
'comment' => 'Spei Expiry Date'
|
23 |
+
));
|
24 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'spei_expiry_date', array(
|
25 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
26 |
+
'comment' => 'Spei Expiry Date'
|
27 |
+
));
|
28 |
+
|
29 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'spei_clabe', array(
|
30 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
31 |
+
'length' => '255',
|
32 |
+
'comment' => 'Spei Barcode URL'
|
33 |
+
));
|
34 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'spei_clabe', array(
|
35 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
36 |
+
'length' => '255',
|
37 |
+
'comment' => 'Spei Barcode URL'
|
38 |
+
));
|
39 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.2.5-0.2.6.php
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
$connection->addColumn($installer->getTable('sales/quote_payment'), 'spei_bank', array(
|
9 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
10 |
+
'length' => '255',
|
11 |
+
'comment' => 'Spei Bank'
|
12 |
+
));
|
13 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'oxxo_bank', array(
|
14 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
15 |
+
'length' => '255',
|
16 |
+
'comment' => 'Spei Bank'
|
17 |
+
));
|
18 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.2.6-0.3.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.0-0.3.1.php
ADDED
@@ -0,0 +1,19 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$connection = $installer->getConnection();
|
8 |
+
$connection->addColumn($installer->getTable('sales/order_payment'), 'spei_bank', array(
|
9 |
+
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
10 |
+
'length' => '255',
|
11 |
+
'comment' => 'Spei Bank'
|
12 |
+
));
|
13 |
+
|
14 |
+
$connection->dropColumn($installer->getTable('sales/order_payment'), 'oxxo_bank');
|
15 |
+
$connection->dropColumn($installer->getTable('sales/quote_payment'), 'spei_expiry_date');
|
16 |
+
$connection->dropColumn($installer->getTable('sales/order_payment'), 'spei_expiry_date');
|
17 |
+
|
18 |
+
|
19 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.1-0.3.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.2-0.3.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.3-0.3.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.7-0.3.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.8-0.3.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.3.9-0.4.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.0-0.4.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.1-0.4.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.2-0.4.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.3-0.4.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.4-0.4.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.5-0.4.6.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.6-0.4.7.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.7-0.4.8.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.8-0.4.9.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.4.9-0.5.0.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.0-0.5.1.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.1-0.5.2.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.2-0.5.3.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.3-0.5.4.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Spei/sql/spei_setup/mysql4-upgrade-0.5.4-0.5.5.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
+
$installer->startSetup();
|
5 |
+
$installer->endSetup();
|
app/code/community/Conekta/Webhook/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Webhook/Block/Adminhtml/Sales/Order/View/Tab/Info.php
ADDED
@@ -0,0 +1,18 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Webhook_Block_Adminhtml_Sales_Order_View_Tab_Info extends Mage_Adminhtml_Block_Sales_Order_View_Tab_Info
|
3 |
+
{
|
4 |
+
public function getPaymentHtml()
|
5 |
+
{
|
6 |
+
$_order = $this->getOrder();
|
7 |
+
$_payment = $_order->getPayment();
|
8 |
+
$_method = $_payment->getMethod();
|
9 |
+
if ($_method == "oxxo" || $_method == "card" || $_method == "bank" || $_method == "spei" || $_method == "realtime") {
|
10 |
+
$charge_id = $_payment->getChargeId();
|
11 |
+
$grandTotal = Mage::helper('core')->currency($_order->grandTotal, true, true);
|
12 |
+
$html = "<p>". $this->__("Order was placed using Conekta %s", strtoupper($_method)) ."</p>" .
|
13 |
+
"<p>". $this->__("Order amount %s", $grandTotal) ."</p>" .
|
14 |
+
"<p>". $this->__("Conekta Id %s", $charge_id) ."</p>";
|
15 |
+
return $html;
|
16 |
+
}
|
17 |
+
}
|
18 |
+
}
|
app/code/community/Conekta/Webhook/Block/Adminhtml/System/Config/Url.php
ADDED
@@ -0,0 +1,76 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
+
class Conekta_Webhook_Block_Adminhtml_System_Config_Url extends Mage_Adminhtml_Block_System_Config_Form_Field
|
4 |
+
{
|
5 |
+
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
6 |
+
{
|
7 |
+
if (!class_exists('Conekta')) {
|
8 |
+
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
9 |
+
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
10 |
+
}
|
11 |
+
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
12 |
+
Conekta::setApiVersion("1.0.0");
|
13 |
+
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
14 |
+
|
15 |
+
$url = new Varien_Data_Form_Element_Text;
|
16 |
+
$data = array(
|
17 |
+
'name' => $element->getName(),
|
18 |
+
'html_id' => $element->getId()
|
19 |
+
);
|
20 |
+
$url->setData($data);
|
21 |
+
$webhook_url = Mage::getBaseUrl() . "index.php/webhook/ajax/listener";
|
22 |
+
|
23 |
+
$elementValue = $element->getValue();
|
24 |
+
if (!empty($elementValue)) {
|
25 |
+
$url_string = $element->getValue();
|
26 |
+
} else {
|
27 |
+
$url_string = $webhook_url;
|
28 |
+
}
|
29 |
+
|
30 |
+
$url->setValue($url_string);
|
31 |
+
|
32 |
+
$events = array("events" =>
|
33 |
+
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
34 |
+
"charge.fraudulent", "charge.refunded", "charge.created", "customer.created",
|
35 |
+
"customer.updated", "customer.deleted", "webhook.created", "webhook.updated",
|
36 |
+
"webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated",
|
37 |
+
"charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won",
|
38 |
+
"payout.created", "payout.retrying", "payout.paid_out", "payout.failed",
|
39 |
+
"plan.created", "plan.updated", "plan.deleted", "subscription.created",
|
40 |
+
"subscription.paused", "subscription.resumed", "subscription.canceled",
|
41 |
+
"subscription.expired", "subscription.updated", "subscription.paid",
|
42 |
+
"subscription.payment_failed", "payee.created", "payee.updated",
|
43 |
+
"payee.deleted", "payee.payout_method.created",
|
44 |
+
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
45 |
+
$error = false;
|
46 |
+
$error_message = null;
|
47 |
+
try {
|
48 |
+
$different = true;
|
49 |
+
$webhooks = Conekta_Webhook::where();
|
50 |
+
foreach ($webhooks as $webhook) {
|
51 |
+
if (strpos($webhook->webhook_url, $url_string) !== false) {
|
52 |
+
$different = false;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
if ($different) {
|
56 |
+
$webhook = Conekta_Webhook::create(array_merge(array("url"=>$url_string), $events));
|
57 |
+
}
|
58 |
+
} catch(Exception $e) {
|
59 |
+
$error = true;
|
60 |
+
$error_message = $e->getMessage();
|
61 |
+
}
|
62 |
+
|
63 |
+
$url->setForm($element->getForm());
|
64 |
+
$html = $url->getElementHtml();
|
65 |
+
$javaScript = "
|
66 |
+
<script type=\"text/javascript\">
|
67 |
+
Event.observe(window, 'load', function() {
|
68 |
+
alert('". $error_message ."');
|
69 |
+
});
|
70 |
+
</script>";
|
71 |
+
if($error) {
|
72 |
+
$html .= $javaScript;
|
73 |
+
}
|
74 |
+
return $html;
|
75 |
+
}
|
76 |
+
}
|
app/code/community/Conekta/Webhook/Helper/Data.php
ADDED
@@ -0,0 +1,6 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Webhook_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
}
|
app/code/community/Conekta/Webhook/controllers/AjaxController.php
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
class Conekta_Webhook_AjaxController extends Mage_Core_Controller_Front_Action {
|
3 |
+
public function listenerAction() {
|
4 |
+
$body = @file_get_contents('php://input');
|
5 |
+
$event = json_decode($body);
|
6 |
+
$charge = $event->data->object;
|
7 |
+
$line_items = $charge->details->line_items;
|
8 |
+
sleep(3);
|
9 |
+
// search order by charge_id
|
10 |
+
$charge_id = $charge->id;
|
11 |
+
// check charge_id format
|
12 |
+
$charge_id_matches_format = preg_match('/^[a-z_\-0-9]+$/i', $charge_id);
|
13 |
+
if ($charge_id_matches_format) {
|
14 |
+
$resource = Mage::getSingleton('core/resource');
|
15 |
+
$readConnection = $resource->getConnection('core_read');
|
16 |
+
$query = "SELECT parent_id FROM " . $resource->getTableName('sales/order_payment') . " WHERE charge_id = '" . $charge_id . "' LIMIT 1";
|
17 |
+
$entity_id = $readConnection->fetchOne($query);
|
18 |
+
}
|
19 |
+
// check charge_id format
|
20 |
+
|
21 |
+
// check entity_id format
|
22 |
+
$entity_id_matches_format = preg_match('/^[0-9]+$/i', $entity_id);
|
23 |
+
if ($entity_id_matches_format) {
|
24 |
+
$query = 'SELECT increment_id FROM ' . $resource->getTableName('sales/order') . " WHERE entity_id = '" . $entity_id . "' LIMIT 1";
|
25 |
+
$increment_id = $readConnection->fetchOne($query);
|
26 |
+
$order = Mage::getModel('sales/order')->loadByIncrementId($increment_id);
|
27 |
+
}
|
28 |
+
// check entity_id format
|
29 |
+
if ($charge_id_matches_format && $entity_id_matches_format && strpos($event->type, "charge.paid") !== false && $order->getId()) {
|
30 |
+
if ($order->hasInvoices() != true) {
|
31 |
+
$invoice = $order->prepareInvoice();
|
32 |
+
$invoice->register();
|
33 |
+
Mage::getModel('core/resource_transaction')
|
34 |
+
->addObject($invoice)
|
35 |
+
->addObject($invoice->getOrder())
|
36 |
+
->save();
|
37 |
+
$invoice->sendEmail(true, '');
|
38 |
+
}
|
39 |
+
$orderStatus = $order->getPayment()->getMethodInstance()->getConfigData('webhook_notification_order_status');
|
40 |
+
if (!(strpos($order->getStatus(), $orderStatus) !== false)) {
|
41 |
+
$order->addStatusToHistory($orderStatus);
|
42 |
+
$order->setData('state', $orderStatus);
|
43 |
+
$order->save();
|
44 |
+
}
|
45 |
+
} else {
|
46 |
+
if (strpos($event->type, "charge.paid") !== false) {
|
47 |
+
// Order possible has not been persisted yet. Tell Conekta to retry one hour later.
|
48 |
+
header('HTTP/1.0 404 Not Found');
|
49 |
+
$this->getResponse()->setHeader('HTTP/1.1','404 Not Found');
|
50 |
+
$this->getResponse()->setHeader('Status','404 File not found');
|
51 |
+
$this->_forward('defaultNoRoute');
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
}
|
56 |
+
?>
|
app/code/community/Conekta/Webhook/etc/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Webhook/etc/config.xml
ADDED
@@ -0,0 +1,43 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Webhook>
|
5 |
+
<version>0.5.5</version>
|
6 |
+
</Conekta_Webhook>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<webhook>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>Conekta_Webhook</module>
|
14 |
+
<frontName>webhook</frontName>
|
15 |
+
</args>
|
16 |
+
</webhook>
|
17 |
+
</routers>
|
18 |
+
</frontend>
|
19 |
+
<global>
|
20 |
+
<blocks>
|
21 |
+
<webhook>
|
22 |
+
<class>Conekta_Webhook_Block</class>
|
23 |
+
</webhook>
|
24 |
+
<adminhtml>
|
25 |
+
<rewrite>
|
26 |
+
<sales_order_view_tab_info>Conekta_Webhook_Block_Adminhtml_Sales_Order_View_Tab_Info</sales_order_view_tab_info>
|
27 |
+
</rewrite>
|
28 |
+
</adminhtml>
|
29 |
+
</blocks>
|
30 |
+
<helpers>
|
31 |
+
<webhook>
|
32 |
+
<class>Conekta_Webhook_Helper</class>
|
33 |
+
</webhook>
|
34 |
+
</helpers>
|
35 |
+
</global>
|
36 |
+
<default>
|
37 |
+
<payment>
|
38 |
+
<webhook>
|
39 |
+
<url>http://mymagento-store.com/index.php/webhook/ajax/listener</url>
|
40 |
+
</webhook>
|
41 |
+
</payment>
|
42 |
+
</default>
|
43 |
+
</config>
|
app/code/community/Conekta/Webhook/etc/system.xml
ADDED
@@ -0,0 +1,44 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<sections>
|
4 |
+
<payment>
|
5 |
+
<groups>
|
6 |
+
<webhook translate="label" module="webhook">
|
7 |
+
<label>Conekta Account Configuration</label>
|
8 |
+
<frontend_type>text</frontend_type>
|
9 |
+
<sort_order>0</sort_order>
|
10 |
+
<show_in_default>1</show_in_default>
|
11 |
+
<show_in_website>1</show_in_website>
|
12 |
+
<show_in_store>1</show_in_store>
|
13 |
+
<fields>
|
14 |
+
<url translate="label">
|
15 |
+
<label>URL</label>
|
16 |
+
<frontend_type>text</frontend_type>
|
17 |
+
<frontend_model>webhook/adminhtml_system_config_url</frontend_model>
|
18 |
+
<sort_order>1</sort_order>
|
19 |
+
<show_in_default>1</show_in_default>
|
20 |
+
<show_in_website>1</show_in_website>
|
21 |
+
<show_in_store>0</show_in_store>
|
22 |
+
</url>
|
23 |
+
<privatekey translate="label">
|
24 |
+
<label>Private Key</label>
|
25 |
+
<frontend_type>text</frontend_type>
|
26 |
+
<sort_order>6</sort_order>
|
27 |
+
<show_in_default>1</show_in_default>
|
28 |
+
<show_in_website>1</show_in_website>
|
29 |
+
<show_in_store>1</show_in_store>
|
30 |
+
</privatekey>
|
31 |
+
<publickey translate="label">
|
32 |
+
<label>Public Key</label>
|
33 |
+
<frontend_type>text</frontend_type>
|
34 |
+
<sort_order>7</sort_order>
|
35 |
+
<show_in_default>1</show_in_default>
|
36 |
+
<show_in_website>1</show_in_website>
|
37 |
+
<show_in_store>1</show_in_store>
|
38 |
+
</publickey>
|
39 |
+
</fields>
|
40 |
+
</webhook>
|
41 |
+
</groups>
|
42 |
+
</payment>
|
43 |
+
</sections>
|
44 |
+
</config>
|
app/design/frontend/base/default/layout/card.xml
ADDED
@@ -0,0 +1,50 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="core/text" name="conekta">
|
6 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
</default>
|
10 |
+
<card_index_index>
|
11 |
+
<reference name="head">
|
12 |
+
<block type="core/text" name="conekta">
|
13 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
14 |
+
</block>
|
15 |
+
</reference>
|
16 |
+
<reference name="content">
|
17 |
+
<block type="card/card" name="card" template="card/card.phtml" />
|
18 |
+
</reference>
|
19 |
+
</card_index_index>
|
20 |
+
<checkout_onepage_index>
|
21 |
+
<reference name="head">
|
22 |
+
<block type="core/text" name="conekta">
|
23 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
24 |
+
</block>
|
25 |
+
</reference>
|
26 |
+
<reference name="before_body_end">
|
27 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
28 |
+
</reference>
|
29 |
+
</checkout_onepage_index>
|
30 |
+
<opc_index_index translate="label">
|
31 |
+
<reference name="head">
|
32 |
+
<block type="core/text" name="conekta">
|
33 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
34 |
+
</block>
|
35 |
+
</reference>
|
36 |
+
<reference name="before_body_end">
|
37 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
38 |
+
</reference>
|
39 |
+
</opc_index_index>
|
40 |
+
<onestepcheckout_index_index>
|
41 |
+
<reference name="head">
|
42 |
+
<block type="core/text" name="conekta">
|
43 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
44 |
+
</block>
|
45 |
+
</reference>
|
46 |
+
<reference name="before_body_end">
|
47 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
48 |
+
</reference>
|
49 |
+
</onestepcheckout_index_index>
|
50 |
+
</layout>
|
app/design/frontend/base/default/layout/oxxo.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<oxxo_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="oxxo/oxxo" name="oxxo" template="oxxo/oxxo.phtml" />
|
8 |
+
</reference>
|
9 |
+
</oxxo_index_index>
|
10 |
+
</layout>
|
app/design/frontend/base/default/layout/realtime.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<realtime_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="realtime/realtime" name="realtime" template="realtime/realtime.phtml" />
|
8 |
+
</reference>
|
9 |
+
</realtime_index_index>
|
10 |
+
</layout>
|
app/design/frontend/base/default/layout/spei.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<spei_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="spei/spei" name="spei" template="spei/spei.phtml" />
|
8 |
+
</reference>
|
9 |
+
</spei_index_index>
|
10 |
+
</layout>
|
app/design/frontend/base/default/template/card/form/card.phtml
ADDED
@@ -0,0 +1,127 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
28 |
+
<script>
|
29 |
+
Conekta.setPublishableKey('<?php echo Mage::getStoreConfig('payment/webhook/publickey');?>');
|
30 |
+
</script>
|
31 |
+
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
32 |
+
<input id="<?php echo $_code ?>_card_token" name="payment[conekta_token]" type="hidden" value="">
|
33 |
+
<input id="<?php echo $_code ?>_card_bin" name="card[bin]" type="hidden" value="">
|
34 |
+
<?php $amount_installments = floatval(Mage::getStoreConfig('payment/card/amount_installments')); ?>
|
35 |
+
|
36 |
+
<?php $activate_installments_3 = Mage::getStoreConfig('payment/card/activate_installments_3'); ?>
|
37 |
+
<?php $activate_installments_6 = Mage::getStoreConfig('payment/card/activate_installments_6'); ?>
|
38 |
+
<?php $activate_installments_9 = Mage::getStoreConfig('payment/card/activate_installments_9'); ?>
|
39 |
+
<?php $activate_installments_12 = Mage::getStoreConfig('payment/card/activate_installments_12'); ?>
|
40 |
+
|
41 |
+
<?php $amount = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal(); ?>
|
42 |
+
|
43 |
+
<?php if ($amount_installments <= $amount && ($activate_installments_3 || $activate_installments_6 || $activate_installments_9 || $activate_installments_12)) { ?>
|
44 |
+
<li>
|
45 |
+
<label for="<?php echo $_code ?>_monthly_installments" class="required"><em>*</em><?php echo $this->__('Monthly Intallments') ?></label>
|
46 |
+
<select id="<?php echo $_code ?>_card_monthly_installments" name="payment[monthly_installments]" class="required-entry">
|
47 |
+
<option selected="selected" value="0"><?php echo $this->__('1 Installment Charge') ?></option>
|
48 |
+
<?php if ($activate_installments_3) {?>
|
49 |
+
<option value="3"><?php echo $this->__('3 Installment Charge') ?></option>
|
50 |
+
<?php } ?>
|
51 |
+
<?php if ($activate_installments_6) {?>
|
52 |
+
<option value="6"><?php echo $this->__('6 Installment Charge') ?></option>
|
53 |
+
<?php } ?>
|
54 |
+
<?php if ($activate_installments_9) {?>
|
55 |
+
<option value="9"><?php echo $this->__('9 Installment Charge') ?></option>
|
56 |
+
<?php } ?>
|
57 |
+
<?php if ($activate_installments_12) {?>
|
58 |
+
<option value="12"><?php echo $this->__('12 Installment Charge') ?></option>
|
59 |
+
<?php } ?>
|
60 |
+
</select>
|
61 |
+
</li>
|
62 |
+
<?php } else { ?>
|
63 |
+
<input id="<?php echo $_code ?>_monthly_installments" name="payment[monthly_installments]" type="hidden" value="0">
|
64 |
+
<?php } ?>
|
65 |
+
<li>
|
66 |
+
<div class="input-box">
|
67 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
68 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" data-conekta="card[name]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
|
69 |
+
</div>
|
70 |
+
</li>
|
71 |
+
<li>
|
72 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
73 |
+
<div class="input-box">
|
74 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" data-conekta="card[number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type required-entry" value="" />
|
75 |
+
</div>
|
76 |
+
</li>
|
77 |
+
<li id="<?php echo $_code ?>_cc_type_exp_div">
|
78 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
79 |
+
<div class="input-box">
|
80 |
+
<div class="v-fix">
|
81 |
+
<select id="<?php echo $_code ?>_expiration" data-conekta="card[exp_month]" class="month validate-cc-exp required-entry">
|
82 |
+
<option selected="selected" value=""><?php echo $this->__('Month') ?></option>
|
83 |
+
<option value="1">01 - January</option>
|
84 |
+
<option value="2">02 - February</option>
|
85 |
+
<option value="3">03 - March</option>
|
86 |
+
<option value="4">04 - April</option>
|
87 |
+
<option value="5">05 - May</option>
|
88 |
+
<option value="6">06 - June</option>
|
89 |
+
<option value="7">07 - July</option>
|
90 |
+
<option value="8">08 - August</option>
|
91 |
+
<option value="9">09 - September</option>
|
92 |
+
<option value="10">10 - October</option>
|
93 |
+
<option value="11">11 - November</option>
|
94 |
+
<option value="12">12 - December</option>
|
95 |
+
</select>
|
96 |
+
</div>
|
97 |
+
<div class="v-fix">
|
98 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
+
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
+
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
101 |
+
<option value="2014">2014</option>
|
102 |
+
<option value="2015">2015</option>
|
103 |
+
<option value="2016">2016</option>
|
104 |
+
<option value="2017">2017</option>
|
105 |
+
<option value="2018">2018</option>
|
106 |
+
<option value="2019">2019</option>
|
107 |
+
<option value="2020">2020</option>
|
108 |
+
<option value="2021">2021</option>
|
109 |
+
<option value="2022">2022</option>
|
110 |
+
<option value="2023">2023</option>
|
111 |
+
<option value="2024">2024</option>
|
112 |
+
<option value="2025">2025</option>
|
113 |
+
</select>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
</li>
|
117 |
+
<?php echo $this->getChildHtml() ?>
|
118 |
+
<li id="<?php echo $_code ?>_cc_type_cvv_div">
|
119 |
+
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
120 |
+
<div class="input-box">
|
121 |
+
<div class="v-fix">
|
122 |
+
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" data-conekta="card[cvc]" value="" />
|
123 |
+
</div>
|
124 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
125 |
+
</div>
|
126 |
+
</li>
|
127 |
+
</ul>
|
app/design/frontend/base/default/template/card/info/card.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$authNumber = $this->getInfo()->getChargeAuthorization();
|
34 |
+
$owner = $this->getInfo()->getCcOwner();
|
35 |
+
$card = $this->getInfo()->getCcLast4();
|
36 |
+
?>
|
37 |
+
|
38 |
+
<dl class="card">
|
39 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
40 |
+
<dd class="offset">
|
41 |
+
<table class="info-table">
|
42 |
+
<tbody>
|
43 |
+
<tr>
|
44 |
+
<?php if (empty($authNumber) != true) {?>
|
45 |
+
<th><?php echo $this->__('Cardholder Name: %s', $owner) ?></th>
|
46 |
+
<th><?php echo $this->__('Card Last 4: %s', $card) ?></th>
|
47 |
+
<th><?php echo $this->__('Authorization Number: %s', $authNumber) ?></th>
|
48 |
+
<?php } else { ?>
|
49 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
50 |
+
|
51 |
+
<?php } ?>
|
52 |
+
</tr>
|
53 |
+
</tbody>
|
54 |
+
</table>
|
55 |
+
</dd>
|
56 |
+
</dl>
|
app/design/frontend/base/default/template/card/token.phtml
ADDED
@@ -0,0 +1,138 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<script type="text/javascript">
|
2 |
+
//<![CDATA[
|
3 |
+
var oneStepForm = document.getElementById("onestepcheckout-form");
|
4 |
+
var processPayment = function() {
|
5 |
+
var currentMethod = (oneStepForm != null) ? payment.currentMethod : payment.lastUsedMethod;
|
6 |
+
if(currentMethod == 'card'){
|
7 |
+
if(_validateCard()) {
|
8 |
+
document.getElementById('card_expiration').setAttribute("data-conekta", "card[exp_month]");
|
9 |
+
document.getElementById('card_expiration_yr').setAttribute("data-conekta", "card[exp_year]");
|
10 |
+
var form = document.getElementById("payment_form_card");
|
11 |
+
Conekta.token.create(form, successResponseHandler, errorResponseHandler);
|
12 |
+
} else {
|
13 |
+
conektaTempSave();
|
14 |
+
}
|
15 |
+
} else {
|
16 |
+
conektaTempSave();
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
var successResponseHandler = function(response) {
|
21 |
+
document.getElementById('card_card_token').value = response.id;
|
22 |
+
if (window["IWD"] && IWD.OPC) {
|
23 |
+
conektaTempSave();
|
24 |
+
} else if (oneStepForm != null) {
|
25 |
+
conektaTempSave();
|
26 |
+
} else {
|
27 |
+
var request = new Ajax.Request(
|
28 |
+
payment.saveUrl,
|
29 |
+
{
|
30 |
+
method:'post',
|
31 |
+
onComplete: payment.onComplete,
|
32 |
+
onSuccess: payment.onSave,
|
33 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
34 |
+
parameters: Form.serialize(payment.form)
|
35 |
+
}
|
36 |
+
);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
var errorResponseHandler = function(response) {
|
41 |
+
alert(response.message);
|
42 |
+
if (window["IWD"] && IWD.OPC) {
|
43 |
+
IWD.OPC.Checkout.unlockPlaceOrder();
|
44 |
+
} else if (oneStepForm != null) {
|
45 |
+
already_placing_order = false;
|
46 |
+
var submitelement = $('onestepcheckout-place-order');
|
47 |
+
/* Disable button to avoid multiple clicks */
|
48 |
+
submitelement.removeClassName('grey').addClassName('orange');
|
49 |
+
submitelement.disabled = false;
|
50 |
+
submitelement.parentNode.lastChild.remove();
|
51 |
+
return false;
|
52 |
+
} else {
|
53 |
+
payment.resetLoadWaiting();
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
var _validateCard = function(){
|
58 |
+
var expMonth = document.getElementById('card_expiration').value;
|
59 |
+
var expYear = document.getElementById('card_expiration_yr').value;
|
60 |
+
var cardNumber = document.getElementById('card_cc_number').value;
|
61 |
+
var type = Conekta.card.getBrand(cardNumber);
|
62 |
+
document.getElementById('card_card_bin').value = cardNumber.substring(0,6);
|
63 |
+
return Conekta.card.validateNumber(cardNumber) && Conekta.card.validateExpirationDate(expMonth, expYear) && type != 'unknown';
|
64 |
+
}
|
65 |
+
|
66 |
+
if (window["IWD"] && IWD.OPC) {
|
67 |
+
var initSaveOrder = function() {
|
68 |
+
IWD.OPC.saveOrderStatus = true;
|
69 |
+
IWD.OPC.Plugin.dispatch('saveOrderBefore');
|
70 |
+
if (IWD.OPC.Checkout.isVirtual===false){
|
71 |
+
IWD.OPC.Checkout.lockPlaceOrder();
|
72 |
+
IWD.OPC.Shipping.saveShippingMethod();
|
73 |
+
}else{
|
74 |
+
IWD.OPC.validatePayment();
|
75 |
+
}
|
76 |
+
}
|
77 |
+
var conektaTempSave = function () {
|
78 |
+
initSaveOrder();
|
79 |
+
}
|
80 |
+
IWD.OPC.initSaveOrder = function() {
|
81 |
+
$j(document).on('click', '.opc-btn-checkout', function(){
|
82 |
+
if (IWD.OPC.Checkout.disabledSave==true){
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
var addressForm = new VarienForm('billing-new-address-form');
|
86 |
+
if (!addressForm.validator.validate()){
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
|
90 |
+
if (!$j('input[name="billing[use_for_shipping]"]').prop('checked')){
|
91 |
+
var addressForm = new VarienForm('opc-address-form-shipping');
|
92 |
+
if (!addressForm.validator.validate()){
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
processPayment();
|
97 |
+
});
|
98 |
+
}
|
99 |
+
} else if (oneStepForm != null) {
|
100 |
+
var conektaTempSave = function() {
|
101 |
+
var form = new VarienForm('onestepcheckout-form');
|
102 |
+
if(form.validator.validate()) {
|
103 |
+
/* Submit the form */
|
104 |
+
$('onestepcheckout-form').submit();
|
105 |
+
} else {
|
106 |
+
already_placing_order = false;
|
107 |
+
var submitelement = $('onestepcheckout-place-order');
|
108 |
+
/* Disable button to avoid multiple clicks */
|
109 |
+
submitelement.removeClassName('grey').addClassName('orange');
|
110 |
+
submitelement.disabled = false;
|
111 |
+
submitelement.parentNode.lastChild.remove();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$$('.onestepcheckout-place-order').each(function(elem){
|
115 |
+
elem.observe('click', function(e) {
|
116 |
+
already_placing_order = true;
|
117 |
+
var submitelement = $('onestepcheckout-place-order');
|
118 |
+
/* Disable button to avoid multiple clicks */
|
119 |
+
submitelement.removeClassName('orange').addClassName('grey');
|
120 |
+
submitelement.disabled = true;
|
121 |
+
var loaderelement = new Element('span').
|
122 |
+
addClassName('onestepcheckout-place-order-loading').
|
123 |
+
update('Please wait, processing your order...');
|
124 |
+
submitelement.parentNode.appendChild(loaderelement);
|
125 |
+
processPayment();
|
126 |
+
});
|
127 |
+
});
|
128 |
+
} else {
|
129 |
+
var conektaPaymentSave = payment.save;
|
130 |
+
var conektaTempSave = function () {
|
131 |
+
conektaPaymentSave.apply(payment);
|
132 |
+
}
|
133 |
+
payment.save = function(){
|
134 |
+
processPayment();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
//]]>
|
138 |
+
</script>
|
app/design/frontend/base/default/template/checkout/success.phtml
ADDED
@@ -0,0 +1,163 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$_order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
29 |
+
$_payment = $_order->getPayment();
|
30 |
+
$_method = $_payment->getMethod();
|
31 |
+
|
32 |
+
if ($_method == "card") {
|
33 |
+
$authNumber = $_payment->getChargeAuthorization();
|
34 |
+
$owner = $_payment->getCcOwner();
|
35 |
+
$card = $_payment->getCcLast4();
|
36 |
+
} else if ($_method == "bank") {
|
37 |
+
$service_number = $_payment->getBankServiceNumber();
|
38 |
+
$service_name = $_payment->getBankServiceName();
|
39 |
+
$bank_name = $_payment->getBankName();
|
40 |
+
$reference = $_payment->getBankReference();
|
41 |
+
$expiry = $_payment->getBankExpiryDate();
|
42 |
+
} else if ($_method == "realtime") {
|
43 |
+
$barcode = $_payment->getRealtimeBarcodeUrl();
|
44 |
+
$reference = $_payment->getRealtimeBarcode();
|
45 |
+
$expiry = $_payment->getRealtimeExpiryDate();
|
46 |
+
$store_name = $_payment->getRealtimeStoreName();
|
47 |
+
} else if ($_method == "spei") {
|
48 |
+
$clabe = $_payment->getSpeiClabe();
|
49 |
+
$bank = $_payment->getSpeiBank();
|
50 |
+
} else if ($_method == "oxxo") {
|
51 |
+
$reference = $_payment->getOxxoBarcode();
|
52 |
+
$barcode = $_payment->getOxxoBarcodeUrl();
|
53 |
+
$expiry = $_payment->getOxxoExpiryDate();
|
54 |
+
}
|
55 |
+
|
56 |
+
?>
|
57 |
+
<div class="page-title">
|
58 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
59 |
+
</div>
|
60 |
+
<?php echo $this->getMessagesBlock()->toHtml() ?>
|
61 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
62 |
+
|
63 |
+
<?php if ($this->getOrderId()):?>
|
64 |
+
<?php if ($this->getCanViewOrder()) :?>
|
65 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
66 |
+
<?php else :?>
|
67 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
68 |
+
<?php endif;?>
|
69 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
70 |
+
<p>
|
71 |
+
<dl>
|
72 |
+
<dt></dt>
|
73 |
+
<dd>
|
74 |
+
<table>
|
75 |
+
<tbody>
|
76 |
+
<tr>
|
77 |
+
<th><?php echo $this->__('Order details') ?></th>
|
78 |
+
</tr>
|
79 |
+
<tr>
|
80 |
+
<?php if ($_method == "card") {?>
|
81 |
+
<tr>
|
82 |
+
<td><?php echo $this->__('Cardholder Name: %s', $owner) ?></td>
|
83 |
+
</tr>
|
84 |
+
<tr>
|
85 |
+
<td><?php echo $this->__('Card Last 4: %s', $card) ?></td>
|
86 |
+
</tr>
|
87 |
+
<tr>
|
88 |
+
<td><?php echo $this->__('Authorization Number: %s', $authNumber) ?></td>
|
89 |
+
</tr>
|
90 |
+
<?php } else if ($_method == "oxxo") { ?>
|
91 |
+
<tr>
|
92 |
+
<td><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></td>
|
93 |
+
</tr>
|
94 |
+
<tr>
|
95 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
96 |
+
</tr>
|
97 |
+
<tr>
|
98 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
99 |
+
</tr>
|
100 |
+
<?php } else if ($_method == "bank") { ?>
|
101 |
+
<tr>
|
102 |
+
<td><?php echo $this->__('Service Name: %s', $service_name) ?></td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<td><?php echo $this->__('Service Number: %s', $service_number) ?></td>
|
106 |
+
</tr>
|
107 |
+
<tr>
|
108 |
+
<td><?php echo $this->__('Bank Name: %s', $bank_name) ?></td>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
112 |
+
</tr>
|
113 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
114 |
+
</tr>
|
115 |
+
<?php } else if ($_method == "spei") { ?>
|
116 |
+
<tr>
|
117 |
+
<td><?php echo $this->__('CLABE: %s', $clabe) ?></td>
|
118 |
+
</tr>
|
119 |
+
<tr>
|
120 |
+
<td><?php echo $this->__('Bank Name: %s', $bank) ?></td>
|
121 |
+
</tr>
|
122 |
+
<?php } else if ($_method == "realtime") { ?>
|
123 |
+
<tr>
|
124 |
+
<td><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
128 |
+
</tr>
|
129 |
+
<tr>
|
130 |
+
<td><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
131 |
+
</tr>
|
132 |
+
<?php } ?>
|
133 |
+
</tr>
|
134 |
+
</tbody>
|
135 |
+
</table>
|
136 |
+
</dd>
|
137 |
+
</dl>
|
138 |
+
</p>
|
139 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
|
140 |
+
<p>
|
141 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
142 |
+
<?php echo $this->getChildHtml() ?>
|
143 |
+
</p>
|
144 |
+
<?php endif;?>
|
145 |
+
<?php endif;?>
|
146 |
+
|
147 |
+
<?php if ($this->getAgreementRefId()): ?>
|
148 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
|
149 |
+
<?php endif;?>
|
150 |
+
|
151 |
+
<?php if ($profiles = $this->getRecurringProfiles()):?>
|
152 |
+
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
153 |
+
<ul class="disc">
|
154 |
+
<?php foreach($profiles as $profile):?>
|
155 |
+
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
|
156 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
|
157 |
+
<?php endforeach;?>
|
158 |
+
</ul>
|
159 |
+
<?php endif;?>
|
160 |
+
|
161 |
+
<div class="buttons-set">
|
162 |
+
<button type="button" class="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue Shopping')) ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
|
163 |
+
</div>
|
app/design/frontend/base/default/template/oxxo/form/oxxo.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/base/default/template/oxxo/info/oxxo.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$barcode = $this->getInfo()->getOxxoBarcodeUrl();
|
34 |
+
$reference = $this->getInfo()->getOxxoBarcode();
|
35 |
+
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
36 |
+
?>
|
37 |
+
|
38 |
+
<dl class="oxxo">
|
39 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
40 |
+
<dd class="offset">
|
41 |
+
<table class="info-table">
|
42 |
+
<tbody>
|
43 |
+
<tr>
|
44 |
+
<?php if (empty($barcode) != true) {?>
|
45 |
+
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
46 |
+
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
47 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
48 |
+
<?php } else { ?>
|
49 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
50 |
+
|
51 |
+
<?php } ?>
|
52 |
+
</tr>
|
53 |
+
</tbody>
|
54 |
+
</table>
|
55 |
+
</dd>
|
56 |
+
</dl>
|
app/design/frontend/base/default/template/realtime/form/realtime.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/base/default/template/realtime/info/realtime.phtml
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$barcode = $this->getInfo()->getRealtimeBarcodeUrl();
|
34 |
+
$reference = $this->getInfo()->getRealtimeBarcode();
|
35 |
+
$expiry = $this->getInfo()->getRealtimeExpiryDate();
|
36 |
+
$store_name = $this->getInfo()->getRealtimeStoreName();
|
37 |
+
?>
|
38 |
+
|
39 |
+
<dl class="realtime">
|
40 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
41 |
+
<dd class="offset">
|
42 |
+
<table class="info-table">
|
43 |
+
<tbody>
|
44 |
+
<tr>
|
45 |
+
<?php if (empty($barcode) != true) {?>
|
46 |
+
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
47 |
+
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
48 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
49 |
+
<?php } else { ?>
|
50 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
51 |
+
|
52 |
+
<?php } ?>
|
53 |
+
</tr>
|
54 |
+
</tbody>
|
55 |
+
</table>
|
56 |
+
</dd>
|
57 |
+
</dl>
|
app/design/frontend/base/default/template/spei/form/spei.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/base/default/template/spei/info/spei.phtml
ADDED
@@ -0,0 +1,54 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$clabe = $this->getInfo()->getSpeiClabe();
|
34 |
+
$bank = $this->getInfo()->getSpeiBank();
|
35 |
+
?>
|
36 |
+
|
37 |
+
<dl class="spei">
|
38 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
39 |
+
<dd class="offset">
|
40 |
+
<table class="info-table">
|
41 |
+
<tbody>
|
42 |
+
<tr>
|
43 |
+
<?php if (empty($clabe) != true) {?>
|
44 |
+
<th><?php echo $this->__('CLABE: %s', $clabe) ?></th>
|
45 |
+
<th><?php echo $this->__('Bank Name: %s', $bank) ?></th>
|
46 |
+
<?php } else { ?>
|
47 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
48 |
+
|
49 |
+
<?php } ?>
|
50 |
+
</tr>
|
51 |
+
</tbody>
|
52 |
+
</table>
|
53 |
+
</dd>
|
54 |
+
</dl>
|
app/design/frontend/default/default/layout/card.xml
ADDED
@@ -0,0 +1,50 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="head">
|
5 |
+
<block type="core/text" name="conekta">
|
6 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
</default>
|
10 |
+
<card_index_index>
|
11 |
+
<reference name="head">
|
12 |
+
<block type="core/text" name="conekta">
|
13 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
14 |
+
</block>
|
15 |
+
</reference>
|
16 |
+
<reference name="content">
|
17 |
+
<block type="card/card" name="card" template="card/card.phtml" />
|
18 |
+
</reference>
|
19 |
+
</card_index_index>
|
20 |
+
<checkout_onepage_index>
|
21 |
+
<reference name="head">
|
22 |
+
<block type="core/text" name="conekta">
|
23 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
24 |
+
</block>
|
25 |
+
</reference>
|
26 |
+
<reference name="before_body_end">
|
27 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
28 |
+
</reference>
|
29 |
+
</checkout_onepage_index>
|
30 |
+
<opc_index_index translate="label">
|
31 |
+
<reference name="head">
|
32 |
+
<block type="core/text" name="conekta">
|
33 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
34 |
+
</block>
|
35 |
+
</reference>
|
36 |
+
<reference name="before_body_end">
|
37 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
38 |
+
</reference>
|
39 |
+
</opc_index_index>
|
40 |
+
<onestepcheckout_index_index>
|
41 |
+
<reference name="head">
|
42 |
+
<block type="core/text" name="conekta">
|
43 |
+
<action method="setText"><text><![CDATA[<script src="https://conektaapi.s3.amazonaws.com/v0.3.2/js/conekta.js"></script>]]></text></action>
|
44 |
+
</block>
|
45 |
+
</reference>
|
46 |
+
<reference name="before_body_end">
|
47 |
+
<block type="core/template" name="token" template="card/token.phtml" />
|
48 |
+
</reference>
|
49 |
+
</onestepcheckout_index_index>
|
50 |
+
</layout>
|
app/design/frontend/default/default/layout/oxxo.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<oxxo_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="oxxo/oxxo" name="oxxo" template="oxxo/oxxo.phtml" />
|
8 |
+
</reference>
|
9 |
+
</oxxo_index_index>
|
10 |
+
</layout>
|
app/design/frontend/default/default/layout/realtime.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<realtime_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="realtime/realtime" name="realtime" template="realtime/realtime.phtml" />
|
8 |
+
</reference>
|
9 |
+
</realtime_index_index>
|
10 |
+
</layout>
|
app/design/frontend/default/default/layout/spei.xml
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
</default>
|
5 |
+
<spei_index_index>
|
6 |
+
<reference name="content">
|
7 |
+
<block type="spei/spei" name="spei" template="spei/spei.phtml" />
|
8 |
+
</reference>
|
9 |
+
</spei_index_index>
|
10 |
+
</layout>
|
app/design/frontend/default/default/template/card/form/card.phtml
ADDED
@@ -0,0 +1,127 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
28 |
+
<script>
|
29 |
+
Conekta.setPublishableKey('<?php echo Mage::getStoreConfig('payment/webhook/publickey');?>');
|
30 |
+
</script>
|
31 |
+
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
32 |
+
<input id="<?php echo $_code ?>_card_token" name="payment[conekta_token]" type="hidden" value="">
|
33 |
+
<input id="<?php echo $_code ?>_card_bin" name="card[bin]" type="hidden" value="">
|
34 |
+
<?php $amount_installments = floatval(Mage::getStoreConfig('payment/card/amount_installments')); ?>
|
35 |
+
|
36 |
+
<?php $activate_installments_3 = Mage::getStoreConfig('payment/card/activate_installments_3'); ?>
|
37 |
+
<?php $activate_installments_6 = Mage::getStoreConfig('payment/card/activate_installments_6'); ?>
|
38 |
+
<?php $activate_installments_9 = Mage::getStoreConfig('payment/card/activate_installments_9'); ?>
|
39 |
+
<?php $activate_installments_12 = Mage::getStoreConfig('payment/card/activate_installments_12'); ?>
|
40 |
+
|
41 |
+
<?php $amount = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal(); ?>
|
42 |
+
|
43 |
+
<?php if ($amount_installments <= $amount && ($activate_installments_3 || $activate_installments_6 || $activate_installments_9 || $activate_installments_12)) { ?>
|
44 |
+
<li>
|
45 |
+
<label for="<?php echo $_code ?>_monthly_installments" class="required"><em>*</em><?php echo $this->__('Monthly Intallments') ?></label>
|
46 |
+
<select id="<?php echo $_code ?>_card_monthly_installments" name="payment[monthly_installments]" class="required-entry">
|
47 |
+
<option selected="selected" value="0"><?php echo $this->__('1 Installment Charge') ?></option>
|
48 |
+
<?php if ($activate_installments_3) {?>
|
49 |
+
<option value="3"><?php echo $this->__('3 Installment Charge') ?></option>
|
50 |
+
<?php } ?>
|
51 |
+
<?php if ($activate_installments_6) {?>
|
52 |
+
<option value="6"><?php echo $this->__('6 Installment Charge') ?></option>
|
53 |
+
<?php } ?>
|
54 |
+
<?php if ($activate_installments_9) {?>
|
55 |
+
<option value="9"><?php echo $this->__('9 Installment Charge') ?></option>
|
56 |
+
<?php } ?>
|
57 |
+
<?php if ($activate_installments_12) {?>
|
58 |
+
<option value="12"><?php echo $this->__('12 Installment Charge') ?></option>
|
59 |
+
<?php } ?>
|
60 |
+
</select>
|
61 |
+
</li>
|
62 |
+
<?php } else { ?>
|
63 |
+
<input id="<?php echo $_code ?>_monthly_installments" name="payment[monthly_installments]" type="hidden" value="0">
|
64 |
+
<?php } ?>
|
65 |
+
<li>
|
66 |
+
<div class="input-box">
|
67 |
+
<label for="<?php echo $_code ?>_cc_owner" class="required"><em>*</em><?php echo $this->__('Name on Card') ?></label>
|
68 |
+
<input type="text" title="<?php echo $this->__('Name on Card') ?>" class="input-text required-entry" id="<?php echo $_code ?>_cc_owner" data-conekta="card[name]" value="<?php echo $this->htmlEscape($this->getInfoData('cc_owner')) ?>" />
|
69 |
+
</div>
|
70 |
+
</li>
|
71 |
+
<li>
|
72 |
+
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
|
73 |
+
<div class="input-box">
|
74 |
+
<input type="text" id="<?php echo $_code ?>_cc_number" data-conekta="card[number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type required-entry" value="" />
|
75 |
+
</div>
|
76 |
+
</li>
|
77 |
+
<li id="<?php echo $_code ?>_cc_type_exp_div">
|
78 |
+
<label for="<?php echo $_code ?>_expiration" class="required"><em>*</em><?php echo $this->__('Expiration Date') ?></label>
|
79 |
+
<div class="input-box">
|
80 |
+
<div class="v-fix">
|
81 |
+
<select id="<?php echo $_code ?>_expiration" data-conekta="card[exp_month]" class="month validate-cc-exp required-entry">
|
82 |
+
<option selected="selected" value=""><?php echo $this->__('Month') ?></option>
|
83 |
+
<option value="1">01 - January</option>
|
84 |
+
<option value="2">02 - February</option>
|
85 |
+
<option value="3">03 - March</option>
|
86 |
+
<option value="4">04 - April</option>
|
87 |
+
<option value="5">05 - May</option>
|
88 |
+
<option value="6">06 - June</option>
|
89 |
+
<option value="7">07 - July</option>
|
90 |
+
<option value="8">08 - August</option>
|
91 |
+
<option value="9">09 - September</option>
|
92 |
+
<option value="10">10 - October</option>
|
93 |
+
<option value="11">11 - November</option>
|
94 |
+
<option value="12">12 - December</option>
|
95 |
+
</select>
|
96 |
+
</div>
|
97 |
+
<div class="v-fix">
|
98 |
+
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
+
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
+
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
101 |
+
<option value="2014">2014</option>
|
102 |
+
<option value="2015">2015</option>
|
103 |
+
<option value="2016">2016</option>
|
104 |
+
<option value="2017">2017</option>
|
105 |
+
<option value="2018">2018</option>
|
106 |
+
<option value="2019">2019</option>
|
107 |
+
<option value="2020">2020</option>
|
108 |
+
<option value="2021">2021</option>
|
109 |
+
<option value="2022">2022</option>
|
110 |
+
<option value="2023">2023</option>
|
111 |
+
<option value="2024">2024</option>
|
112 |
+
<option value="2025">2025</option>
|
113 |
+
</select>
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
+
</li>
|
117 |
+
<?php echo $this->getChildHtml() ?>
|
118 |
+
<li id="<?php echo $_code ?>_cc_type_cvv_div">
|
119 |
+
<label for="<?php echo $_code ?>_cc_cid" class="required"><em>*</em><?php echo $this->__('Card Verification Number') ?></label>
|
120 |
+
<div class="input-box">
|
121 |
+
<div class="v-fix">
|
122 |
+
<input type="text" title="<?php echo $this->__('Card Verification Number') ?>" class="input-text cvv required-entry validate-cc-cvn" id="<?php echo $_code ?>_cc_cid" data-conekta="card[cvc]" value="" />
|
123 |
+
</div>
|
124 |
+
<a href="#" class="cvv-what-is-this"><?php echo $this->__('What is this?') ?></a>
|
125 |
+
</div>
|
126 |
+
</li>
|
127 |
+
</ul>
|
app/design/frontend/default/default/template/card/info/card.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$authNumber = $this->getInfo()->getChargeAuthorization();
|
34 |
+
$owner = $this->getInfo()->getCcOwner();
|
35 |
+
$card = $this->getInfo()->getCcLast4();
|
36 |
+
?>
|
37 |
+
|
38 |
+
<dl class="card">
|
39 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
40 |
+
<dd class="offset">
|
41 |
+
<table class="info-table">
|
42 |
+
<tbody>
|
43 |
+
<tr>
|
44 |
+
<?php if (empty($authNumber) != true) {?>
|
45 |
+
<th><?php echo $this->__('Cardholder Name: %s', $owner) ?></th>
|
46 |
+
<th><?php echo $this->__('Card Last 4: %s', $card) ?></th>
|
47 |
+
<th><?php echo $this->__('Authorization Number: %s', $authNumber) ?></th>
|
48 |
+
<?php } else { ?>
|
49 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
50 |
+
|
51 |
+
<?php } ?>
|
52 |
+
</tr>
|
53 |
+
</tbody>
|
54 |
+
</table>
|
55 |
+
</dd>
|
56 |
+
</dl>
|
app/design/frontend/default/default/template/card/token.phtml
ADDED
@@ -0,0 +1,138 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<script type="text/javascript">
|
2 |
+
//<![CDATA[
|
3 |
+
var oneStepForm = document.getElementById("onestepcheckout-form");
|
4 |
+
var processPayment = function() {
|
5 |
+
var currentMethod = (oneStepForm != null) ? payment.currentMethod : payment.lastUsedMethod;
|
6 |
+
if(currentMethod == 'card'){
|
7 |
+
if(_validateCard()) {
|
8 |
+
document.getElementById('card_expiration').setAttribute("data-conekta", "card[exp_month]");
|
9 |
+
document.getElementById('card_expiration_yr').setAttribute("data-conekta", "card[exp_year]");
|
10 |
+
var form = document.getElementById("payment_form_card");
|
11 |
+
Conekta.token.create(form, successResponseHandler, errorResponseHandler);
|
12 |
+
} else {
|
13 |
+
conektaTempSave();
|
14 |
+
}
|
15 |
+
} else {
|
16 |
+
conektaTempSave();
|
17 |
+
}
|
18 |
+
}
|
19 |
+
|
20 |
+
var successResponseHandler = function(response) {
|
21 |
+
document.getElementById('card_card_token').value = response.id;
|
22 |
+
if (window["IWD"] && IWD.OPC) {
|
23 |
+
conektaTempSave();
|
24 |
+
} else if (oneStepForm != null) {
|
25 |
+
conektaTempSave();
|
26 |
+
} else {
|
27 |
+
var request = new Ajax.Request(
|
28 |
+
payment.saveUrl,
|
29 |
+
{
|
30 |
+
method:'post',
|
31 |
+
onComplete: payment.onComplete,
|
32 |
+
onSuccess: payment.onSave,
|
33 |
+
onFailure: checkout.ajaxFailure.bind(checkout),
|
34 |
+
parameters: Form.serialize(payment.form)
|
35 |
+
}
|
36 |
+
);
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
var errorResponseHandler = function(response) {
|
41 |
+
alert(response.message);
|
42 |
+
if (window["IWD"] && IWD.OPC) {
|
43 |
+
IWD.OPC.Checkout.unlockPlaceOrder();
|
44 |
+
} else if (oneStepForm != null) {
|
45 |
+
already_placing_order = false;
|
46 |
+
var submitelement = $('onestepcheckout-place-order');
|
47 |
+
/* Disable button to avoid multiple clicks */
|
48 |
+
submitelement.removeClassName('grey').addClassName('orange');
|
49 |
+
submitelement.disabled = false;
|
50 |
+
submitelement.parentNode.lastChild.remove();
|
51 |
+
return false;
|
52 |
+
} else {
|
53 |
+
payment.resetLoadWaiting();
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
var _validateCard = function(){
|
58 |
+
var expMonth = document.getElementById('card_expiration').value;
|
59 |
+
var expYear = document.getElementById('card_expiration_yr').value;
|
60 |
+
var cardNumber = document.getElementById('card_cc_number').value;
|
61 |
+
var type = Conekta.card.getBrand(cardNumber);
|
62 |
+
document.getElementById('card_card_bin').value = cardNumber.substring(0,6);
|
63 |
+
return Conekta.card.validateNumber(cardNumber) && Conekta.card.validateExpirationDate(expMonth, expYear) && type != 'unknown';
|
64 |
+
}
|
65 |
+
|
66 |
+
if (window["IWD"] && IWD.OPC) {
|
67 |
+
var initSaveOrder = function() {
|
68 |
+
IWD.OPC.saveOrderStatus = true;
|
69 |
+
IWD.OPC.Plugin.dispatch('saveOrderBefore');
|
70 |
+
if (IWD.OPC.Checkout.isVirtual===false){
|
71 |
+
IWD.OPC.Checkout.lockPlaceOrder();
|
72 |
+
IWD.OPC.Shipping.saveShippingMethod();
|
73 |
+
}else{
|
74 |
+
IWD.OPC.validatePayment();
|
75 |
+
}
|
76 |
+
}
|
77 |
+
var conektaTempSave = function () {
|
78 |
+
initSaveOrder();
|
79 |
+
}
|
80 |
+
IWD.OPC.initSaveOrder = function() {
|
81 |
+
$j(document).on('click', '.opc-btn-checkout', function(){
|
82 |
+
if (IWD.OPC.Checkout.disabledSave==true){
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
var addressForm = new VarienForm('billing-new-address-form');
|
86 |
+
if (!addressForm.validator.validate()){
|
87 |
+
return;
|
88 |
+
}
|
89 |
+
|
90 |
+
if (!$j('input[name="billing[use_for_shipping]"]').prop('checked')){
|
91 |
+
var addressForm = new VarienForm('opc-address-form-shipping');
|
92 |
+
if (!addressForm.validator.validate()){
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
processPayment();
|
97 |
+
});
|
98 |
+
}
|
99 |
+
} else if (oneStepForm != null) {
|
100 |
+
var conektaTempSave = function() {
|
101 |
+
var form = new VarienForm('onestepcheckout-form');
|
102 |
+
if(form.validator.validate()) {
|
103 |
+
/* Submit the form */
|
104 |
+
$('onestepcheckout-form').submit();
|
105 |
+
} else {
|
106 |
+
already_placing_order = false;
|
107 |
+
var submitelement = $('onestepcheckout-place-order');
|
108 |
+
/* Disable button to avoid multiple clicks */
|
109 |
+
submitelement.removeClassName('grey').addClassName('orange');
|
110 |
+
submitelement.disabled = false;
|
111 |
+
submitelement.parentNode.lastChild.remove();
|
112 |
+
}
|
113 |
+
}
|
114 |
+
$$('.onestepcheckout-place-order').each(function(elem){
|
115 |
+
elem.observe('click', function(e) {
|
116 |
+
already_placing_order = true;
|
117 |
+
var submitelement = $('onestepcheckout-place-order');
|
118 |
+
/* Disable button to avoid multiple clicks */
|
119 |
+
submitelement.removeClassName('orange').addClassName('grey');
|
120 |
+
submitelement.disabled = true;
|
121 |
+
var loaderelement = new Element('span').
|
122 |
+
addClassName('onestepcheckout-place-order-loading').
|
123 |
+
update('Please wait, processing your order...');
|
124 |
+
submitelement.parentNode.appendChild(loaderelement);
|
125 |
+
processPayment();
|
126 |
+
});
|
127 |
+
});
|
128 |
+
} else {
|
129 |
+
var conektaPaymentSave = payment.save;
|
130 |
+
var conektaTempSave = function () {
|
131 |
+
conektaPaymentSave.apply(payment);
|
132 |
+
}
|
133 |
+
payment.save = function(){
|
134 |
+
processPayment();
|
135 |
+
}
|
136 |
+
}
|
137 |
+
//]]>
|
138 |
+
</script>
|
app/design/frontend/default/default/template/checkout/success.phtml
ADDED
@@ -0,0 +1,163 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php
|
28 |
+
$_order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
29 |
+
$_payment = $_order->getPayment();
|
30 |
+
$_method = $_payment->getMethod();
|
31 |
+
|
32 |
+
if ($_method == "card") {
|
33 |
+
$authNumber = $_payment->getChargeAuthorization();
|
34 |
+
$owner = $_payment->getCcOwner();
|
35 |
+
$card = $_payment->getCcLast4();
|
36 |
+
} else if ($_method == "bank") {
|
37 |
+
$service_number = $_payment->getBankServiceNumber();
|
38 |
+
$service_name = $_payment->getBankServiceName();
|
39 |
+
$bank_name = $_payment->getBankName();
|
40 |
+
$reference = $_payment->getBankReference();
|
41 |
+
$expiry = $_payment->getBankExpiryDate();
|
42 |
+
} else if ($_method == "realtime") {
|
43 |
+
$barcode = $_payment->getRealtimeBarcodeUrl();
|
44 |
+
$reference = $_payment->getRealtimeBarcode();
|
45 |
+
$expiry = $_payment->getRealtimeExpiryDate();
|
46 |
+
$store_name = $_payment->getRealtimeStoreName();
|
47 |
+
} else if ($_method == "spei") {
|
48 |
+
$clabe = $_payment->getSpeiClabe();
|
49 |
+
$bank = $_payment->getSpeiBank();
|
50 |
+
} else if ($_method == "oxxo") {
|
51 |
+
$reference = $_payment->getOxxoBarcode();
|
52 |
+
$barcode = $_payment->getOxxoBarcodeUrl();
|
53 |
+
$expiry = $_payment->getOxxoExpiryDate();
|
54 |
+
}
|
55 |
+
|
56 |
+
?>
|
57 |
+
<div class="page-title">
|
58 |
+
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
59 |
+
</div>
|
60 |
+
<?php echo $this->getMessagesBlock()->toHtml() ?>
|
61 |
+
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
62 |
+
|
63 |
+
<?php if ($this->getOrderId()):?>
|
64 |
+
<?php if ($this->getCanViewOrder()) :?>
|
65 |
+
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
66 |
+
<?php else :?>
|
67 |
+
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
68 |
+
<?php endif;?>
|
69 |
+
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
70 |
+
<p>
|
71 |
+
<dl>
|
72 |
+
<dt></dt>
|
73 |
+
<dd>
|
74 |
+
<table>
|
75 |
+
<tbody>
|
76 |
+
<tr>
|
77 |
+
<th><?php echo $this->__('Order details') ?></th>
|
78 |
+
</tr>
|
79 |
+
<tr>
|
80 |
+
<?php if ($_method == "card") {?>
|
81 |
+
<tr>
|
82 |
+
<td><?php echo $this->__('Cardholder Name: %s', $owner) ?></td>
|
83 |
+
</tr>
|
84 |
+
<tr>
|
85 |
+
<td><?php echo $this->__('Card Last 4: %s', $card) ?></td>
|
86 |
+
</tr>
|
87 |
+
<tr>
|
88 |
+
<td><?php echo $this->__('Authorization Number: %s', $authNumber) ?></td>
|
89 |
+
</tr>
|
90 |
+
<?php } else if ($_method == "oxxo") { ?>
|
91 |
+
<tr>
|
92 |
+
<td><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></td>
|
93 |
+
</tr>
|
94 |
+
<tr>
|
95 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
96 |
+
</tr>
|
97 |
+
<tr>
|
98 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
99 |
+
</tr>
|
100 |
+
<?php } else if ($_method == "bank") { ?>
|
101 |
+
<tr>
|
102 |
+
<td><?php echo $this->__('Service Name: %s', $service_name) ?></td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<td><?php echo $this->__('Service Number: %s', $service_number) ?></td>
|
106 |
+
</tr>
|
107 |
+
<tr>
|
108 |
+
<td><?php echo $this->__('Bank Name: %s', $bank_name) ?></td>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
112 |
+
</tr>
|
113 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
114 |
+
</tr>
|
115 |
+
<?php } else if ($_method == "spei") { ?>
|
116 |
+
<tr>
|
117 |
+
<td><?php echo $this->__('CLABE: %s', $clabe) ?></td>
|
118 |
+
</tr>
|
119 |
+
<tr>
|
120 |
+
<td><?php echo $this->__('Bank Name: %s', $bank) ?></td>
|
121 |
+
</tr>
|
122 |
+
<?php } else if ($_method == "realtime") { ?>
|
123 |
+
<tr>
|
124 |
+
<td><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
128 |
+
</tr>
|
129 |
+
<tr>
|
130 |
+
<td><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
131 |
+
</tr>
|
132 |
+
<?php } ?>
|
133 |
+
</tr>
|
134 |
+
</tbody>
|
135 |
+
</table>
|
136 |
+
</dd>
|
137 |
+
</dl>
|
138 |
+
</p>
|
139 |
+
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
|
140 |
+
<p>
|
141 |
+
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
142 |
+
<?php echo $this->getChildHtml() ?>
|
143 |
+
</p>
|
144 |
+
<?php endif;?>
|
145 |
+
<?php endif;?>
|
146 |
+
|
147 |
+
<?php if ($this->getAgreementRefId()): ?>
|
148 |
+
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
|
149 |
+
<?php endif;?>
|
150 |
+
|
151 |
+
<?php if ($profiles = $this->getRecurringProfiles()):?>
|
152 |
+
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
153 |
+
<ul class="disc">
|
154 |
+
<?php foreach($profiles as $profile):?>
|
155 |
+
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
|
156 |
+
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
|
157 |
+
<?php endforeach;?>
|
158 |
+
</ul>
|
159 |
+
<?php endif;?>
|
160 |
+
|
161 |
+
<div class="buttons-set">
|
162 |
+
<button type="button" class="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue Shopping')) ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
|
163 |
+
</div>
|
app/design/frontend/default/default/template/oxxo/form/oxxo.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/default/default/template/oxxo/info/oxxo.phtml
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$barcode = $this->getInfo()->getOxxoBarcodeUrl();
|
34 |
+
$reference = $this->getInfo()->getOxxoBarcode();
|
35 |
+
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
36 |
+
?>
|
37 |
+
|
38 |
+
<dl class="oxxo">
|
39 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
40 |
+
<dd class="offset">
|
41 |
+
<table class="info-table">
|
42 |
+
<tbody>
|
43 |
+
<tr>
|
44 |
+
<?php if (empty($barcode) != true) {?>
|
45 |
+
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
46 |
+
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
47 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
48 |
+
<?php } else { ?>
|
49 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
50 |
+
|
51 |
+
<?php } ?>
|
52 |
+
</tr>
|
53 |
+
</tbody>
|
54 |
+
</table>
|
55 |
+
</dd>
|
56 |
+
</dl>
|
app/design/frontend/default/default/template/realtime/form/realtime.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/default/default/template/realtime/info/realtime.phtml
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$barcode = $this->getInfo()->getRealtimeBarcodeUrl();
|
34 |
+
$reference = $this->getInfo()->getRealtimeBarcode();
|
35 |
+
$expiry = $this->getInfo()->getRealtimeExpiryDate();
|
36 |
+
$store_name = $this->getInfo()->getRealtimeStoreName();
|
37 |
+
?>
|
38 |
+
|
39 |
+
<dl class="realtime">
|
40 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
41 |
+
<dd class="offset">
|
42 |
+
<table class="info-table">
|
43 |
+
<tbody>
|
44 |
+
<tr>
|
45 |
+
<?php if (empty($barcode) != true) {?>
|
46 |
+
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
47 |
+
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
48 |
+
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
49 |
+
<?php } else { ?>
|
50 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
51 |
+
|
52 |
+
<?php } ?>
|
53 |
+
</tr>
|
54 |
+
</tbody>
|
55 |
+
</table>
|
56 |
+
</dd>
|
57 |
+
</dl>
|
app/design/frontend/default/default/template/spei/form/spei.phtml
ADDED
@@ -0,0 +1,27 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php $_code=$this->getMethodCode() ?>
|
app/design/frontend/default/default/template/spei/info/spei.phtml
ADDED
@@ -0,0 +1,54 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
|
28 |
+
<?php if (!$this->getHideTitle()): ?>
|
29 |
+
<p><strong><?php echo $this->htmlEscape($this->getMethod()->getTitle()) ?></strong></p>
|
30 |
+
<?php endif;?>
|
31 |
+
|
32 |
+
<?php
|
33 |
+
$clabe = $this->getInfo()->getSpeiClabe();
|
34 |
+
$bank = $this->getInfo()->getSpeiBank();
|
35 |
+
?>
|
36 |
+
|
37 |
+
<dl class="spei">
|
38 |
+
<dt><?php echo "Purchase Info:"; ?></dt>
|
39 |
+
<dd class="offset">
|
40 |
+
<table class="info-table">
|
41 |
+
<tbody>
|
42 |
+
<tr>
|
43 |
+
<?php if (empty($clabe) != true) {?>
|
44 |
+
<th><?php echo $this->__('CLABE: %s', $clabe) ?></th>
|
45 |
+
<th><?php echo $this->__('Bank Name: %s', $bank) ?></th>
|
46 |
+
<?php } else { ?>
|
47 |
+
<th><?php echo $this->__('You will receive an invoice via email.') ?></th>
|
48 |
+
|
49 |
+
<?php } ?>
|
50 |
+
</tr>
|
51 |
+
</tbody>
|
52 |
+
</table>
|
53 |
+
</dd>
|
54 |
+
</dl>
|
app/etc/modules/Conekta_Card.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Card>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Conekta_Card>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Conekta_Oxxo.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Oxxo>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Conekta_Oxxo>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Conekta_Spei.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Spei>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Conekta_Spei>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/etc/modules/Conekta_Webhook.xml
ADDED
@@ -0,0 +1,9 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Conekta_Webhook>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Conekta_Webhook>
|
8 |
+
</modules>
|
9 |
+
</config>
|
app/locale/en_US/Conekta_Bank.csv
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Sort Order"
|
2 |
+
"Order was placed using Conekta %s", "Order was placed using Conekta %s"
|
3 |
+
"Order amount %s", "Order amount: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Reference Number: %s"
|
6 |
+
"Expiry Date: %s", "Expiry Date: %s"
|
7 |
+
"Service Name: %s", "Service Name: %s"
|
8 |
+
"Service Number: %s", "Service Number: %s"
|
9 |
+
"Bank Name: %s", "Bank Name: %s"
|
10 |
+
"Order details", "Order details"
|
app/locale/en_US/Conekta_Card.csv
ADDED
@@ -0,0 +1,33 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Monthly Intallments", "Monthly Intallments"
|
2 |
+
"Name on Card", "Name on Card"
|
3 |
+
"Credit Card Number", "Credit/Debit Card Number"
|
4 |
+
"Expiration Date", "Expiration Date"
|
5 |
+
"Month", "Month"
|
6 |
+
"Year", "Year"
|
7 |
+
"Card Verification Number", "Card Verification Number"
|
8 |
+
"What is this?", "What is this?"
|
9 |
+
"Enabled", "Enabled"
|
10 |
+
"New order status", "New order status"
|
11 |
+
"Order status when Conekta sends payment notification", "Order status when Conekta sends payment notification"
|
12 |
+
"Title", "Title"
|
13 |
+
"Private Key", "Private Key"
|
14 |
+
"Public Key", "Public Key"
|
15 |
+
"Activate MSI 3", "Activate 3 Monthly Installments"
|
16 |
+
"Activate MSI 6", "Activate 6 Monthly Installments"
|
17 |
+
"Activate MSI 9", "Activate 9 Monthly Installments"
|
18 |
+
"Activate MSI 12", "Activate 12 Monthly Installments"
|
19 |
+
"Minimum Amount for MSI", "Minimum Amount for Monthly Installments"
|
20 |
+
"Expiry (# days)", "Expiry (# days)"
|
21 |
+
"Sort Order", "Sort Order"
|
22 |
+
"1 Installment Charge", "1 Installment Charge"
|
23 |
+
"3 Installment Charge", "3 Installment Charge"
|
24 |
+
"6 Installment Charge", "6 Installment Charge"
|
25 |
+
"9 Installment Charge", "9 Installment Charge"
|
26 |
+
"12 Installment Charge", "12 Installment Charge"
|
27 |
+
"Order was placed using Conekta %s", "Order was placed using Conekta %s"
|
28 |
+
"Order amount %s", "Order amount: %s"
|
29 |
+
"Conekta Id %s", "Conekta Id: %s"
|
30 |
+
"Cardholder Name: %s", "Cardholder Name: %s"
|
31 |
+
"Card Last 4: %s", "Card Last 4: %s"
|
32 |
+
"Authorization Number: %s", "Authorization Number: %s"
|
33 |
+
"Order details", "Order details"
|
app/locale/en_US/Conekta_Oxxo.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Sort Order"
|
2 |
+
"Order was placed using Conekta %s", "Order was placed using Conekta %s"
|
3 |
+
"Order amount %s", "Order amount: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Reference Number: %s"
|
6 |
+
"Expiry Date: %s", "Expiry Date: %s"
|
7 |
+
"Order details", "Order details"
|
app/locale/en_US/Conekta_Realtime.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Sort Order"
|
2 |
+
"Order was placed using Conekta %s", "Order was placed using Conekta %s"
|
3 |
+
"Order amount %s", "Order amount: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Reference Number: %s"
|
6 |
+
"Expiry Date: %s", "Expiry Date: %s"
|
7 |
+
"Order details", "Order details"
|
app/locale/en_US/Conekta_Spei.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Sort Order"
|
2 |
+
"Order was placed using Conekta %s", "Order was placed using Conekta %s"
|
3 |
+
"Order amount %s", "Order amount: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"CLABE: %s", "CLABE: %s"
|
6 |
+
"Bank Name: %s", "Bank Name: %s"
|
7 |
+
"Order details", "Order details"
|
app/locale/es_MX/Conekta_Bank.csv
ADDED
@@ -0,0 +1,10 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Orden para mostrar"
|
2 |
+
"Order was placed using Conekta %s", "El pedido fue realizado usando Conekta %s"
|
3 |
+
"Order amount %s", "Monto de la orden: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Número de referencia: %s"
|
6 |
+
"Expiry Date: %s", "Fecha de expiración: %s"
|
7 |
+
"Service Name: %s", "Nombre del servicio: %s"
|
8 |
+
"Service Number: %s", "Número del servicio: %s"
|
9 |
+
"Bank Name: %s", "Nombre del banco: %s"
|
10 |
+
"Order details", "Detalles de la orden"
|
app/locale/es_MX/Conekta_Card.csv
ADDED
@@ -0,0 +1,33 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Monthly Intallments", "Meses sin intereses"
|
2 |
+
"Name on Card", "Nombre que aperece en la tarjeta"
|
3 |
+
"Credit Card Number", "Tarjeta de crédito/débito"
|
4 |
+
"Expiration Date", "Fecha de expiración"
|
5 |
+
"Month", "Mes"
|
6 |
+
"Year", "Año"
|
7 |
+
"Card Verification Number", "Código de seguridad"
|
8 |
+
"What is this?", "¿Qué es esto?"
|
9 |
+
"Enabled", "Habilitado"
|
10 |
+
"New order status", "Estatus de nueva orden"
|
11 |
+
"Order status when Conekta sends payment notification", "Estatus de la orden cuando es actualizada por Conekta"
|
12 |
+
"Title", "TÃtulo"
|
13 |
+
"Private Key", "Llave privada"
|
14 |
+
"Public Key", "Llave pública"
|
15 |
+
"Activate MSI 3", "Activar 3 MSI"
|
16 |
+
"Activate MSI 6", "Activar 6 MSI"
|
17 |
+
"Activate MSI 9", "Activar 9 MSI"
|
18 |
+
"Activate MSI 12", "Activar 12 MSI"
|
19 |
+
"Minimum Amount for MSI", "Mónto mÃnimo para MSI"
|
20 |
+
"Expiry (# days)", "Expiración (# dÃas)"
|
21 |
+
"Sort Order", "Order para mostrar"
|
22 |
+
"1 Installment Charge", "Cargo en una sola exhibición"
|
23 |
+
"3 Installment Charge", "3 meses sin intereses"
|
24 |
+
"6 Installment Charge", "6 meses sin intereses"
|
25 |
+
"9 Installment Charge", "9 meses sin intereses"
|
26 |
+
"12 Installment Charge", "12 meses sin intereses"
|
27 |
+
"Order was placed using Conekta %s", "El pedido fue realizado usando Conekta %s"
|
28 |
+
"Order amount %s", "Monto de la orden: %s"
|
29 |
+
"Conekta Id %s", "Conekta Id: %s"
|
30 |
+
"Cardholder Name: %s", "Nombre del tarjetahabiente: %s"
|
31 |
+
"Card Last 4: %s", "Card Last 4: %s"
|
32 |
+
"Authorization Number: %s", "Número de autorización: %s"
|
33 |
+
"Order details", "Detalles de la orden"
|
app/locale/es_MX/Conekta_Oxxo.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Orden para mostrar"
|
2 |
+
"Order was placed using Conekta %s", "El pedido fue realizado usando Conekta %s"
|
3 |
+
"Order amount %s", "Monto de la orden: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Número de referencia: %s"
|
6 |
+
"Expiry Date: %s", "Fecha de expiración: %s"
|
7 |
+
"Order details", "Detalles de la orden"
|
app/locale/es_MX/Conekta_Realtime.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Orden para mostrar"
|
2 |
+
"Order was placed using Conekta %s", "El pedido fue realizado usando Conekta %s"
|
3 |
+
"Order amount %s", "Monto de la orden: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"Reference Number: %s", "Número de referencia: %s"
|
6 |
+
"Expiry Date: %s", "Fecha de expiración: %s"
|
7 |
+
"Order details", "Detalles de la orden"
|
app/locale/es_MX/Conekta_Spei.csv
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
"Sort Order", "Orden para mostrar"
|
2 |
+
"Order was placed using Conekta %s", "El pedido fue realizado usando Conekta %s"
|
3 |
+
"Order amount %s", "Monto de la orden: %s"
|
4 |
+
"Conekta Id %s", "Conekta Id: %s"
|
5 |
+
"CLABE: %s", "CLABE: %s"
|
6 |
+
"Bank Name: %s", "Nombre del banco: %s"
|
7 |
+
"Order details", "Detalles de la orden"
|
lib/Conekta/.gitignore
ADDED
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
# OS
|
2 |
+
.DS_Store
|
3 |
+
|
4 |
+
# Composer
|
5 |
+
composer.lock
|
6 |
+
/vendor
|
7 |
+
|
8 |
+
INSTALL.txt
|
9 |
+
LICENSE.txt
|
10 |
+
README.txt
|
11 |
+
demos/
|
12 |
+
extras/documentation
|
lib/Conekta/CHANGELOG
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
|
2 |
+
=== 1.9.0 2013-01-13
|
3 |
+
|
4 |
+
* Deprecate retrieve and all methods and replaced them with find and where respectively.
|
5 |
+
* Add payment method model.
|
6 |
+
* Objects' properties are now accessible with the T_OBJECT_OPERATOR.
|
7 |
+
|
8 |
+
=== 1.9.1 2013-01-21
|
9 |
+
|
10 |
+
* Add setting version functionality.
|
11 |
+
|
12 |
+
=== 1.9.2 2014-04-2
|
13 |
+
|
14 |
+
* Fix bugs in Resource.php.
|
15 |
+
|
16 |
+
=== 1.9.3 2014-04-2
|
17 |
+
|
18 |
+
* Fix bugs in Resource.php.
|
19 |
+
|
20 |
+
=== 1.9.4 2014-04-28
|
21 |
+
|
22 |
+
* Fix Plan tests.
|
23 |
+
* Add Address, Payee, Payout, PayoutMethod, Method.
|
24 |
+
* Add Payout tests.
|
25 |
+
|
26 |
+
=== 1.9.5 2014-04-28
|
27 |
+
|
28 |
+
* Add FILES for Address, Payee, Payout, PayoutMethod, Method.
|
29 |
+
|
30 |
+
=== 1.9.6 2014-05-12
|
31 |
+
|
32 |
+
* Return empty Conekta_Object instead of empty array in Util.php
|
33 |
+
|
34 |
+
=== 1.9.7 2014-05-22
|
35 |
+
|
36 |
+
* Throw an exception if PHP version is not supported.
|
37 |
+
|
38 |
+
=== 1.9.8 2014-05-22
|
39 |
+
|
40 |
+
* Add Internationalization.
|
41 |
+
|
42 |
+
=== 1.9.9 2014-08-06
|
43 |
+
|
44 |
+
* Remove simpletest.
|
45 |
+
* Change YAML to arrays.
|
46 |
+
* Add support for namespaces.
|
47 |
+
* (Thanks to https://github.com/joecohens)
|
48 |
+
|
49 |
+
=== 2.0.0 2016-01-25
|
50 |
+
|
51 |
+
* Add Webhook and WebhookLog models.
|
52 |
+
* Fix Charge specs.
|
53 |
+
|
54 |
+
=== 2.0.1 2016-01-26
|
55 |
+
|
56 |
+
* Fix Util.php for 'url' field name replacement.
|
57 |
+
* Complete specs for offline payments.
|
lib/Conekta/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
|
2 |
+
The MIT License (MIT)
|
3 |
+
|
4 |
+
Copyright (c) 2014 - Conekta, Inc. (https://www.conekta.io)
|
5 |
+
|
6 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
7 |
+
this software and associated documentation files (the "Software"), to deal in
|
8 |
+
the Software without restriction, including without limitation the rights to
|
9 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
10 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
11 |
+
subject to the following conditions:
|
12 |
+
|
13 |
+
The above copyright notice and this permission notice shall be included in all
|
14 |
+
copies or substantial portions of the Software.
|
15 |
+
|
16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
18 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
19 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
20 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
21 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
lib/Conekta/README.md
ADDED
@@ -0,0 +1,86 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
|
2 |
+
![alt tag](https://raw.github.com/conekta/conekta-php/master/readme_files/cover.png)
|
3 |
+
|
4 |
+
# Conekta PHP v.2.0.1
|
5 |
+
|
6 |
+
This is a php library that allows interaction with https://api.conekta.io API.
|
7 |
+
|
8 |
+
## Installation
|
9 |
+
|
10 |
+
Obtain the latest version of the Conekta PHP bindings with:
|
11 |
+
|
12 |
+
git clone https://github.com/conekta/conekta-php
|
13 |
+
|
14 |
+
To get started, add the following to your PHP script:
|
15 |
+
|
16 |
+
require_once("/path/to/conekta-php/lib/Conekta.php");
|
17 |
+
|
18 |
+
You can also install this library with composer:
|
19 |
+
|
20 |
+
require: "conekta/conekta-php": "dev-master"
|
21 |
+
|
22 |
+
## Usage
|
23 |
+
```php
|
24 |
+
Conekta::setApiKey('1tv5yJp3xnVZ7eK67m4h');
|
25 |
+
try {
|
26 |
+
$charge = Conekta_Charge::create(array(
|
27 |
+
"amount"=> 51000,
|
28 |
+
"currency"=> "MXN",
|
29 |
+
"description"=> "Pizza Delivery",
|
30 |
+
"reference_id"=> "orden_de_id_interno",
|
31 |
+
"card"=> $_POST['conektaTokenId']
|
32 |
+
//"tok_a4Ff0dD2xYZZq82d9"
|
33 |
+
));
|
34 |
+
} catch (Conekta_Error $e) {
|
35 |
+
echo $e->getMessage();
|
36 |
+
//El pago no pudo ser procesado
|
37 |
+
}
|
38 |
+
|
39 |
+
{
|
40 |
+
"id": "5286828b8ee31e64b7001739",
|
41 |
+
"livemode": false,
|
42 |
+
"created_at": 1384546955,
|
43 |
+
"status": "paid",
|
44 |
+
"currency": "MXN",
|
45 |
+
"description": "Some desc",
|
46 |
+
"reference_id": null,
|
47 |
+
"failure_code": null,
|
48 |
+
"failure_message": null,
|
49 |
+
"object": "charge",
|
50 |
+
"amount": 2000,
|
51 |
+
"fee": 371,
|
52 |
+
"payment_method": {
|
53 |
+
"name": "Mario Moreno",
|
54 |
+
"exp_month": "05",
|
55 |
+
"exp_year": "15",
|
56 |
+
"auth_code": "861491",
|
57 |
+
"object": "card_payment",
|
58 |
+
"last4": "4242",
|
59 |
+
"brand": "visa"
|
60 |
+
},
|
61 |
+
"details": {
|
62 |
+
"name": null,
|
63 |
+
"phone": null,
|
64 |
+
"email": null,
|
65 |
+
"line_items": []
|
66 |
+
}
|
67 |
+
}
|
68 |
+
```
|
69 |
+
|
70 |
+
## Documentation
|
71 |
+
|
72 |
+
Please see https://www.conekta.io/docs/api for up-to-date documentation.
|
73 |
+
|
74 |
+
## Tests
|
75 |
+
|
76 |
+
In order to run tests you have to install SimpleTest (https://github.com/simpletest/simpletest) via Composer (http://getcomposer.org/) (recommended way):
|
77 |
+
|
78 |
+
composer.phar update --dev
|
79 |
+
|
80 |
+
Run test suite:
|
81 |
+
|
82 |
+
php ./test/Conekta.php
|
83 |
+
|
84 |
+
License
|
85 |
+
-------
|
86 |
+
Developed by [Conekta](https://www.conekta.io). Available with [MIT License](LICENSE).
|
lib/Conekta/composer.json
ADDED
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
{
|
2 |
+
"name": "conekta/conekta-php",
|
3 |
+
"description": "PHP Library",
|
4 |
+
"keywords": [
|
5 |
+
"conekta",
|
6 |
+
"payment processing",
|
7 |
+
"api"
|
8 |
+
],
|
9 |
+
"homepage": "https://www.conekta.io/",
|
10 |
+
"license": "MIT",
|
11 |
+
"authors": [
|
12 |
+
{
|
13 |
+
"name": "Conekta and contributors",
|
14 |
+
"homepage": "https://github.com/conekta/conekta-php/contributors"
|
15 |
+
}
|
16 |
+
],
|
17 |
+
"require": {
|
18 |
+
"php": ">=5.2",
|
19 |
+
"ext-curl": "*",
|
20 |
+
"ext-json": "*",
|
21 |
+
"ext-mbstring": "*"
|
22 |
+
},
|
23 |
+
"require-dev": {
|
24 |
+
"simpletest/simpletest": "*"
|
25 |
+
},
|
26 |
+
"autoload": {
|
27 |
+
"classmap": ["lib/Conekta/"]
|
28 |
+
}
|
29 |
+
}
|
lib/Conekta/lib/Conekta.php
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!function_exists('curl_init')) {
|
4 |
+
throw new Exception('Conekta needs the CURL PHP extension.');
|
5 |
+
}
|
6 |
+
if (!function_exists('json_decode')) {
|
7 |
+
throw new Exception('Conekta needs the JSON PHP extension.');
|
8 |
+
}
|
9 |
+
if (!function_exists('mb_detect_encoding')) {
|
10 |
+
throw new Exception('Conekta needs the Multibyte String PHP extension.');
|
11 |
+
}
|
12 |
+
if (!function_exists('get_called_class')) {
|
13 |
+
throw new Exception('Conekta needs to be run on PHP >= 5.3.0.');
|
14 |
+
}
|
15 |
+
require dirname(__FILE__).'/locales/Lang.php';
|
16 |
+
require dirname(__FILE__).'/Conekta/Conekta.php';
|
17 |
+
require dirname(__FILE__).'/Conekta/Util.php';
|
18 |
+
require dirname(__FILE__).'/Conekta/Requestor.php';
|
19 |
+
require dirname(__FILE__).'/Conekta/Object.php';
|
20 |
+
require dirname(__FILE__).'/Conekta/Resource.php';
|
21 |
+
|
22 |
+
require dirname(__FILE__).'/Conekta/Charge.php';
|
23 |
+
require dirname(__FILE__).'/Conekta/PaymentMethod.php';
|
24 |
+
require dirname(__FILE__).'/Conekta/Customer.php';
|
25 |
+
require dirname(__FILE__).'/Conekta/Card.php';
|
26 |
+
require dirname(__FILE__).'/Conekta/Plan.php';
|
27 |
+
require dirname(__FILE__).'/Conekta/Subscription.php';
|
28 |
+
require dirname(__FILE__).'/Conekta/Token.php';
|
29 |
+
require dirname(__FILE__).'/Conekta/Event.php';
|
30 |
+
require dirname(__FILE__).'/Conekta/Error.php';
|
31 |
+
require dirname(__FILE__).'/Conekta/Payout.php';
|
32 |
+
require dirname(__FILE__).'/Conekta/Payee.php';
|
33 |
+
require dirname(__FILE__).'/Conekta/PayoutMethod.php';
|
34 |
+
require dirname(__FILE__).'/Conekta/Method.php';
|
35 |
+
require dirname(__FILE__).'/Conekta/Address.php';
|
36 |
+
require dirname(__FILE__).'/Conekta/Webhook.php';
|
37 |
+
require dirname(__FILE__).'/Conekta/WebhookLog.php';
|
lib/Conekta/lib/Conekta/Address.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Address extends Conekta_Resource
|
4 |
+
{
|
5 |
+
}
|
lib/Conekta/lib/Conekta/Card.php
ADDED
@@ -0,0 +1,31 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Card extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public function instanceUrl()
|
6 |
+
{
|
7 |
+
$id = $this->id;
|
8 |
+
if (!$id) {
|
9 |
+
throw new Conekta_Error(
|
10 |
+
LANG::translate('error.resource.id', array('RESOURCE' => get_class()), LANG::EN),
|
11 |
+
LANG::translate('error.resource.id_purchaser', null, Conekta::$locale)
|
12 |
+
);
|
13 |
+
}
|
14 |
+
$class = get_class($this);
|
15 |
+
$base = $this->classUrl($class);
|
16 |
+
$extn = urlencode($id);
|
17 |
+
$customerUrl = $this->customer->instanceUrl();
|
18 |
+
|
19 |
+
return "$customerUrl$base/$extn";
|
20 |
+
}
|
21 |
+
|
22 |
+
public function update($params = null)
|
23 |
+
{
|
24 |
+
return self::_update($params);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function delete()
|
28 |
+
{
|
29 |
+
return self::_delete('customer', 'cards');
|
30 |
+
}
|
31 |
+
}
|
lib/Conekta/lib/Conekta/Charge.php
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Charge extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function find($id)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpFind($class, $id);
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function where($params = null)
|
13 |
+
{
|
14 |
+
$class = get_called_class();
|
15 |
+
|
16 |
+
return self::_scpWhere($class, $params);
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function create($params = null)
|
20 |
+
{
|
21 |
+
$class = get_called_class();
|
22 |
+
|
23 |
+
return self::_scpCreate($class, $params);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function capture()
|
27 |
+
{
|
28 |
+
return self::_customAction('post', 'capture', null);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function refund($amount = null)
|
32 |
+
{
|
33 |
+
$params = null;
|
34 |
+
if (isset($amount)) {
|
35 |
+
$params = array('amount' => $amount);
|
36 |
+
}
|
37 |
+
|
38 |
+
return self::_customAction('post', 'refund', $params);
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* @deprecated
|
43 |
+
*/
|
44 |
+
public static function retrieve($id)
|
45 |
+
{
|
46 |
+
$class = get_called_class();
|
47 |
+
|
48 |
+
return self::_scpFind($class, $id);
|
49 |
+
}
|
50 |
+
|
51 |
+
public static function all($params = null)
|
52 |
+
{
|
53 |
+
$class = get_called_class();
|
54 |
+
|
55 |
+
return self::_scpWhere($class, $params);
|
56 |
+
}
|
57 |
+
}
|
lib/Conekta/lib/Conekta/Conekta.php
ADDED
@@ -0,0 +1,25 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Conekta
|
4 |
+
{
|
5 |
+
public static $apiKey;
|
6 |
+
public static $apiBase = 'https://api.conekta.io';
|
7 |
+
public static $apiVersion = '1.0.0';
|
8 |
+
public static $locale = 'es';
|
9 |
+
const VERSION = '1.9.9';
|
10 |
+
|
11 |
+
public static function setApiKey($apiKey)
|
12 |
+
{
|
13 |
+
self::$apiKey = $apiKey;
|
14 |
+
}
|
15 |
+
|
16 |
+
public static function setApiVersion($version)
|
17 |
+
{
|
18 |
+
self::$apiVersion = $version;
|
19 |
+
}
|
20 |
+
|
21 |
+
public static function setLocale($locale)
|
22 |
+
{
|
23 |
+
self::$locale = $locale;
|
24 |
+
}
|
25 |
+
}
|
lib/Conekta/lib/Conekta/Customer.php
ADDED
@@ -0,0 +1,79 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Customer extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public function loadFromArray($values = null)
|
6 |
+
{
|
7 |
+
if (isset($values)) {
|
8 |
+
parent::loadFromArray($values);
|
9 |
+
}
|
10 |
+
foreach ($this->cards as $k => $v) {
|
11 |
+
if (isset($v->deleted) != true) {
|
12 |
+
$v->customer = &$this;
|
13 |
+
$this->cards[$k] = $v;
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
if (isset($this->subscription)) {
|
18 |
+
$this->subscription->customer = &$this;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function find($id)
|
23 |
+
{
|
24 |
+
$class = get_called_class();
|
25 |
+
|
26 |
+
return self::_scpFind($class, $id);
|
27 |
+
}
|
28 |
+
|
29 |
+
public static function where($params = null)
|
30 |
+
{
|
31 |
+
$class = get_called_class();
|
32 |
+
|
33 |
+
return self::_scpWhere($class, $params);
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function create($params = null)
|
37 |
+
{
|
38 |
+
$class = get_called_class();
|
39 |
+
|
40 |
+
return self::_scpCreate($class, $params);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function delete()
|
44 |
+
{
|
45 |
+
return self::_delete();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function update($params = null)
|
49 |
+
{
|
50 |
+
return self::_update($params);
|
51 |
+
}
|
52 |
+
|
53 |
+
public function createCard($params = null)
|
54 |
+
{
|
55 |
+
return self::_createMember('cards', $params);
|
56 |
+
}
|
57 |
+
|
58 |
+
public function createSubscription($params = null)
|
59 |
+
{
|
60 |
+
return self::_createMember('subscription', $params);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* @deprecated
|
65 |
+
*/
|
66 |
+
public static function retrieve($id)
|
67 |
+
{
|
68 |
+
$class = get_called_class();
|
69 |
+
|
70 |
+
return self::_scpFind($class, $id);
|
71 |
+
}
|
72 |
+
|
73 |
+
public static function all($params = null)
|
74 |
+
{
|
75 |
+
$class = get_called_class();
|
76 |
+
|
77 |
+
return self::_scpWhere($class, $params);
|
78 |
+
}
|
79 |
+
}
|
lib/Conekta/lib/Conekta/Error.php
ADDED
@@ -0,0 +1,73 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Error extends Exception
|
4 |
+
{
|
5 |
+
public function __construct($message = null, $message_to_purchaser = null, $type = null, $code = null, $params = null)
|
6 |
+
{
|
7 |
+
parent::__construct($message);
|
8 |
+
$this->message = $message;
|
9 |
+
$this->message_to_purchaser = $message_to_purchaser;
|
10 |
+
$this->type = $type;
|
11 |
+
$this->code = $code;
|
12 |
+
$this->params = $params;
|
13 |
+
}
|
14 |
+
|
15 |
+
public static function errorHandler($resp, $code)
|
16 |
+
{
|
17 |
+
$resp = json_decode($resp, true);
|
18 |
+
$message = isset($resp['message']) ? $resp['message'] : null;
|
19 |
+
$message_to_purchaser = isset($resp['message_to_purchaser']) ? $resp['message_to_purchaser'] : null;
|
20 |
+
$type = isset($resp['type']) ? $resp['type'] : null;
|
21 |
+
$params = isset($resp['param']) ? $resp['param'] : null;
|
22 |
+
if (isset($code) != true || $code == 0) {
|
23 |
+
throw new Conekta_NoConnectionError(
|
24 |
+
LANG::translate('error.requestor.connection', array('BASE' => Conekta::$apiBase), LANG::EN),
|
25 |
+
LANG::translate('error.requestor.connection_purchaser', null, Conekta::$locale),
|
26 |
+
$type, $code, $params);
|
27 |
+
}
|
28 |
+
switch ($code) {
|
29 |
+
case 400:
|
30 |
+
throw new Conekta_MalformedRequestError($message, $message_to_purchaser, $type, $code, $params);
|
31 |
+
case 401:
|
32 |
+
throw new Conekta_AuthenticationError($message, $message_to_purchaser, $type, $code, $params);
|
33 |
+
case 402:
|
34 |
+
throw new Conekta_ProcessingError($message, $message_to_purchaser, $type, $code, $params);
|
35 |
+
case 404:
|
36 |
+
throw new Conekta_ResourceNotFoundError($message, $message_to_purchaser, $type, $code, $params);
|
37 |
+
case 422:
|
38 |
+
throw new Conekta_ParameterValidationError($message, $message_to_purchaser, $type, $code, $params);
|
39 |
+
case 500:
|
40 |
+
throw new Conekta_ApiError($message, $message_to_purchaser, $type, $code, $params);
|
41 |
+
default:
|
42 |
+
throw new self($message, $message_to_purchaser, $type, $code, $params);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
class Conekta_ApiError extends Conekta_Error
|
48 |
+
{
|
49 |
+
}
|
50 |
+
|
51 |
+
class Conekta_NoConnectionError extends Conekta_Error
|
52 |
+
{
|
53 |
+
}
|
54 |
+
|
55 |
+
class Conekta_AuthenticationError extends Conekta_Error
|
56 |
+
{
|
57 |
+
}
|
58 |
+
|
59 |
+
class Conekta_ParameterValidationError extends Conekta_Error
|
60 |
+
{
|
61 |
+
}
|
62 |
+
|
63 |
+
class Conekta_ProcessingError extends Conekta_Error
|
64 |
+
{
|
65 |
+
}
|
66 |
+
|
67 |
+
class Conekta_ResourceNotFoundError extends Conekta_Error
|
68 |
+
{
|
69 |
+
}
|
70 |
+
|
71 |
+
class Conekta_MalformedRequestError extends Conekta_Error
|
72 |
+
{
|
73 |
+
}
|
lib/Conekta/lib/Conekta/Event.php
ADDED
@@ -0,0 +1,21 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Event extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function where($params = null)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpWhere($class, $params);
|
10 |
+
}
|
11 |
+
|
12 |
+
/**
|
13 |
+
* @deprecated
|
14 |
+
*/
|
15 |
+
public static function all($params = null)
|
16 |
+
{
|
17 |
+
$class = get_called_class();
|
18 |
+
|
19 |
+
return self::_scpWhere($class, $params);
|
20 |
+
}
|
21 |
+
}
|
lib/Conekta/lib/Conekta/Method.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Method extends Conekta_Resource
|
4 |
+
{
|
5 |
+
}
|
lib/Conekta/lib/Conekta/Object.php
ADDED
@@ -0,0 +1,70 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Object extends ArrayObject
|
4 |
+
{
|
5 |
+
protected $_values;
|
6 |
+
|
7 |
+
public function __construct($id = null)
|
8 |
+
{
|
9 |
+
$this->_values = array();
|
10 |
+
$this->id = $id;
|
11 |
+
}
|
12 |
+
|
13 |
+
public function _setVal($k, $v)
|
14 |
+
{
|
15 |
+
$this->_values[$k] = $v;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function _unsetKey($k)
|
19 |
+
{
|
20 |
+
unset($this->_values[$k]);
|
21 |
+
}
|
22 |
+
|
23 |
+
public function loadFromArray($values)
|
24 |
+
{
|
25 |
+
foreach ($values as $k => $v) {
|
26 |
+
if (is_array($v)) {
|
27 |
+
$v = Conekta_Util::convertToConektaObject($v);
|
28 |
+
}
|
29 |
+
if (strpos(get_class($this), 'Conekta_Object') !== false) {
|
30 |
+
$this[$k] = $v;
|
31 |
+
} else {
|
32 |
+
if (strpos($k, 'url') !== false && strpos(get_class($this), 'Conekta_Webhook') !== false) {
|
33 |
+
$k = "webhook_url";
|
34 |
+
}
|
35 |
+
$this->$k = $v;
|
36 |
+
}
|
37 |
+
$this->_setVal($k, $v);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function __toJSON()
|
42 |
+
{
|
43 |
+
if (defined('JSON_PRETTY_PRINT')) {
|
44 |
+
return json_encode($this->_toArray(), JSON_PRETTY_PRINT);
|
45 |
+
} else {
|
46 |
+
return json_encode($this->_toArray());
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
protected function _toArray()
|
51 |
+
{
|
52 |
+
$array = array();
|
53 |
+
foreach ($this->_values as $k => $v) {
|
54 |
+
if (is_object($v) == true && strpos(get_class($v), 'Conekta_') !== false) {
|
55 |
+
if (empty($v->_values) != true) {
|
56 |
+
$array[$k] = $v->_toArray();
|
57 |
+
}
|
58 |
+
} else {
|
59 |
+
$array[$k] = $v;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
return $array;
|
64 |
+
}
|
65 |
+
|
66 |
+
public function __toString()
|
67 |
+
{
|
68 |
+
return $this->__toJSON();
|
69 |
+
}
|
70 |
+
}
|
lib/Conekta/lib/Conekta/Payee.php
ADDED
@@ -0,0 +1,57 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Payee extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public function loadFromArray($values = null)
|
6 |
+
{
|
7 |
+
if (isset($values)) {
|
8 |
+
parent::loadFromArray($values);
|
9 |
+
}
|
10 |
+
foreach ($this->payout_methods as $k => $v) {
|
11 |
+
if (isset($v->deleted) != true) {
|
12 |
+
$v->payee = &$this;
|
13 |
+
$this->payout_methods[$k] = $v;
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
if (isset($this->subscription)) {
|
18 |
+
$this->subscription->customer = &$this;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function find($id)
|
23 |
+
{
|
24 |
+
$class = get_called_class();
|
25 |
+
|
26 |
+
return self::_scpFind($class, $id);
|
27 |
+
}
|
28 |
+
|
29 |
+
public static function where($params = null)
|
30 |
+
{
|
31 |
+
$class = get_called_class();
|
32 |
+
|
33 |
+
return self::_scpWhere($class, $params);
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function create($params = null)
|
37 |
+
{
|
38 |
+
$class = get_called_class();
|
39 |
+
|
40 |
+
return self::_scpCreate($class, $params);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function delete()
|
44 |
+
{
|
45 |
+
return self::_delete();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function update($params = null)
|
49 |
+
{
|
50 |
+
return self::_update($params);
|
51 |
+
}
|
52 |
+
|
53 |
+
public function createPayoutMethod($params = null)
|
54 |
+
{
|
55 |
+
return self::_createMember('payout_methods', $params);
|
56 |
+
}
|
57 |
+
}
|
lib/Conekta/lib/Conekta/PaymentMethod.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Payment_Method extends Conekta_Resource
|
4 |
+
{
|
5 |
+
}
|
lib/Conekta/lib/Conekta/Payout.php
ADDED
@@ -0,0 +1,25 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Payout extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function find($id)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpFind($class, $id);
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function where($params = null)
|
13 |
+
{
|
14 |
+
$class = get_called_class();
|
15 |
+
|
16 |
+
return self::_scpWhere($class, $params);
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function create($params = null)
|
20 |
+
{
|
21 |
+
$class = get_called_class();
|
22 |
+
|
23 |
+
return self::_scpCreate($class, $params);
|
24 |
+
}
|
25 |
+
}
|
lib/Conekta/lib/Conekta/PayoutMethod.php
ADDED
@@ -0,0 +1,31 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Payout_Method extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public function instanceUrl()
|
6 |
+
{
|
7 |
+
$id = $this->id;
|
8 |
+
if (!$id) {
|
9 |
+
throw new Conekta_Error(
|
10 |
+
LANG::translate('error.resource.id', array('RESOURCE' => get_class()), LANG::EN),
|
11 |
+
LANG::translate('error.resource.id_purchaser', null, Conekta::$locale)
|
12 |
+
);
|
13 |
+
}
|
14 |
+
$class = get_class($this);
|
15 |
+
$base = $this->classUrl($class);
|
16 |
+
$extn = urlencode($id);
|
17 |
+
$payeeUrl = $this->payee->instanceUrl();
|
18 |
+
|
19 |
+
return "$payeeUrl$base/$extn";
|
20 |
+
}
|
21 |
+
|
22 |
+
public function update($params = null)
|
23 |
+
{
|
24 |
+
return self::_update($params);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function delete()
|
28 |
+
{
|
29 |
+
return self::_delete('payee', 'payout_methods');
|
30 |
+
}
|
31 |
+
}
|
lib/Conekta/lib/Conekta/Plan.php
ADDED
@@ -0,0 +1,52 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Plan extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function find($id)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpFind($class, $id);
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function create($params = null)
|
13 |
+
{
|
14 |
+
$class = get_called_class();
|
15 |
+
|
16 |
+
return self::_scpCreate($class, $params);
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function where($params = null)
|
20 |
+
{
|
21 |
+
$class = get_called_class();
|
22 |
+
|
23 |
+
return self::_scpWhere($class, $params);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function delete()
|
27 |
+
{
|
28 |
+
return self::_delete();
|
29 |
+
}
|
30 |
+
|
31 |
+
public function update($params = null)
|
32 |
+
{
|
33 |
+
return self::_update($params);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @deprecated
|
38 |
+
*/
|
39 |
+
public static function retrieve($id)
|
40 |
+
{
|
41 |
+
$class = get_called_class();
|
42 |
+
|
43 |
+
return self::_scpFind($class, $id);
|
44 |
+
}
|
45 |
+
|
46 |
+
public static function all($params = null)
|
47 |
+
{
|
48 |
+
$class = get_called_class();
|
49 |
+
|
50 |
+
return self::_scpWhere($class, $params);
|
51 |
+
}
|
52 |
+
}
|
lib/Conekta/lib/Conekta/Requestor.php
ADDED
@@ -0,0 +1,120 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Requestor
|
4 |
+
{
|
5 |
+
public $apiKey;
|
6 |
+
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
$this->apiKey = Conekta::$apiKey;
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function apiUrl($url = '')
|
13 |
+
{
|
14 |
+
$apiBase = Conekta::$apiBase;
|
15 |
+
|
16 |
+
return "$apiBase$url";
|
17 |
+
}
|
18 |
+
|
19 |
+
private function setHeaders()
|
20 |
+
{
|
21 |
+
$user_agent = array(
|
22 |
+
'bindings_version' => Conekta::VERSION,
|
23 |
+
'lang' => 'php',
|
24 |
+
'lang_version' => phpversion(),
|
25 |
+
'publisher' => 'conekta',
|
26 |
+
'uname' => php_uname(),
|
27 |
+
);
|
28 |
+
|
29 |
+
$headers = array(
|
30 |
+
'Accept: application/vnd.conekta-v'.Conekta::$apiVersion.'+json',
|
31 |
+
'Accept-Language: '.Conekta::$locale,
|
32 |
+
'X-Conekta-Client-User-Agent: '.json_encode($user_agent),
|
33 |
+
'User-Agent: Conekta/v1 PhpBindings/'.Conekta::VERSION,
|
34 |
+
'Authorization: Basic '.base64_encode($this->apiKey.':'),
|
35 |
+
);
|
36 |
+
|
37 |
+
return $headers;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function request($meth, $url, $params = null)
|
41 |
+
{
|
42 |
+
$params = self::encode($params);
|
43 |
+
$headers = $this->setHeaders();
|
44 |
+
$curl = curl_init();
|
45 |
+
$meth = strtolower($meth);
|
46 |
+
$opts = array();
|
47 |
+
$query = '';
|
48 |
+
if (count($params) > 0) {
|
49 |
+
$query = '?'.$params;
|
50 |
+
}
|
51 |
+
switch ($meth) {
|
52 |
+
case 'get':
|
53 |
+
$opts[CURLOPT_HTTPGET] = 1;
|
54 |
+
$url = $url.$query;
|
55 |
+
break;
|
56 |
+
case 'post':
|
57 |
+
$opts[CURLOPT_POST] = 1;
|
58 |
+
$opts[CURLOPT_POSTFIELDS] = $params;
|
59 |
+
break;
|
60 |
+
case 'put':
|
61 |
+
$opts[CURLOPT_RETURNTRANSFER] = 1;
|
62 |
+
$opts[CURLOPT_CUSTOMREQUEST] = 'PUT';
|
63 |
+
$opts[CURLOPT_POSTFIELDS] = $params;
|
64 |
+
break;
|
65 |
+
case 'delete':
|
66 |
+
$opts[CURLOPT_CUSTOMREQUEST] = 'DELETE';
|
67 |
+
$url = $url.$query;
|
68 |
+
break;
|
69 |
+
default:
|
70 |
+
throw new Exception('Wrong method');
|
71 |
+
}
|
72 |
+
$url = $this->apiUrl($url);
|
73 |
+
$opts[CURLOPT_URL] = $url;
|
74 |
+
$opts[CURLOPT_RETURNTRANSFER] = true;
|
75 |
+
$opts[CURLOPT_CONNECTTIMEOUT] = 30;
|
76 |
+
$opts[CURLOPT_TIMEOUT] = 80;
|
77 |
+
$opts[CURLOPT_RETURNTRANSFER] = true;
|
78 |
+
$opts[CURLOPT_HTTPHEADER] = $headers;
|
79 |
+
$opts[CURLOPT_CAINFO] = dirname(__FILE__).'/../ssl_data/ca_bundle.crt';
|
80 |
+
curl_setopt_array($curl, $opts);
|
81 |
+
$response = curl_exec($curl);
|
82 |
+
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
83 |
+
curl_close($curl);
|
84 |
+
if ($response_code != 200) {
|
85 |
+
Conekta_Error::errorHandler($response, $response_code);
|
86 |
+
}
|
87 |
+
|
88 |
+
return json_decode($response, true);
|
89 |
+
}
|
90 |
+
|
91 |
+
public static function encode($arr, $prefix = null)
|
92 |
+
{
|
93 |
+
if (!is_array($arr)) {
|
94 |
+
return $arr;
|
95 |
+
}
|
96 |
+
$r = array();
|
97 |
+
foreach ($arr as $k => $v) {
|
98 |
+
if (is_null($v)) {
|
99 |
+
continue;
|
100 |
+
}
|
101 |
+
|
102 |
+
if ($prefix && $k && !is_int($k)) {
|
103 |
+
$k = $prefix.'['.$k.']';
|
104 |
+
} elseif ($prefix) {
|
105 |
+
$k = $prefix.'[]';
|
106 |
+
}
|
107 |
+
|
108 |
+
if (is_array($v)) {
|
109 |
+
$r[] = self::encode($v, $k, true);
|
110 |
+
} else {
|
111 |
+
if (is_bool($v)) {
|
112 |
+
$v = $v ? 'true' : 'false';
|
113 |
+
}
|
114 |
+
$r[] = urlencode($k).'='.urlencode($v);
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
+
return implode('&', $r);
|
119 |
+
}
|
120 |
+
}
|
lib/Conekta/lib/Conekta/Resource.php
ADDED
@@ -0,0 +1,157 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Conekta_Resource extends Conekta_Object
|
4 |
+
{
|
5 |
+
public static function className($class)
|
6 |
+
{
|
7 |
+
// Useful for namespaces: Foo\Conekta_Charge
|
8 |
+
if ($postfix = strrchr($class, '\\')) {
|
9 |
+
$class = substr($postfix, 1);
|
10 |
+
}
|
11 |
+
if (substr($class, 0, strlen('Conekta')) == 'Conekta') {
|
12 |
+
$class = substr($class, strlen('Conekta'));
|
13 |
+
}
|
14 |
+
$class = str_replace('_', '', $class);
|
15 |
+
$name = urlencode($class);
|
16 |
+
$name = strtolower($name);
|
17 |
+
|
18 |
+
return $name;
|
19 |
+
}
|
20 |
+
|
21 |
+
protected static function _getBase($class, $method)
|
22 |
+
{
|
23 |
+
$args = array_slice(func_get_args(), 2);
|
24 |
+
|
25 |
+
return call_user_func_array(array($class, $method), $args);
|
26 |
+
}
|
27 |
+
|
28 |
+
public static function classUrl($class = null)
|
29 |
+
{
|
30 |
+
if (!$class) {
|
31 |
+
$class = get_class($this);
|
32 |
+
}
|
33 |
+
$base = self::_getBase($class, 'className', $class);
|
34 |
+
|
35 |
+
return "/${base}s";
|
36 |
+
}
|
37 |
+
|
38 |
+
protected static function _scpWhere($class, $params)
|
39 |
+
{
|
40 |
+
$instance = new Conekta_Object();
|
41 |
+
$requestor = new Conekta_Requestor();
|
42 |
+
$url = self::classUrl($class);
|
43 |
+
$response = $requestor->request('get', $url, $params);
|
44 |
+
$instance->loadFromArray($response);
|
45 |
+
|
46 |
+
return $instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
protected static function _scpFind($class, $id)
|
50 |
+
{
|
51 |
+
$instance = new $class($id);
|
52 |
+
$requestor = new Conekta_Requestor();
|
53 |
+
$url = $instance->instanceUrl();
|
54 |
+
$response = $requestor->request('get', $url);
|
55 |
+
$instance->loadFromArray($response);
|
56 |
+
|
57 |
+
return $instance;
|
58 |
+
}
|
59 |
+
|
60 |
+
protected static function _scpCreate($class, $params)
|
61 |
+
{
|
62 |
+
$requestor = new Conekta_Requestor();
|
63 |
+
$url = self::classUrl($class);
|
64 |
+
$response = $requestor->request('post', $url, $params);
|
65 |
+
$instance = new $class();
|
66 |
+
$instance->loadFromArray($response);
|
67 |
+
|
68 |
+
return $instance;
|
69 |
+
}
|
70 |
+
|
71 |
+
public function instanceUrl()
|
72 |
+
{
|
73 |
+
$id = $this->id;
|
74 |
+
if (!$id) {
|
75 |
+
throw new Conekta_Error(
|
76 |
+
LANG::translate('error.resource.id', array('RESOURCE' => get_class()), LANG::EN),
|
77 |
+
LANG::translate('error.resource.id_purchaser', null, Conekta::$locale)
|
78 |
+
);
|
79 |
+
}
|
80 |
+
$class = get_class($this);
|
81 |
+
$base = $this->classUrl($class);
|
82 |
+
$extn = urlencode($id);
|
83 |
+
|
84 |
+
return "$base/$extn";
|
85 |
+
}
|
86 |
+
|
87 |
+
protected function _delete($parent = null, $member = null)
|
88 |
+
{
|
89 |
+
self::_customAction('delete', null, null);
|
90 |
+
if (isset($parent) && isset($member)) {
|
91 |
+
$obj = $this->$parent->$member;
|
92 |
+
if (strpos(get_class($obj), 'Conekta_Object') !== false) {
|
93 |
+
foreach ($this->$parent->$member as $k => $v) {
|
94 |
+
if (strpos($v->id, $this->id) !== false) {
|
95 |
+
$this->$parent->$member->_values = Conekta_Util::shiftArray($this->$parent->$member->_values, $k);
|
96 |
+
$this->$parent->$member->loadFromArray($this->$parent->$member->_values);
|
97 |
+
$this->$parent->$member->offsetUnset(count($this->$parent->$member) - 1);
|
98 |
+
break;
|
99 |
+
}
|
100 |
+
}
|
101 |
+
} else {
|
102 |
+
unset($this->$parent->$member);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
return $this;
|
107 |
+
}
|
108 |
+
|
109 |
+
protected function _update($params)
|
110 |
+
{
|
111 |
+
$requestor = new Conekta_Requestor();
|
112 |
+
$url = $this->instanceUrl();
|
113 |
+
$response = $requestor->request('put', $url, $params);
|
114 |
+
$this->loadFromArray($response);
|
115 |
+
|
116 |
+
return $this;
|
117 |
+
}
|
118 |
+
|
119 |
+
protected function _createMember($member, $params)
|
120 |
+
{
|
121 |
+
$requestor = new Conekta_Requestor();
|
122 |
+
$url = $this->instanceUrl().'/'.$member;
|
123 |
+
$response = $requestor->request('post', $url, $params);
|
124 |
+
if (strpos(get_class($this->$member), 'Conekta_Object') !== false || strpos($member, 'cards') !== false || strpos($member, 'payout_methods') !== false) {
|
125 |
+
if (empty($this->$member)) {
|
126 |
+
$this->$member = new Conekta_Object();
|
127 |
+
}
|
128 |
+
$this->$member->loadFromArray(array_merge($this->$member->_toArray(), array($response)));
|
129 |
+
$this->loadFromArray();
|
130 |
+
$instances = $this->$member;
|
131 |
+
$instance = end($instances);
|
132 |
+
} else {
|
133 |
+
$class = 'Conekta_'.ucfirst($member);
|
134 |
+
$instance = new $class();
|
135 |
+
$instance->loadFromArray($response);
|
136 |
+
$this->$member = $instance;
|
137 |
+
$this->_setVal($member, $instance);
|
138 |
+
$this->loadFromArray();
|
139 |
+
}
|
140 |
+
|
141 |
+
return $instance;
|
142 |
+
}
|
143 |
+
|
144 |
+
protected function _customAction($method = 'post', $action = null, $params = null)
|
145 |
+
{
|
146 |
+
$requestor = new Conekta_Requestor();
|
147 |
+
if (isset($action)) {
|
148 |
+
$url = $this->instanceUrl().'/'.$action;
|
149 |
+
} else {
|
150 |
+
$url = $this->instanceUrl();
|
151 |
+
}
|
152 |
+
$response = $requestor->request($method, $url, $params);
|
153 |
+
$this->loadFromArray($response);
|
154 |
+
|
155 |
+
return $this;
|
156 |
+
}
|
157 |
+
}
|
lib/Conekta/lib/Conekta/Subscription.php
ADDED
@@ -0,0 +1,40 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Subscription extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public function instanceUrl()
|
6 |
+
{
|
7 |
+
$id = $this->id;
|
8 |
+
if (!$id) {
|
9 |
+
throw new Conekta_Error(
|
10 |
+
LANG::translate('error.resource.id', array('RESOURCE' => get_class()), LANG::EN),
|
11 |
+
LANG::translate('error.resource.id_purchaser', null, Conekta::$locale)
|
12 |
+
);
|
13 |
+
}
|
14 |
+
$class = get_class($this);
|
15 |
+
$base = '/subscription';
|
16 |
+
$customerUrl = $this->customer->instanceUrl();
|
17 |
+
|
18 |
+
return "$customerUrl$base";
|
19 |
+
}
|
20 |
+
|
21 |
+
public function update($params = null)
|
22 |
+
{
|
23 |
+
return self::_update($params);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function cancel()
|
27 |
+
{
|
28 |
+
return self::_customAction('post', 'cancel');
|
29 |
+
}
|
30 |
+
|
31 |
+
public function pause()
|
32 |
+
{
|
33 |
+
return self::_customAction('post', 'pause');
|
34 |
+
}
|
35 |
+
|
36 |
+
public function resume()
|
37 |
+
{
|
38 |
+
return self::_customAction('post', 'resume');
|
39 |
+
}
|
40 |
+
}
|
lib/Conekta/lib/Conekta/Token.php
ADDED
@@ -0,0 +1,28 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Token extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function find($id)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpFind($class, $id);
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function create($params = null)
|
13 |
+
{
|
14 |
+
$class = get_called_class();
|
15 |
+
|
16 |
+
return self::_scpCreate($class, $params);
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @deprecated
|
21 |
+
*/
|
22 |
+
public static function retrieve($id)
|
23 |
+
{
|
24 |
+
$class = get_called_class();
|
25 |
+
|
26 |
+
return self::_scpFind($class, $id);
|
27 |
+
}
|
28 |
+
}
|
lib/Conekta/lib/Conekta/Util.php
ADDED
@@ -0,0 +1,68 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class Conekta_Util
|
4 |
+
{
|
5 |
+
public static $types = array(
|
6 |
+
'webhook' => 'Conekta_Webhook',
|
7 |
+
'webhook_log' => 'Conekta_WebhookLog',
|
8 |
+
'billing_address' => 'Conekta_Address',
|
9 |
+
'bank_transfer_payout_method' => 'Conekta_Method',
|
10 |
+
'payout' => 'Conekta_Payout',
|
11 |
+
'payee' => 'Conekta_Payee',
|
12 |
+
'payout_method' => 'Conekta_Payout_Method',
|
13 |
+
'card_payment' => 'Conekta_Payment_Method',
|
14 |
+
'cash_payment' => 'Conekta_Payment_Method',
|
15 |
+
'bank_transfer_payment' => 'Conekta_Payment_Method',
|
16 |
+
'card' => 'Conekta_Card',
|
17 |
+
'charge' => 'Conekta_Charge',
|
18 |
+
'customer' => 'Conekta_Customer',
|
19 |
+
'event' => 'Conekta_Event',
|
20 |
+
'plan' => 'Conekta_Plan',
|
21 |
+
'subscription' => 'Conekta_Subscription'
|
22 |
+
);
|
23 |
+
|
24 |
+
public static function convertToConektaObject($resp)
|
25 |
+
{
|
26 |
+
$types = self::$types;
|
27 |
+
if (is_array($resp)) {
|
28 |
+
if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) {
|
29 |
+
$class = $types[$resp['object']];
|
30 |
+
$instance = new $class();
|
31 |
+
$instance->loadFromArray($resp);
|
32 |
+
|
33 |
+
return $instance;
|
34 |
+
}
|
35 |
+
if (isset($resp['street1']) || isset($resp['street2'])) {
|
36 |
+
$class = 'Conekta_Address';
|
37 |
+
$instance = new $class();
|
38 |
+
$instance->loadFromArray($resp);
|
39 |
+
|
40 |
+
return $instance;
|
41 |
+
}
|
42 |
+
if (current($resp)) {
|
43 |
+
$instance = new Conekta_Object();
|
44 |
+
$instance->loadFromArray($resp);
|
45 |
+
|
46 |
+
return $instance;
|
47 |
+
}
|
48 |
+
|
49 |
+
return new Conekta_Object();
|
50 |
+
}
|
51 |
+
|
52 |
+
return $resp;
|
53 |
+
}
|
54 |
+
|
55 |
+
public static function shiftArray($array, $k)
|
56 |
+
{
|
57 |
+
unset($array[$k]);
|
58 |
+
end($array);
|
59 |
+
$lastKey = key($array);
|
60 |
+
|
61 |
+
for ($i = $k; $i < $lastKey; ++$i) {
|
62 |
+
$array[$i] = $array[$i + 1];
|
63 |
+
unset($array[$i + 1]);
|
64 |
+
}
|
65 |
+
|
66 |
+
return $array;
|
67 |
+
}
|
68 |
+
}
|
lib/Conekta/lib/Conekta/Webhook.php
ADDED
@@ -0,0 +1,35 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_Webhook extends Conekta_Resource
|
4 |
+
{
|
5 |
+
public static function find($id)
|
6 |
+
{
|
7 |
+
$class = get_called_class();
|
8 |
+
|
9 |
+
return self::_scpFind($class, $id);
|
10 |
+
}
|
11 |
+
|
12 |
+
public static function where($params = null)
|
13 |
+
{
|
14 |
+
$class = get_called_class();
|
15 |
+
|
16 |
+
return self::_scpWhere($class, $params);
|
17 |
+
}
|
18 |
+
|
19 |
+
public static function create($params = null)
|
20 |
+
{
|
21 |
+
$class = get_called_class();
|
22 |
+
|
23 |
+
return self::_scpCreate($class, $params);
|
24 |
+
}
|
25 |
+
|
26 |
+
public function delete()
|
27 |
+
{
|
28 |
+
return self::_delete();
|
29 |
+
}
|
30 |
+
|
31 |
+
public function update($params = null)
|
32 |
+
{
|
33 |
+
return self::_update($params);
|
34 |
+
}
|
35 |
+
}
|
lib/Conekta/lib/Conekta/WebhookLog.php
ADDED
@@ -0,0 +1,5 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_WebhookLog extends Conekta_Resource
|
4 |
+
{
|
5 |
+
}
|
lib/Conekta/lib/locales/Lang.php
ADDED
@@ -0,0 +1,49 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Lang
|
4 |
+
{
|
5 |
+
const EN = 'en';
|
6 |
+
const ES = 'es';
|
7 |
+
|
8 |
+
protected static $cache = array();
|
9 |
+
|
10 |
+
public static function translate($key, $parameters = null, $locale)
|
11 |
+
{
|
12 |
+
$langs = self::readDirectory(dirname(__FILE__).'/messages');
|
13 |
+
|
14 |
+
$keys = explode('.', $locale.'.'.$key);
|
15 |
+
$result = $langs[array_shift($keys)];
|
16 |
+
foreach ($keys as $v) {
|
17 |
+
$result = $result[$v];
|
18 |
+
}
|
19 |
+
if (is_array($parameters) && !empty($parameters)) {
|
20 |
+
foreach ($parameters as $k => $v) {
|
21 |
+
$result = str_replace($k, $v, $result);
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
return $result;
|
26 |
+
}
|
27 |
+
|
28 |
+
protected static function readDirectory($directory)
|
29 |
+
{
|
30 |
+
if (!empty(self::$cache)) {
|
31 |
+
return self::$cache;
|
32 |
+
}
|
33 |
+
|
34 |
+
$langs = array();
|
35 |
+
if ($handle = opendir($directory)) {
|
36 |
+
while ($lang = readdir($handle)) {
|
37 |
+
if (strpos($lang, '.php') !== false) {
|
38 |
+
$langKey = str_replace('.php', '', $lang);
|
39 |
+
$langs[$langKey] = include $directory.'/'.$lang;
|
40 |
+
}
|
41 |
+
}
|
42 |
+
closedir($handle);
|
43 |
+
}
|
44 |
+
|
45 |
+
self::$cache = $langs;
|
46 |
+
|
47 |
+
return $langs;
|
48 |
+
}
|
49 |
+
}
|
lib/Conekta/lib/locales/messages/en.php
ADDED
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return array(
|
4 |
+
'error' => array(
|
5 |
+
'resource' => array(
|
6 |
+
'id' => 'Could not get the id of RESOURCE instance.',
|
7 |
+
'id_purchaser' => 'There was an error. Please contact system administrator.',
|
8 |
+
),
|
9 |
+
'requestor' => array(
|
10 |
+
'connection' => 'Could not connect to BASE.',
|
11 |
+
'connection_purchaser' => 'Could not connect to payment system.',
|
12 |
+
),
|
13 |
+
),
|
14 |
+
);
|
lib/Conekta/lib/locales/messages/es.php
ADDED
@@ -0,0 +1,14 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return array(
|
4 |
+
'error' => array(
|
5 |
+
'resource' => array(
|
6 |
+
'id' => 'No se pudo obtener el id de la instancia de RESOURCE.',
|
7 |
+
'id_purchaser' => 'Hubo un error. Favor de contactar al administrador del sistema.',
|
8 |
+
),
|
9 |
+
'requestor' => array(
|
10 |
+
'connection' => 'No se pudo conectar a BASE.',
|
11 |
+
'connection_purchaser' => 'No se pudo conectar al sistema de pagos.',
|
12 |
+
),
|
13 |
+
),
|
14 |
+
);
|
lib/Conekta/lib/ssl_data/ca_bundle.crt
ADDED
@@ -0,0 +1,66 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
#Bundled Digicerts
|
2 |
+
DigiCert Assured ID Root CA
|
3 |
+
===========================
|
4 |
+
-----BEGIN CERTIFICATE-----
|
5 |
+
MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG
|
6 |
+
EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw
|
7 |
+
IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx
|
8 |
+
MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL
|
9 |
+
ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew
|
10 |
+
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO
|
11 |
+
9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy
|
12 |
+
UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW
|
13 |
+
/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy
|
14 |
+
oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf
|
15 |
+
GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF
|
16 |
+
66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq
|
17 |
+
hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc
|
18 |
+
EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn
|
19 |
+
SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i
|
20 |
+
8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
|
21 |
+
+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
|
22 |
+
-----END CERTIFICATE-----
|
23 |
+
|
24 |
+
DigiCert Global Root CA
|
25 |
+
=======================
|
26 |
+
-----BEGIN CERTIFICATE-----
|
27 |
+
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
|
28 |
+
EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
|
29 |
+
HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
|
30 |
+
MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
|
31 |
+
dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
|
32 |
+
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
|
33 |
+
TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
|
34 |
+
BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
|
35 |
+
4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
|
36 |
+
7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
|
37 |
+
o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
|
38 |
+
8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
|
39 |
+
BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
|
40 |
+
EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
|
41 |
+
tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
|
42 |
+
UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
|
43 |
+
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
|
44 |
+
-----END CERTIFICATE-----
|
45 |
+
|
46 |
+
DigiCert High Assurance EV Root CA
|
47 |
+
==================================
|
48 |
+
-----BEGIN CERTIFICATE-----
|
49 |
+
MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG
|
50 |
+
EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw
|
51 |
+
KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw
|
52 |
+
MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ
|
53 |
+
MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu
|
54 |
+
Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t
|
55 |
+
Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS
|
56 |
+
OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3
|
57 |
+
MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ
|
58 |
+
NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe
|
59 |
+
h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB
|
60 |
+
Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY
|
61 |
+
JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ
|
62 |
+
V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp
|
63 |
+
myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK
|
64 |
+
mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
|
65 |
+
vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K
|
66 |
+
-----END CERTIFICATE-----
|
lib/Conekta/readme_files/cover.png
ADDED
Binary file
|
lib/Conekta/test/Conekta.php
ADDED
@@ -0,0 +1,52 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Set Api key for testing
|
4 |
+
function setApiKey()
|
5 |
+
{
|
6 |
+
$apiEnvKey = getenv('CONEKTA_API');
|
7 |
+
if (!$apiEnvKey) {
|
8 |
+
$apiEnvKey = '1tv5yJp3xnVZ7eK67m4h';
|
9 |
+
}
|
10 |
+
Conekta::setApiKey($apiEnvKey);
|
11 |
+
}
|
12 |
+
function unsetApiKey()
|
13 |
+
{
|
14 |
+
if (isset($env) == false) {
|
15 |
+
$env = Conekta::setApiKey('');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
|
19 |
+
// Load test suite via composer or manually
|
20 |
+
$test_suite = @include_once dirname(__FILE__).'/simpletest/autorun.php';
|
21 |
+
|
22 |
+
if (!$test_suite) {
|
23 |
+
$test_suite = @include_once dirname(__FILE__).'/../vendor/simpletest/simpletest/autorun.php';
|
24 |
+
}
|
25 |
+
|
26 |
+
if (!$test_suite) {
|
27 |
+
echo 'Test cases depend on SimpleTest.'.
|
28 |
+
'Download it at <http://www.simpletest.org/>, and either install it '.
|
29 |
+
"in your PHP include_path or put it in the test/ directory.\n";
|
30 |
+
exit(1);
|
31 |
+
}
|
32 |
+
|
33 |
+
// Throw an exception on any error
|
34 |
+
function exception_error_handler($errno, $errstr, $errfile, $errline)
|
35 |
+
{
|
36 |
+
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
|
37 |
+
}
|
38 |
+
|
39 |
+
set_error_handler('exception_error_handler');
|
40 |
+
error_reporting(E_ALL | E_STRICT);
|
41 |
+
|
42 |
+
// Load Conekta lib
|
43 |
+
require_once dirname(__FILE__).'/../lib/Conekta.php';
|
44 |
+
|
45 |
+
// Include tests
|
46 |
+
require_once dirname(__FILE__).'/Conekta/ChargeTest.php';
|
47 |
+
require_once dirname(__FILE__).'/Conekta/CustomerTest.php';
|
48 |
+
require_once dirname(__FILE__).'/Conekta/EventTest.php';
|
49 |
+
require_once dirname(__FILE__).'/Conekta/PlanTest.php';
|
50 |
+
require_once dirname(__FILE__).'/Conekta/ErrorTest.php';
|
51 |
+
require_once dirname(__FILE__).'/Conekta/PayoutTest.php';
|
52 |
+
require_once dirname(__FILE__).'/Conekta/WebhookTest.php';
|
lib/Conekta/test/Conekta/ChargeTest.php
ADDED
@@ -0,0 +1,179 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_ChargeTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_payment_method = array(
|
6 |
+
'amount' => 2000,
|
7 |
+
'currency' => 'mxn',
|
8 |
+
'description' => 'Some desc',
|
9 |
+
'details'=> array(
|
10 |
+
'name'=> 'Arnulfo Quimare',
|
11 |
+
'phone'=> '403-342-0642',
|
12 |
+
'email'=> 'logan@x-men.org',
|
13 |
+
'customer'=> array(
|
14 |
+
'logged_in'=> true,
|
15 |
+
'successful_purchases'=> 14,
|
16 |
+
'created_at'=> 1379784950,
|
17 |
+
'updated_at'=> 1379784950,
|
18 |
+
'offline_payments'=> 4,
|
19 |
+
'score'=> 9
|
20 |
+
),
|
21 |
+
'line_items'=> array(
|
22 |
+
array(
|
23 |
+
'name'=> 'Box of Cohiba S1s',
|
24 |
+
'description'=> 'Imported From Mex.',
|
25 |
+
'unit_price'=> 20000,
|
26 |
+
'quantity'=> 1,
|
27 |
+
'sku'=> 'cohb_s1',
|
28 |
+
'category'=> 'food'
|
29 |
+
)
|
30 |
+
)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
public static $intvalid_payment_method = array(
|
35 |
+
'amount' => 10,
|
36 |
+
'currency' => 'mxn',
|
37 |
+
'description' => 'Some desc',
|
38 |
+
'details'=> array(
|
39 |
+
'name'=> 'Arnulfo Quimare',
|
40 |
+
'phone'=> '403-342-0642',
|
41 |
+
'email'=> 'logan@x-men.org',
|
42 |
+
'customer'=> array(
|
43 |
+
'logged_in'=> true,
|
44 |
+
'successful_purchases'=> 14,
|
45 |
+
'created_at'=> 1379784950,
|
46 |
+
'updated_at'=> 1379784950,
|
47 |
+
'offline_payments'=> 4,
|
48 |
+
'score'=> 9
|
49 |
+
),
|
50 |
+
'line_items'=> array(
|
51 |
+
array(
|
52 |
+
'name'=> 'Box of Cohiba S1s',
|
53 |
+
'description'=> 'Imported From Mex.',
|
54 |
+
'unit_price'=> 20000,
|
55 |
+
'quantity'=> 1,
|
56 |
+
'sku'=> 'cohb_s1',
|
57 |
+
'category'=> 'food'
|
58 |
+
)
|
59 |
+
)
|
60 |
+
)
|
61 |
+
);
|
62 |
+
|
63 |
+
public static $valid_visa_card = array('card' => 'tok_test_visa_4242');
|
64 |
+
|
65 |
+
public function testSuccesfulFindCharge()
|
66 |
+
{
|
67 |
+
$pm = self::$valid_payment_method;
|
68 |
+
$card = self::$valid_visa_card;
|
69 |
+
setApiKey();
|
70 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card));
|
71 |
+
$this->assertTrue($cpm->status == 'paid');
|
72 |
+
$pm = Conekta_Charge::find($cpm->id);
|
73 |
+
$this->assertTrue(strpos(get_class($pm), 'Conekta_Charge') !== false);
|
74 |
+
}
|
75 |
+
|
76 |
+
public function testSuccesfulWhere()
|
77 |
+
{
|
78 |
+
setApiKey();
|
79 |
+
$charges = Conekta_Charge::where();
|
80 |
+
$this->assertTrue(strpos(get_class($charges), 'Conekta_Object') !== false);
|
81 |
+
$this->assertTrue(strpos(get_class($charges[0]), 'Conekta_Charge') !== false);
|
82 |
+
}
|
83 |
+
|
84 |
+
public function testSuccesfulBankPMCreate()
|
85 |
+
{
|
86 |
+
$pm = self::$valid_payment_method;
|
87 |
+
$bank = array('bank' => array('type' => 'banorte'));
|
88 |
+
setApiKey();
|
89 |
+
$bpm = Conekta_Charge::create(array_merge($pm, $bank));
|
90 |
+
$this->assertTrue($bpm->payment_method->service_number == "127589");
|
91 |
+
$this->assertTrue($bpm->payment_method->service_name == "Conekta");
|
92 |
+
$this->assertTrue(intval($bpm->payment_method->reference) > 0);
|
93 |
+
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
94 |
+
$this->assertTrue($bpm->status == 'pending_payment');
|
95 |
+
}
|
96 |
+
|
97 |
+
public function testSuccesfulSpeiPMCreate()
|
98 |
+
{
|
99 |
+
$pm = self::$valid_payment_method;
|
100 |
+
$spei = array('bank' => array('type' => 'spei'));
|
101 |
+
setApiKey();
|
102 |
+
$bpm = Conekta_Charge::create(array_merge($pm, $spei));
|
103 |
+
$this->assertTrue($bpm->payment_method->bank == "STP");
|
104 |
+
$this->assertTrue(intval($bpm->payment_method->clabe) > 0);
|
105 |
+
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
106 |
+
$this->assertTrue($bpm->status == 'pending_payment');
|
107 |
+
}
|
108 |
+
|
109 |
+
public function testSuccesfulCardPMCreate()
|
110 |
+
{
|
111 |
+
$pm = self::$valid_payment_method;
|
112 |
+
$card = self::$valid_visa_card;
|
113 |
+
setApiKey();
|
114 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card));
|
115 |
+
$this->assertTrue($cpm->status == 'paid');
|
116 |
+
}
|
117 |
+
|
118 |
+
public function testSuccesfulOxxoPMCreate()
|
119 |
+
{
|
120 |
+
$pm = self::$valid_payment_method;
|
121 |
+
$oxxo = array('cash' => array('type' => 'oxxo'));
|
122 |
+
setApiKey();
|
123 |
+
$opm = Conekta_Charge::create(array_merge($pm, $oxxo));
|
124 |
+
$this->assertTrue($opm->payment_method->barcode_url == "http://s3.amazonaws.com/cash_payment_barcodes/12345678901234567890123456789012.png");
|
125 |
+
$this->assertTrue($opm->payment_method->barcode == "12345678901234567890123456789012");
|
126 |
+
$this->assertTrue(is_numeric($opm->payment_method->expires_at));
|
127 |
+
$this->assertTrue($opm->payment_method->store_name == "OXXO");
|
128 |
+
$this->assertTrue($opm->status == 'pending_payment');
|
129 |
+
}
|
130 |
+
|
131 |
+
public function testUnsuccesfulPMCreate()
|
132 |
+
{
|
133 |
+
$pm = self::$intvalid_payment_method;
|
134 |
+
$card = self::$valid_visa_card;
|
135 |
+
setApiKey();
|
136 |
+
try {
|
137 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card));
|
138 |
+
} catch (Exception $e) {
|
139 |
+
$this->assertTrue(strpos($e->getMessage(), 'The minimum for card payments is 3 pesos. Check that the amount is in cents as explained in the documentation.') !== false);
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function testSuccesfulRefund()
|
144 |
+
{
|
145 |
+
$pm = self::$valid_payment_method;
|
146 |
+
$card = self::$valid_visa_card;
|
147 |
+
setApiKey();
|
148 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card));
|
149 |
+
$this->assertTrue($cpm->status == 'paid');
|
150 |
+
$cpm->refund();
|
151 |
+
$this->assertTrue($cpm->status == 'refunded');
|
152 |
+
}
|
153 |
+
|
154 |
+
public function testUnsuccesfulRefund()
|
155 |
+
{
|
156 |
+
$pm = self::$valid_payment_method;
|
157 |
+
$card = self::$valid_visa_card;
|
158 |
+
setApiKey();
|
159 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card));
|
160 |
+
$this->assertTrue($cpm->status == 'paid');
|
161 |
+
try {
|
162 |
+
$cpm->refund(3000);
|
163 |
+
} catch (Exception $e) {
|
164 |
+
$this->assertTrue(strpos($e->getMessage(), 'The amount to refund exceeds the charge total') !== false);
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
public function testSuccesfulCapture()
|
169 |
+
{
|
170 |
+
$pm = self::$valid_payment_method;
|
171 |
+
$card = self::$valid_visa_card;
|
172 |
+
$capture = array('capture' => false);
|
173 |
+
setApiKey();
|
174 |
+
$cpm = Conekta_Charge::create(array_merge($pm, $card, $capture));
|
175 |
+
$this->assertTrue($cpm->status == 'pre_authorized');
|
176 |
+
$cpm->capture();
|
177 |
+
$this->assertTrue($cpm->status == 'paid');
|
178 |
+
}
|
179 |
+
}
|
lib/Conekta/test/Conekta/CustomerTest.php
ADDED
@@ -0,0 +1,157 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_CustomerTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulCustomerCreate()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
9 |
+
$this->assertTrue(strpos(get_class($customer), 'Conekta_Customer') !== false);
|
10 |
+
}
|
11 |
+
|
12 |
+
public function testSuccesfulCustomerFind()
|
13 |
+
{
|
14 |
+
setApiKey();
|
15 |
+
$c = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
16 |
+
$customer = Conekta_Customer::find($c->id);
|
17 |
+
$this->assertTrue(strpos(get_class($customer), 'Conekta_Customer') !== false);
|
18 |
+
}
|
19 |
+
|
20 |
+
public function testSuccesfulCustomerWhere()
|
21 |
+
{
|
22 |
+
setApiKey();
|
23 |
+
$customers = Conekta_Customer::where();
|
24 |
+
$this->assertTrue(strpos(get_class($customers), 'Conekta_Object') !== false);
|
25 |
+
$this->assertTrue(strpos(get_class($customers[0]), 'Conekta_Customer') !== false);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function testSuccesfulDeleteCustomer()
|
29 |
+
{
|
30 |
+
setApiKey();
|
31 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
32 |
+
$customer->delete();
|
33 |
+
$this->assertTrue($customer->deleted == true);
|
34 |
+
}
|
35 |
+
|
36 |
+
public function testSuccesfulCustomerUpdate()
|
37 |
+
{
|
38 |
+
setApiKey();
|
39 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
40 |
+
$customer->update(
|
41 |
+
array(
|
42 |
+
'name' => 'Logan',
|
43 |
+
'email' => 'logan@x-men.org',
|
44 |
+
));
|
45 |
+
$this->assertTrue(strpos($customer->name, 'Logan') !== false);
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testUnsuccesfulCustomerCreate()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
try {
|
52 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4241')));
|
53 |
+
} catch (Exception $e) {
|
54 |
+
$this->assertTrue(strpos($e->getMessage(), 'Object tok_test_visa_4241 could not be found.') !== false);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
public function testAddCardToCustomer()
|
59 |
+
{
|
60 |
+
setApiKey();
|
61 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
62 |
+
$customer->createCard(array('token' => 'tok_test_visa_1881'));
|
63 |
+
$this->assertTrue(strpos(end($customer->cards)->last4, '1881') !== false);
|
64 |
+
}
|
65 |
+
|
66 |
+
public function testDeleteCard()
|
67 |
+
{
|
68 |
+
setApiKey();
|
69 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
70 |
+
$card = $customer->cards[0]->delete();
|
71 |
+
$this->assertTrue($card->deleted == true);
|
72 |
+
}
|
73 |
+
|
74 |
+
public function testUpdateCard()
|
75 |
+
{
|
76 |
+
setApiKey();
|
77 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
78 |
+
$customer->cards[0]->update(array('token' => 'tok_test_mastercard_4444', 'active' => false));
|
79 |
+
$this->assertTrue(strpos($customer->cards[0]->last4, '4444') !== false);
|
80 |
+
}
|
81 |
+
|
82 |
+
public function testSuccesfulSubscriptionCreate()
|
83 |
+
{
|
84 |
+
setApiKey();
|
85 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
86 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
87 |
+
$this->assertTrue(strpos(get_class($subscription), 'Conekta_Subscription') !== false);
|
88 |
+
}
|
89 |
+
|
90 |
+
public function testSuccesfulSubscriptionUpdate()
|
91 |
+
{
|
92 |
+
setApiKey();
|
93 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
94 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
95 |
+
try {
|
96 |
+
$plan = Conekta_Plan::find('gold-plan2');
|
97 |
+
} catch (Exception $e) {
|
98 |
+
// Plan does not exist
|
99 |
+
$plan = Conekta_Plan::create(array(
|
100 |
+
'id' => 'gold-plan2',
|
101 |
+
'name' => 'Gold Plan',
|
102 |
+
'amount' => 10000,
|
103 |
+
'currency' => 'MXN',
|
104 |
+
'interval' => 'month',
|
105 |
+
'frequency' => 1,
|
106 |
+
'trial_period_days' => 15,
|
107 |
+
'expiry_count' => 12,
|
108 |
+
)
|
109 |
+
);
|
110 |
+
}
|
111 |
+
$subscription->update(array('plan' => $plan->id));
|
112 |
+
$this->assertTrue(strpos($subscription->plan_id, 'gold-plan2') !== false);
|
113 |
+
}
|
114 |
+
|
115 |
+
public function testUnsuccesfulSubscriptionCreate()
|
116 |
+
{
|
117 |
+
setApiKey();
|
118 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
119 |
+
try {
|
120 |
+
$subscription = $customer->createSubscription(array(
|
121 |
+
'plan' => 'unexistent-plan', ));
|
122 |
+
} catch (Exception $e) {
|
123 |
+
$this->assertTrue(strpos($e->getMessage(), 'Object Plan unexistent-plan could not be found.') !== false);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
public function testSuccesfulSubscriptionPause()
|
128 |
+
{
|
129 |
+
setApiKey();
|
130 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
131 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
132 |
+
$this->assertTrue(strpos(get_class($subscription), 'Conekta_Subscription') !== false);
|
133 |
+
$subscription->pause();
|
134 |
+
$this->assertTrue(strpos($subscription->status, 'paused') !== false);
|
135 |
+
}
|
136 |
+
|
137 |
+
public function testSuccesfulSubscriptionResume()
|
138 |
+
{
|
139 |
+
setApiKey();
|
140 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
141 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
142 |
+
$this->assertTrue(strpos(get_class($subscription), 'Conekta_Subscription') !== false);
|
143 |
+
$subscription->pause();
|
144 |
+
$subscription->resume();
|
145 |
+
$this->assertTrue(strpos($subscription->status, 'in_trial') !== false);
|
146 |
+
}
|
147 |
+
|
148 |
+
public function testSuccesfulSubscriptionCancel()
|
149 |
+
{
|
150 |
+
setApiKey();
|
151 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
152 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
153 |
+
$this->assertTrue(strpos(get_class($subscription), 'Conekta_Subscription') !== false);
|
154 |
+
$subscription->cancel();
|
155 |
+
$this->assertTrue(strpos($subscription->status, 'canceled') !== false);
|
156 |
+
}
|
157 |
+
}
|
lib/Conekta/test/Conekta/ErrorTest.php
ADDED
@@ -0,0 +1,85 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_ErrorTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testNoIdError()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
try {
|
9 |
+
$charge = Conekta_Charge::find('0');
|
10 |
+
} catch (Exception $e) {
|
11 |
+
$this->assertTrue(strpos($e->getMessage(), 'Could not get the id of Conekta_Resource instance.') !== false);
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
public function testNoConnectionError()
|
16 |
+
{
|
17 |
+
$apiUrl = Conekta::$apiBase;
|
18 |
+
Conekta::$apiBase = 'http://localhost:3001';
|
19 |
+
try {
|
20 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
21 |
+
} catch (Exception $e) {
|
22 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_NoConnectionError') !== false);
|
23 |
+
}
|
24 |
+
Conekta::$apiBase = $apiUrl;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function testApiError()
|
28 |
+
{
|
29 |
+
setApiKey();
|
30 |
+
try {
|
31 |
+
$customer = Conekta_Customer::create(array('cards' => array(0 => 'tok_test_visa_4242')));
|
32 |
+
} catch (Exception $e) {
|
33 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_ApiError') !== false);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
public function testAuthenticationError()
|
38 |
+
{
|
39 |
+
unsetApiKey();
|
40 |
+
try {
|
41 |
+
$customer = Conekta_Customer::create(array('cards' => array('tok_test_visa_4242')));
|
42 |
+
} catch (Exception $e) {
|
43 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_AuthenticationError') !== false);
|
44 |
+
}
|
45 |
+
setApiKey();
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testParameterValidationError()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
try {
|
52 |
+
$plan = Conekta_Plan::create(array('id' => 'gold-plan'));
|
53 |
+
} catch (Exception $e) {
|
54 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_ParameterValidationError') !== false);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
public function testProcessingError()
|
59 |
+
{
|
60 |
+
$charges = Conekta_Charge::where();
|
61 |
+
foreach ($charges as $charge) {
|
62 |
+
if (strpos($charge->status, 'pre_authorized') !== false) {
|
63 |
+
$ok = true;
|
64 |
+
continue;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
try {
|
68 |
+
if (isset($ok)) {
|
69 |
+
$charge->capture();
|
70 |
+
}
|
71 |
+
} catch (Exception $e) {
|
72 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_ProcessingError') !== false);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
public function testResourceNotFoundError()
|
77 |
+
{
|
78 |
+
setApiKey();
|
79 |
+
try {
|
80 |
+
$charge = Conekta_Charge::find('1');
|
81 |
+
} catch (Exception $e) {
|
82 |
+
$this->assertTrue(strpos(get_class($e), 'Conekta_ResourceNotFoundError') !== false);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
lib/Conekta/test/Conekta/EventTest.php
ADDED
@@ -0,0 +1,12 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_EventTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulWhere()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$events = Conekta_Event::where();
|
9 |
+
$this->assertTrue(strpos(get_class($events), 'Conekta_Object') !== false);
|
10 |
+
$this->assertTrue(strpos(get_class($events[0]), 'Conekta_Event') !== false);
|
11 |
+
}
|
12 |
+
}
|
lib/Conekta/test/Conekta/PayoutTest.php
ADDED
@@ -0,0 +1,59 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_PayoutTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulGetPayout()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$payee = Conekta_Payee::create(array(
|
9 |
+
'name' => 'John Doe',
|
10 |
+
'email' => 'j_d@radcorp->com',
|
11 |
+
'phone' => '555555555',
|
12 |
+
'bank' => array(
|
13 |
+
'account_number' => '032180000118359719',
|
14 |
+
'account_holder' => 'J D - Radcorp',
|
15 |
+
'description' => 'Conekta To JD',
|
16 |
+
'statement_description' => 'Conekta To JD 111111111',
|
17 |
+
'statement_reference' => '111111111',
|
18 |
+
),
|
19 |
+
'billing_address' => array(
|
20 |
+
'company_name' => 'Rad Corp',
|
21 |
+
'tax_id' => 'tax121212abc',
|
22 |
+
'street1' => 'Guadalupe 73',
|
23 |
+
'street2' => 'Despacho 32',
|
24 |
+
'street3' => 'Condesa',
|
25 |
+
'city' => 'Cuauhtemoc',
|
26 |
+
'state' => 'DF',
|
27 |
+
'country' => 'MX',
|
28 |
+
'zip' => '06100',
|
29 |
+
),
|
30 |
+
));
|
31 |
+
$this->assertTrue(strpos(get_class($payee), 'Conekta_Payee') !== false);
|
32 |
+
$this->assertTrue(strpos('555555555', $payee->phone) !== false);
|
33 |
+
$this->assertTrue(strpos('032180000118359719', $payee->payout_methods[0]->account_number) !== false);
|
34 |
+
$this->assertTrue(strpos('J D - Radcorp', $payee->payout_methods[0]->account_holder) !== false);
|
35 |
+
$this->assertTrue(strpos('ixe', $payee->payout_methods[0]->bank) !== false);
|
36 |
+
$this->assertTrue(isset($payee->default_payout_method_id));
|
37 |
+
|
38 |
+
$this->assertTrue(strpos('Conekta To JD', $payee->payout_methods[0]->description) !== false);
|
39 |
+
$this->assertTrue(strpos('Conekta To JD 111111111', $payee->payout_methods[0]->statement_description) !== false);
|
40 |
+
$this->assertTrue(strpos('111111111', $payee->payout_methods[0]->statement_reference) !== false);
|
41 |
+
$this->assertTrue(strpos('Rad Corp', $payee->billing_address->company_name) !== false);
|
42 |
+
$this->assertTrue(strpos('tax121212abc', $payee->billing_address->tax_id) !== false);
|
43 |
+
$this->assertTrue(strpos('06100', $payee->billing_address->zip) !== false);
|
44 |
+
|
45 |
+
$payout = Conekta_Payout::create(array(
|
46 |
+
'amount' => 5000,
|
47 |
+
'currency' => 'MXN',
|
48 |
+
'payee' => $payee->id,
|
49 |
+
));
|
50 |
+
$this->assertTrue(strpos(get_class($payout), 'Conekta_Payout') !== false);
|
51 |
+
$this->assertTrue(5000 == $payout->amount);
|
52 |
+
$this->assertTrue(strpos('MXN', $payout->currency) !== false);
|
53 |
+
|
54 |
+
$this->assertTrue(strpos('032180000118359719', $payout->method->account_number) !== false);
|
55 |
+
$this->assertTrue(strpos('J D - Radcorp', $payout->method->account_holder) !== false);
|
56 |
+
$this->assertTrue(strpos('ixe', $payout->method->bank) !== false);
|
57 |
+
//$this->assertTrue(count($payout->transactions) == 0); // Not it the response
|
58 |
+
}
|
59 |
+
}
|
lib/Conekta/test/Conekta/PlanTest.php
ADDED
@@ -0,0 +1,56 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_PlanTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulGetPlan()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$plans = Conekta_Plan::where();
|
9 |
+
$p = $plans[0];
|
10 |
+
$plan = Conekta_Plan::find($p->id);
|
11 |
+
$this->assertTrue(strpos(get_class($plan), 'Conekta_Plan') !== false);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function testSuccesfulWhere()
|
15 |
+
{
|
16 |
+
setApiKey();
|
17 |
+
$plans = Conekta_Plan::where();
|
18 |
+
$this->assertTrue(strpos(get_class($plans), 'Conekta_Object') !== false);
|
19 |
+
$this->assertTrue(strpos(get_class($plans[0]), 'Conekta_Plan') !== false);
|
20 |
+
}
|
21 |
+
|
22 |
+
public function testSuccesfulPlanCreate()
|
23 |
+
{
|
24 |
+
setApiKey();
|
25 |
+
$plans = Conekta_Plan::where();
|
26 |
+
$plan = Conekta_Plan::create(array(
|
27 |
+
'id' => 'gold-plan'.substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0, 50), 1).substr(md5(time()), 1),
|
28 |
+
'name' => 'Gold Plan',
|
29 |
+
'amount' => 10000,
|
30 |
+
'currency' => 'MXN',
|
31 |
+
'interval' => 'month',
|
32 |
+
'frequency' => 10,
|
33 |
+
'trial_period_days' => 15,
|
34 |
+
'expiry_count' => 12,
|
35 |
+
));
|
36 |
+
$this->assertTrue(strpos(get_class($plan), 'Conekta_Plan') !== false);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function testUpdatePlan()
|
40 |
+
{
|
41 |
+
setApiKey();
|
42 |
+
$plans = Conekta_Plan::where();
|
43 |
+
$plan = $plans[0];
|
44 |
+
$plan->update(array('name' => 'Silver Plan'));
|
45 |
+
$this->assertTrue(strpos($plan->name, 'Silver Plan') !== false);
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testDeletePlan()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
$plans = Conekta_Plan::where();
|
52 |
+
$plan = $plans[0];
|
53 |
+
$plan->delete();
|
54 |
+
$this->assertTrue($plan->deleted == true);
|
55 |
+
}
|
56 |
+
}
|
lib/Conekta/test/Conekta/TokenTest.php
ADDED
@@ -0,0 +1,11 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_TokenTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulGetToken()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$token = Conekta_Plan::find('tok_test_visa_4242');
|
9 |
+
$this->assertTrue(strpos(get_class($token), 'Conekta_Token') !== false);
|
10 |
+
}
|
11 |
+
}
|
lib/Conekta/test/Conekta/WebhookTest.php
ADDED
@@ -0,0 +1,31 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Conekta_WebhookTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $events = array("events" =>
|
6 |
+
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
7 |
+
"charge.fraudulent", "charge.refunded", "charge.created", "customer.created",
|
8 |
+
"customer.updated", "customer.deleted", "webhook.created", "webhook.updated",
|
9 |
+
"webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated",
|
10 |
+
"charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won",
|
11 |
+
"payout.created", "payout.retrying", "payout.paid_out", "payout.failed",
|
12 |
+
"plan.created", "plan.updated", "plan.deleted", "subscription.created",
|
13 |
+
"subscription.paused", "subscription.resumed", "subscription.canceled",
|
14 |
+
"subscription.expired", "subscription.updated", "subscription.paid",
|
15 |
+
"subscription.payment_failed", "payee.created", "payee.updated",
|
16 |
+
"payee.deleted", "payee.payout_method.created",
|
17 |
+
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
18 |
+
|
19 |
+
public static $url = array("url" => "http://localhost:3000/my_listener");
|
20 |
+
|
21 |
+
public function testSuccesfulWebhookCreate()
|
22 |
+
{
|
23 |
+
setApiKey();
|
24 |
+
$webhook = Conekta_Webhook::create(array_merge(self::$url, self::$events));
|
25 |
+
$this->assertTrue(strpos(get_class($webhook), 'Conekta_Webhook') !== false);
|
26 |
+
$this->assertTrue(strpos($webhook->webhook_url, self::$url["url"]) !== false);
|
27 |
+
$webhook->update(array("url" => "http://localhost:2000/my_listener"));
|
28 |
+
$this->assertTrue(strpos($webhook->webhook_url, "http://localhost:2000/my_listener") !== false);
|
29 |
+
$webhook->delete();
|
30 |
+
}
|
31 |
+
}
|
package.xml
ADDED
@@ -0,0 +1,37 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Conekta_Payment_Extension</name>
|
4 |
+
<version>0.5.5</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="https://github.com/conekta/conekta-magento/blob/master/LICENSE">MTIL</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>This extension allows you to process online and offline payments in your checkout using Conekta API.</summary>
|
10 |
+
<description>This extension includes the following payment methods that you can add to your checkout:&#xD;
|
11 |
+
- Credit Card Payment.
|
12 |
+
- Bank Transfer Payment.
|
13 |
+
- Oxxo Payment.
|
14 |
+
- Spei Payment.
|
15 |
+

|
16 |
+
This plugin is compatible with the One Page Checkout extension and OneStepCheckout.&#xD;
|
17 |
+
http://www.magentocommerce.com/magento-connect/one-page-checkout.html&#xD;
|
18 |
+
http://www.onestepcheckout.com/</description>
|
19 |
+
<notes>Support for PHP 5.6.4
|
20 |
+
Support for IWD_OPC checkout.
|
21 |
+
Support for OneStepCheckout.
|
22 |
+
Support for Monthly Installments and Config.
|
23 |
+
Support for fraud detection in all pages.
|
24 |
+
Add custom fields to card purchases for fraud detection.
|
25 |
+
Add fields to card module for Riskified compatibility.
|
26 |
+
Add fields to all modules for shipment details.
|
27 |
+
Add Webhook module management.
|
28 |
+
Add locale.
|
29 |
+
Add detailed payment information in admin.
|
30 |
+
Add detailed payment information on successful payment.</notes>
|
31 |
+
<authors><author><name>Mauricio Murga</name><user>MauricioMurga</user><email>mauricio@conekta.io</email></author></authors>
|
32 |
+
<date>2016-01-29</date>
|
33 |
+
<time>21:04:52</time>
|
34 |
+
<contents><target name="magecommunity"><dir name="Conekta"><dir name="Bank"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="3ea1dbfd5e3a757d7359eac096fe2de7"/><file name="Days.php" hash="cd07792e8ed27ec523838a9c2675eaf6"/></dir></dir></dir><dir name="Form"><file name="Bank.php" hash="22618b41a43a559ac18c59ae1d19b908"/></dir><dir name="Info"><file name="Bank.php" hash="7e1d809555dcabb68883a8cc427af303"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c86a3d8a0a6409f98de883fe39c18282"/></dir><dir name="Model"><file name="Bank.php" hash="05eea071a9f3f1c5ea9241e03bae7928"/><file name="Observer.php" hash="740bb2f03f8e646c9896826b909a9b7b"/></dir><dir name="etc"><file name="config.xml" hash="3182e53030fa573cd94ad062bfb3d15b"/><file name="system.xml" hash="ace3a23971997be4bd4029e161a0d2bc"/></dir><dir name="sql"><dir name="bank_setup"><file name="mysql4-install-0.1.0.php" hash="db6e167f787814f665ec2078131d8f4b"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="694caabbb883534a63339c5f1ffaf04a"/><file name="mysql4-upgrade-0.2.1-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="96b8c0c80405296bf04fb86c3e5892d4"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="75c12f7b8c88cb74009398ea3cc086b7"/></dir><file name=".DS_Store" hash="47e0b610aac11c5633634c52734a353e"/></dir><file name=".DS_Store" hash="6a204c3670cd256d0f1feec0fe8236fb"/></dir><dir name="Card"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Installments.php" hash="7c828e5dc74f4cd717408bf5de48cf21"/></dir></dir></dir><dir name="Form"><file name="Card.php" hash="cbf6f16bacacaf8df45025a8a800fcd0"/></dir><dir name="Info"><file name="Card.php" hash="32ed58d7763b8697395cb2aee5008642"/></dir><dir name="Page"><dir name="Html"><file name="Head.php" hash="62602ff6206bf8b94d24a905b0229a43"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5a279dbd0f0cf90324dab9f597069272"/></dir><dir name="Model"><file name="Card.php" hash="e3b9aa104b15a294119bc2a2a1cdbdcf"/><file name="Observer.php" hash="b98f234af2dff2d32ee5a753805e592c"/></dir><dir name="etc"><file name="config.xml" hash="fd1a5abb4739579bfc499cceaeddd110"/><file name="system.xml" hash="419203bc2d4c8f99dd8020c06a37bccf"/></dir><dir name="sql"><dir name="card_setup"><file name="mysql4-install-0.1.0.php" hash="92381e3159990a46c7dd674c0d4205c1"/><file name="mysql4-upgrade-0.1.0-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="384467a7e6370c5731364738f7d3e00e"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="8b74e1986cd1731f32cde85d32b9c9a6"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="bbef6e1db0b868aabfcdb164b3784720"/></dir><file name=".DS_Store" hash="502345c9ac1d5a10aff81c481a9f79cf"/></dir><file name=".DS_Store" hash="6a204c3670cd256d0f1feec0fe8236fb"/></dir><dir name="Oxxo"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="37145f64cbb2110f5a13bdca7a72fe5a"/><file name="Days.php" hash="341151ef5d2a0a4698b570b2df808035"/></dir></dir></dir><dir name="Form"><file name="Oxxo.php" hash="b4ea3507621a3cc55e7682b5b40ca494"/></dir><dir name="Info"><file name="Oxxo.php" hash="5971309dd65d108462164148b1bbfcf2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="815b0990e244ba098fd0772adcb6ff80"/></dir><dir name="Model"><file name="Observer.php" hash="5464d6b26dd6ff18e2b2cb9f1e940380"/><file name="Oxxo.php" hash="35df4edece58fbb38064ff5f4c0e7f06"/></dir><dir name="etc"><file name="config.xml" hash="ce3fe8f35a69d530af65a02942a83d03"/><file name="system.xml" hash="355914552e096428c683eebfec4b9e4e"/></dir><dir name="sql"><dir name="oxxo_setup"><file name="mysql4-install-0.1.0.php" hash="2362488b3b0d450132f7991cb1648c74"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="5ac7a7c41e38ddab259c9ea252b69877"/><file name="mysql4-upgrade-0.1.9-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="804a2e066d14851e5dba303f14daf050"/></dir><file name=".DS_Store" hash="309d218723e6292aea46b8c05a64aa2e"/></dir><file name=".DS_Store" hash="6a204c3670cd256d0f1feec0fe8236fb"/></dir><dir name="Realtime"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="2e3bfc37584c1bd3a8908fb505d387ef"/><file name="Days.php" hash="703e1e0155075e69148de33cae3b1405"/></dir></dir></dir><dir name="Form"><file name="Realtime.php" hash="f91d10d074548d90dd57aa68caa6724d"/></dir><dir name="Info"><file name="Realtime.php" hash="3791a8315135a4ae97c2788fa7d7c019"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b370f1d0bfc208a27ce800f026e4e335"/></dir><dir name="Model"><file name="Observer.php" hash="9571886d61627391a167cd30ea9ff87a"/><file name="Realtime.php" hash="98b191eee860e47481a2da94dc3f06f5"/></dir><dir name="etc"><file name="config.xml" hash="8b42068a36d9670531d71c810e288872"/><file name="system.xml" hash="8be164ff2af425b3ffea2ee3d94bf92f"/></dir><dir name="sql"><dir name="realtime_setup"><file name="mysql4-install-0.1.0.php" hash="101a3dfd8e9b8159a21bba1f70cbace1"/><file name="mysql4-upgrade-0.1.0-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="bbef6e1db0b868aabfcdb164b3784720"/></dir><file name=".DS_Store" hash="66a399016ff966c6a85d1a371d3d1e28"/></dir><file name=".DS_Store" hash="6a204c3670cd256d0f1feec0fe8236fb"/></dir><dir name="Spei"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="4fd0b98355269c5168956746710d4e31"/><file name="Days.php" hash="bb7a0c3189a0f337fdba4fd7b1f35f33"/></dir></dir></dir><dir name="Form"><file name="Spei.php" hash="11f305f6ed1f924f2c1924e3713f1136"/></dir><dir name="Info"><file name="Spei.php" hash="714d7003f7d336e5a531b8a2ccda1150"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0a9c69b0acac3ace1f110fc6446f42ae"/></dir><dir name="Model"><file name="Observer.php" hash="4ed7b1aaed910311176989491267788f"/><file name="Spei.php" hash="ca4d43c380f0b308c6722af74a647d69"/></dir><dir name="etc"><file name="config.xml" hash="b782a9682a3e4eea01491e578b733b10"/><file name="system.xml" hash="ab5aad7dd3f67efe8be8968fd9ace626"/></dir><dir name="sql"><dir name="spei_setup"><file name="mysql4-install-0.1.0.php" hash="43006151eb2d8e278cdaf483db52f277"/><file name="mysql4-upgrade-0.2.5-0.2.6.php" hash="8baf3e2e26a0e4841de6e6c76326819a"/><file name="mysql4-upgrade-0.2.6-0.3.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.0-0.3.1.php" hash="ab5be6e3abb5cd4281f96a712346c05f"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="f48fb7da9cc5db68c860f1c51b51d70c"/></dir><file name=".DS_Store" hash="027dad64e84d254d412d6f39df6f7cde"/></dir><file name=".DS_Store" hash="6a204c3670cd256d0f1feec0fe8236fb"/></dir><dir name="Webhook"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="d1cbb0f00a624d088d5c55d96434db98"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Url.php" hash="e934357df272602d5628bd373f3be64e"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="68c2234a7573e0b6fd5f57a623fcade4"/></dir><dir name="controllers"><file name="AjaxController.php" hash="e2ccbbb262240a5050b96f11f3e25214"/></dir><dir name="etc"><file name="config.xml" hash="11a8a2bcd4c1023ac4aef04f7318df6e"/><file name="system.xml" hash="6c5e6a5a4bbe126735d48d3bd2cb9ea9"/><file name=".DS_Store" hash="5c1d51d504074ee8fa5010ff7b26ca40"/></dir><file name=".DS_Store" hash="39ce30c7220d0a806f8a2613ad47a33e"/></dir><file name=".DS_Store" hash="9bf3a6c270b260488027fa9d8c41218d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Conekta_Card.xml" hash="0e54ddadeeb68f84eccd4f793779d2f4"/><file name="Conekta_Oxxo.xml" hash="4f0b2ebdd76cd58c816676d50074fa6a"/><file name="Conekta_Spei.xml" hash="9db396a5b3eea128d8004e211139cd67"/><file name="Conekta_Webhook.xml" hash="a20f99746029abc92a3d42aae1d62b52"/></dir></target><target name="magelib"><dir name="Conekta"><file name="CHANGELOG" hash="807826243c471b7f58545775cb9bd699"/><file name="LICENSE" hash="5504ebddc2becac4fcf24734b28632ae"/><file name="README.md" hash="27522a458fbe9a7fbe2b2369322b4896"/><file name="composer.json" hash="3102c308e10a0752bef69d30150c5ca1"/><file name="composer.lock" hash="14cf81f275ada3fa4f646e64a2983b3b"/><dir name="lib"><dir name="Conekta"><file name="Address.php" hash="53f9ead73473bd89c56b179e0e560acb"/><file name="Card.php" hash="cac03a528b206b146aa2e436fb74a593"/><file name="Charge.php" hash="0c069edf9f724195722deb5a2c48758f"/><file name="Conekta.php" hash="d33f560469d55c396a2bc7da7c02935c"/><file name="Customer.php" hash="a6f5c47456c01f65a982a812a3988c00"/><file name="Error.php" hash="7d2a0415932005786e57b22fad2941ef"/><file name="Event.php" hash="4e4a5d5bc4fd42c37a447f101ba50e0d"/><file name="Method.php" hash="28fa98bc684b14d469adc5a9c10bce26"/><file name="Object.php" hash="d02888627d6507813b118966f8c9c3b7"/><file name="Payee.php" hash="3d545baa5137218df1f2f306b20da8b1"/><file name="PaymentMethod.php" hash="82da8783050670d22fbd040f34f1c2fd"/><file name="Payout.php" hash="9e5c96c08df0436e417deca2edf692d8"/><file name="PayoutMethod.php" hash="2e2dec5d433e50354dbccd6ef23e8f1a"/><file name="Plan.php" hash="12d5a54fe163994f5e97b934129a8d8d"/><file name="Requestor.php" hash="81f478b675d65f2cd89692499c1ad72c"/><file name="Resource.php" hash="53df6df376c6f141e84595ed782b8baa"/><file name="Subscription.php" hash="f2a63686b2d5e85cb3627c1426665db5"/><file name="Token.php" hash="2b953723bb06b7ff7701d28d080b052d"/><file name="Util.php" hash="bb5f089ba557b775fe59281f9bb398ad"/><file name="Webhook.php" hash="2fffba414d2f831694f6e15511f9583d"/><file name="WebhookLog.php" hash="b053454f7b376bbc4ccffe99b489a1de"/></dir><file name="Conekta.php" hash="77678a889d7ff90dc87fe0a2a4f91fe3"/><dir name="locales"><file name="Lang.php" hash="1f39bf36ddb6dfe123a5a717fbc52d86"/><dir name="messages"><file name="en.php" hash="e298057a1876c6dbd9644b1c7e1bacde"/><file name="es.php" hash="32dd54b605441a97da212302a3bb0979"/></dir></dir><dir name="ssl_data"><file name="ca_bundle.crt" hash="035148c907bab6ccfca027cca4842f48"/></dir><file name=".DS_Store" hash="c49abc60c55d4b9e4b3de8291eb9dcb5"/></dir><dir name="readme_files"><file name="cover.png" hash="43d4fa2e91aa504f40c1da5542cd324c"/></dir><dir name="test"><dir name="Conekta"><file name="ChargeTest.php" hash="59938a84bbe8648dca1c86914c6bceb2"/><file name="CustomerTest.php" hash="c89ed5cd1d93948335a35d83cf9d2b52"/><file name="ErrorTest.php" hash="27170b2fe55c81cfc50a2c30adfcb68d"/><file name="EventTest.php" hash="5bcc67fc780f88af99ca070c6bddb788"/><file name="PayoutTest.php" hash="183ff8911954355a2ecda972e676cba9"/><file name="PlanTest.php" hash="d391dc6f5a2a9dd933bf850e2d74c3b4"/><file name="TokenTest.php" hash="e51027f7abd634f25f7b4b4246a573cd"/><file name="WebhookTest.php" hash="3e13c84e2b466bee3e6872ced3b4b114"/></dir><file name="Conekta.php" hash="478260fe34dcd328eb1c7a0c619febad"/></dir><dir name="vendor"><file name="autoload.php" hash="af8e9ab968332411505aafb78acb8ce0"/><dir name="composer"><file name="ClassLoader.php" hash="3e420cbf8bc3c56158e3dcd277613b03"/><file name="LICENSE" hash="084a034acbad39464e3df608c6dc064f"/><file name="autoload_classmap.php" hash="df3f1202396bd228a9280fa44c9441b4"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="dd3a00f0d13eb29781edd8c77d4c5100"/><file name="autoload_real.php" hash="28bef80f182e2056db8aa5ac2ff96d98"/><file name="installed.json" hash="99915314ba4af269b4f7a678edfbecfd"/></dir><dir name="simpletest"><dir name="simpletest"><file name="HELP_MY_TESTS_DONT_WORK_ANYMORE" hash="3f406bdc4f474b19e7063a816796fbe5"/><file name="LICENSE" hash="5804fe91d3294da4ac47c02b454bbc8a"/><file name="README.md" hash="9a1a55ea734a189a45218d64a3fc4414"/><file name="TODO.xml" hash="2d139c030cb4b9e795c40e519d9f8aa6"/><file name="VERSION" hash="30a04cf33ee91a3ecf4b75c71268f316"/><file name="arguments.php" hash="4c6194e05032ba054e8794843005c276"/><file name="authentication.php" hash="225f1aa1f5e576c226fa55f0f5fdb3d3"/><file name="autorun.php" hash="07b636ac423f644f61e1efe5836cc2c5"/><file name="browser.php" hash="e3763dd907fdcefebeb362dead3bd297"/><file name="collector.php" hash="d32b42465099ac97c71a74bfdeeeaa3d"/><file name="compatibility.php" hash="71fa238285cf0cd6a1ba454025fc8621"/><file name="composer.json" hash="3f5ded2bac5dd27faf52fddb17c27d54"/><file name="cookies.php" hash="ce93a09c12ee4127c4036f9af0dbfb09"/><file name="default_reporter.php" hash="66fc41c96027ae79e0b74fb4f5f40d17"/><file name="detached.php" hash="52ae08c35f7ec5ee12d67f83214d4e34"/><dir name="docs"><dir name="en"><file name="docs.css" hash="5b7dbf32aa4131ede54d0fe94132679c"/></dir><dir name="fr"><file name="docs.css" hash="0f93d4963f3ff9e76560b8a6e347311c"/></dir><dir name="it"><file name="docs.css" hash="5ac7c8b1922e9f1ef1da90de9ac41b18"/></dir><dir name="lastcraft"><file name="README" hash="fc2dc2ade984ecf05bcccd9ff57f1f02"/></dir><dir name="onpk"><file name="README" hash="c4fd86ddf38fae7b3a2776cef85a3fe4"/></dir><dir name="pkg"><file name="README" hash="cd13a15621e570aa2c14ccb31416e2b6"/></dir><dir name="simpletest.org"><file name="README" hash="acccb858df6e845ce4fd96414bc68e0b"/><file name="favicon.ico" hash="3da65fcd78587c78f4318766920adbf7"/><dir name="images"><file name="book-domain-driven-design.jpg" hash="1859db386d5cb80d5961bd63661ea7e0"/><file name="book-guide-to-php-design-patterns.jpg" hash="1b4465bf27bf9560521c5ffa8fe2eac7"/><file name="book-the-php-anthology-object-oriented-php-solutions.jpg" hash="d40cd1936cfd934c46d02b4be32c3431"/><file name="quote.png" hash="6d4f92821e22fdb3df82fb4e0e52df73"/><file name="simpletest-contribute.png" hash="6a254fb62293d9e3ea30244f0ab21cb4"/><file name="simpletest-download.png" hash="2169293cf557234b382fd77dffb21e5d"/><file name="simpletest-external-bottom.png" hash="261e7efc8d623cd10bafafe4c1912a0d"/><file name="simpletest-external-middle.png" hash="ce3fc96e3643a06962aed7239e41de6d"/><file name="simpletest-external-top.png" hash="88839a4a297065e69b2d75b2bb8aa541"/><file name="simpletest-internal-bottom.png" hash="cab42bcbd4db5ba4dce668c1e17883f9"/><file name="simpletest-internal-middle.png" hash="d81e2658da3bee581c6464a68b4914d7"/><file name="simpletest-internal-top.png" hash="e19a97b38a9ce14b3e716d8ec812e1f7"/><file name="simpletest-logo.png" hash="44761b8a3267bbc3f12d130c65f1468f"/><file name="simpletest-start-testing.png" hash="10d2a1a66ed890f341acf4c9890c9b8d"/><file name="simpletest-support.png" hash="b2439ad8ad05db490f70aad010dc159a"/><file name="test-in-cli.png" hash="9ad0b5a8b32a9a7f1b58b2dad9a0162d"/><file name="test-with-1-fail.png" hash="f0a51f709293abf10b597104db5e086d"/><file name="test-with-1-pass.png" hash="1d559637183bd3ce4e6ec027032c57df"/></dir><file name="index.html" hash="f6c1f9e20b5be23ec3dcaba9bb61f8f8"/><dir name="js"><file name="jquery-1.2.1.pack.js" hash="ebe0ea764139f30972055e9f79972277"/><file name="jquery-speakers_coaches_consultants.js" hash="3240cc94790e14310e1b888e04177fc4"/><file name="jquery.heartbeat.js" hash="b4172c0601a9b2f5119c6ae21cf3e26e"/><file name="jquery.sparkline.js" hash="5dd0c5160bc61f966731f7372be48b40"/></dir><file name="simpletest.css" hash="eefdfa08047f9843b5ffa164378c4d2a"/><dir name="views"><file name="heartbeat.php" hash="3d058a12be15758164fd1b1818948009"/><file name="photos_stream.php" hash="70e3335e53a21d09ea8e2ddb71d4a0f8"/></dir></dir><dir name="source"><dir name="en"><file name="about.xml" hash="6d39ebe29794b672b44a56317185fb48"/><file name="authentication_documentation.xml" hash="19994a81057bd6917dd6d5dad36d1d24"/><file name="books_website.xml" hash="221d7cb35bf610ac6a98a6c744161d63"/><file name="boundary_classes_tutorial.xml" hash="83f604a5e1ea5ed827f0470a0c63f6a4"/><file name="browser_documentation.xml" hash="d7234400c7f56781e354a7dc96a935d6"/><file name="changelog.xml" hash="66f8bd7170bb5b11945f590d6cc4c106"/><file name="coding_standards.xml" hash="c0fcaca889bf8c40bc2d24701fbb82d8"/><file name="display_subclass_tutorial.xml" hash="f26cb02634a13d4cdba30fdd3179701d"/><file name="download_website.xml" hash="46f25c6012eb58b9fdcffa4c2a0a8115"/><file name="expectation_documentation.xml" hash="bb53c3a5e02df320ff4ccec3bef8fd82"/><file name="experimental_dom_tester.xml" hash="8c10699fdee68185ace58906d57c3740"/><file name="experimental_intro.xml" hash="a838a73ad96b076cd7f912b6614c7acd"/><file name="experimental_recorder.xml" hash="e5c345c470283acf26bcfca3779dec85"/><file name="extension_eclipse.xml" hash="17d89b7b38b41c584d3be8461a387722"/><file name="first_test_tutorial.xml" hash="1b6b23e96023decca4283d3d91861dd3"/><file name="form_testing_documentation.xml" hash="8d1995b71c3c128345b0ca901bb065f4"/><file name="gain_control_tutorial.xml" hash="79db24d6407f217b0305230d2912ddfb"/><file name="group_test_documentation.xml" hash="6ad611331cd1df021f8e73654789fac1"/><file name="group_test_tutorial.xml" hash="e541a1feeacfa30b4aadb89ddb0d0cce"/><file name="heartbeat.xml" hash="3cb3df4745c7f3eb2898c3ae982e225f"/><file name="ideas.xml" hash="51065e174db3cff947159e78d285b68c"/><file name="improving_design_tutorial.xml" hash="e11bd92ec44121e43cae2f8fcdd7c3d7"/><file name="index.xml" hash="47114a47fec3ef9b0b6bbcbda9b23c6e"/><file name="intro.xml" hash="008e0ab06f0f7c46646abe0e0b161138"/><file name="mock_objects_documentation.xml" hash="181f407ab63f18dcdef5da501a400e05"/><file name="mock_objects_tutorial.xml" hash="e630aa76458d83c33737bb4a838d772b"/><file name="overview.xml" hash="117c63809c0c3935c27e2a4862d02d01"/><file name="partial_mocks_documentation.xml" hash="862aa39bc35f0b05e5a53baf82a08456"/><file name="photos_stream.xml" hash="30391a258322b1acbc03479128903fa6"/><file name="reporter_documentation.xml" hash="d085908d92d5fe762d707a86d78c95fd"/><file name="screencasts.xml" hash="31d954a2472c41323f72f9db4986819f"/><file name="simple_test.xml" hash="03f04037fba6bdc15fe6a5329384e76e"/><file name="softwares_using_simpletest.xml" hash="098ec0ef382da86bfab983f8ee7bbffe"/><file name="speakers_coaches_consultancy.xml" hash="a25abcf66ddadc3559cdd02b30bc5ae1"/><file name="subclass_tutorial.xml" hash="7c63b99cbc12b7306c751ec3a8e3f8f9"/><file name="support_website.xml" hash="7f4c7d8efd1244e2febbd6d55fce3fec"/><file name="unit_test_documentation.xml" hash="95c70a8b86ae2af050344b9909837eeb"/><file name="web_tester_documentation.xml" hash="c7de94ccc38c3292c06324abd4c9c404"/><file name="writing_extensions.xml" hash="a6cf1d316aeecfe6b62f49110ba40178"/></dir><dir name="fr"><file name="authentication_documentation.xml" hash="5e9b5f0e83dabc6821bc9355822141a3"/><file name="books_website.xml" hash="6dcff10571b04c9882b23c222c36921a"/><file name="boundary_classes_tutorial.xml" hash="a53d99a183d6bf3b02c05a845787bac5"/><file name="browser_documentation.xml" hash="2f5a38c865948566c1ee0aed97d987a4"/><file name="display_subclass_tutorial.xml" hash="6f68ff2370c3cdb21f947e6bce99b082"/><file name="download_website.xml" hash="200f02d1cabe455bbb02a125cfa61bf0"/><file name="expectation_documentation.xml" hash="aa84acd07fb8a1b8dbcdbee98260ae34"/><file name="extension_eclipse.xml" hash="8bb81a19b50908542d5946e2379964ad"/><file name="first_test_tutorial.xml" hash="1ab59cf29a5a1cc1e855d5f1f1a408be"/><file name="form_testing_documentation.xml" hash="da2defce5ed3a57f078435dcf99cc39f"/><file name="gain_control_tutorial.xml" hash="edcc56a348cba9a8ecb8a17012a0845c"/><file name="group_test_documentation.xml" hash="b509b96b7895bea18befef25094eb77a"/><file name="group_test_tutorial.xml" hash="6d0ef31a33c03eaff46b29dee5274772"/><file name="improving_design_tutorial.xml" hash="e180ef801599f7789d3e588b8459f35d"/><file name="index.xml" hash="0e6ecc4f019f208a84deefbd51a6f2c1"/><file name="intro.xml" hash="cabbc40bd72f65511d1e5cd8f4319055"/><file name="logiciels_utilisant_simpletest.xml" hash="b837d7e3dcdb84422bdf0eca1b557f9d"/><file name="mock_objects_documentation.xml" hash="a063715560a4fed9e8596c398e2e3acb"/><file name="mock_objects_tutorial.xml" hash="27ef3d69dbe5d62ea5c3569836bae875"/><file name="overview.xml" hash="f6ce2f96d0cbea507e02bddd7ad67eb2"/><file name="partial_mocks_documentation.xml" hash="eec2acc0705cd40380b3269b7aec97a3"/><file name="reporter_documentation.xml" hash="0c72e1ef975ee9ba9fd86505cb79f7ad"/><file name="simple_test.xml" hash="d64a81a9f79957e5bf49d46049bb60e8"/><file name="subclass_tutorial.xml" hash="bd6b9c76f7b2191ebb3038f24915a04f"/><file name="support_website.xml" hash="1ce933485528c6cafbfa6771ce5c7408"/><file name="unit_test_documentation.xml" hash="bc1a100fd2936ab60f70d58e4fdba508"/><file name="web_tester_documentation.xml" hash="9899e6ad8af338fba4e8d9ac4d5a6b59"/></dir><dir name="it"><file name="about.xml" hash="923b75582ff95061ee00368197ded617"/><file name="authentication_documentation.xml" hash="c8c46ac93a719f5e617acb8923a14d47"/><file name="books_website.xml" hash="6d8f1b775dcd1c0e5e12d048538f92d6"/><file name="boundary_classes_tutorial.xml" hash="1c2ff2c2bfecad602ba6c44bd39bb4c3"/><file name="browser_documentation.xml" hash="1160f5ca6a3471a395f8e57c93072123"/><file name="changelog.xml" hash="72d655f005d76f7fb2e139a499e01eb6"/><file name="coding_standards.xml" hash="3b6f04d4b40c6c61c9b82fe59a1cd7c2"/><file name="display_subclass_tutorial.xml" hash="d138c6530471fdec4af8ce06de159235"/><file name="download_website.xml" hash="8feeb56c79bf112de7cbd6839aee8f2a"/><file name="expectation_documentation.xml" hash="01a333342a32ec82d2bf0bb7145b3e7e"/><file name="experimental_dom_tester.xml" hash="3f03247884e746e330766555d5221b9c"/><file name="experimental_intro.xml" hash="5d82baa6ee7d7bbaee8d4e82cd9a8a31"/><file name="experimental_recorder.xml" hash="007ffc2aaaf73d2ddfda9224bee9a9cf"/><file name="extension_eclipse.xml" hash="5550c74d3aabd9f346b5b6c5b25b4f9b"/><file name="first_test_tutorial.xml" hash="f972dc2ac2fdb69cffad2149ab7034ac"/><file name="form_testing_documentation.xml" hash="5e4312fe41301c99d08e960184809124"/><file name="gain_control_tutorial.xml" hash="84446a8a56c1d218ca280508f5562d29"/><file name="group_test_documentation.xml" hash="d9658f22648ed2129b1ca92f996fe420"/><file name="group_test_tutorial.xml" hash="767644a28186d8144822ad7c3faf404e"/><file name="heartbeat.xml" hash="a6cbf305d35b308ad166506c5238bfd1"/><file name="ideas.xml" hash="275ddbde6191c604c801d2d92142cee0"/><file name="improving_design_tutorial.xml" hash="392d76bc2a26f847d891d0bd7ba17e1b"/><file name="index.xml" hash="2946afd04340068e4e779713edcc0f6f"/><file name="intro.xml" hash="b4c61c9e581580e61eea60acef37c433"/><file name="mock_objects_documentation.xml" hash="54bc5978459bc4a7bc784fbeacf35596"/><file name="mock_objects_tutorial.xml" hash="6ee072398983265038b4a3105f9c7560"/><file name="overview.xml" hash="1d95af8965218c166ff3ca9354d1f361"/><file name="partial_mocks_documentation.xml" hash="348ea1d2bcb49f7e25870b65099748cb"/><file name="photos_stream.xml" hash="78369acd568e0a2cdb462e5a36266825"/><file name="reporter_documentation.xml" hash="4e9df7fde40ead71d18ed89cbea13211"/><file name="screencasts.xml" hash="f2d0e1866c3886f12d9168e5271e9f58"/><file name="simple_test.xml" hash="f1d678a66712d91716d39f4ff1974c9c"/><file name="softwares_using_simpletest.xml" hash="9da6235f328aaae7d23b2f18a533badd"/><file name="speakers_coaches_consultancy.xml" hash="3acaebe7a5d0b8784fc3a7b87bfa8ca7"/><file name="subclass_tutorial.xml" hash="be157d2ea3bb13fafa24baa38fde47b1"/><file name="support_website.xml" hash="23bc1ee0c9427969947dede9215bc289"/><file name="unit_test_documentation.xml" hash="66042a13a46ec24c87e68f2d7a7ee172"/><file name="web_tester_documentation.xml" hash="37e7ac35659745fd632de39fe6e75347"/><file name="writing_extensions.xml" hash="c4affe3f6d2441ba5a37bf6a0c570d28"/></dir></dir></dir><file name="dumper.php" hash="f4a8478cfc033ce567c053ca6ed844ba"/><file name="eclipse.php" hash="7a66eafab9d025316c049733d893b09a"/><file name="encoding.php" hash="f2d77aba0fb15d0ded526060a4cd8724"/><file name="errors.php" hash="db938b577288bd6d06a21b40daebf6e5"/><file name="exceptions.php" hash="a8bc5f58d12f3d640cc1a2d6cea42970"/><file name="expectation.php" hash="05b00c7a47f4331bb492ba0dbe6e354e"/><dir name="extensions"><file name="colortext_reporter.php" hash="9da03e2f8c2923205ddbc0c1922d9438"/><dir name="coverage"><file name="autocoverage.php" hash="6c4bf1f9cfaf1e2a44f8e1daa22f817e"/><dir name="bin"><file name="php-coverage-close.php" hash="93e7d76d232b24a3ddf29a58ae81ac36"/><file name="php-coverage-open.php" hash="b68fe18909158074805f28a09e9231d3"/><file name="php-coverage-report.php" hash="132c91ee2a8c0675898e8ad314aa421a"/></dir><file name="coverage.php" hash="2b49981614e4d124ec5fb957a5ebf54f"/><file name="coverage_calculator.php" hash="74cc62ca660885af88b77cd138e90884"/><file name="coverage_data_handler.php" hash="2ce3631df3fe8bb0abd032dd49e5ab67"/><file name="coverage_reporter.php" hash="982e3b629f47c043f667cceb809ad66b"/><file name="coverage_utils.php" hash="987a1fd23caa86ccf4392dbf058d604c"/><file name="coverage_writer.php" hash="4863fda0a8bd9edb87e27e911622b9f7"/><file name="simple_coverage_writer.php" hash="dd76d62cdfb5e4fabb583c8722f4a0f8"/><dir name="templates"><file name="file.php" hash="50530c678b4e01d2098195da2e4f3281"/><file name="index.php" hash="5c704447f52c136e8f0c93fb0769cb29"/></dir><dir name="test"><file name="coverage_calculator_test.php" hash="d7d32298bc3a93075caad25323489459"/><file name="coverage_data_handler_test.php" hash="2493d24d212e96bd65dcdf705a30d44c"/><file name="coverage_reporter_test.php" hash="9fdf89a4894b45d4546fd07925f736c8"/><file name="coverage_test.php" hash="558a1c6bfc5756461e4704c99b3db20b"/><file name="coverage_utils_test.php" hash="9391fa69a9457ebbf0d902bc196e452c"/><dir name="sample"><file name="code.php" hash="4483572d5657ec564fc35c06f2f7a4e0"/></dir><file name="simple_coverage_writer_test.php" hash="90f7da3df27afe225e0122112c36b8fe"/><file name="test.php" hash="d01d5cf3f4e7152af32101a1cdab2f0a"/></dir></dir><dir name="css"><file name="webunit.css" hash="b764971cdf3f5dd6cc89fc923a9d8321"/></dir><dir name="dom_tester"><file name="css_selector.php" hash="b1db3d4a4f78733d7bbf166c654ec74d"/><dir name="test"><file name="dom_tester_doc_test.php" hash="678afaa853c3905f2da4cf7a0c223bc3"/><file name="dom_tester_test.php" hash="4ceaecb82b50759a27cfe80217fec3cc"/><dir name="support"><file name="child_adjacent.html" hash="6bf975cd518a9c81ef479adb9c7d9c4f"/><file name="dom_tester.html" hash="254430e082cad52d61665be7549442a6"/></dir></dir></dir><file name="dom_tester.php" hash="9f872457e43deb2a994ad57a759ba16b"/><dir name="img"><file name="wait.gif" hash="5cdd3d1eaa03216e9c16840b7a6f8d6e"/></dir><dir name="js"><dir name="tests"><file name="TestOfWebunit.js.html" hash="63cca591ca1be6ece6c89ceb01150701"/></dir><file name="webunit.js" hash="f74982d6fcf5aa3dd3f0e16c94493fb5"/><file name="x.js" hash="d23f58b9b98b778aac7248e31a28b9f8"/></dir><file name="junit_xml_reporter.php" hash="f58b152488a250f459cac3924e8dcba3"/><file name="pear_test_case.php" hash="ce02457889e1fd7e9cfc23e1a42cf50b"/><file name="selenese_tester.php" hash="0318c68b44439582a1c21b7f1f6bf986"/><dir name="selenium"><file name="remote-control.php" hash="6271054521fdf0140704e7ede1697b69"/><dir name="test"><file name="remote-control_test.php" hash="fca468414168b65355e7386eae50277f"/></dir></dir><file name="selenium.php" hash="61668613373373ceac57ad1e58545fb9"/><dir name="testdox"><file name="test.php" hash="95611e38fc6ce476c2da971eccc56b14"/></dir><file name="testdox.php" hash="0a516e7962be9479f98549fb48ac8e4f"/><dir name="treemap_reporter"><file name="jquery.php" hash="d78daf57cb98be89a11d0e0ab43b2650"/><dir name="test"><file name="treemap_node_test.php" hash="234531dafc2f74ef7c5904b3e8143859"/></dir><file name="treemap_recorder.php" hash="aa4c0c29664d04448f846371c5080788"/></dir><file name="treemap_reporter.php" hash="7d34ffd35e5ef6fd749bc25348f1c62a"/><file name="webunit_reporter.php" hash="331f7fabd83f54553e372cb864676b38"/></dir><file name="form.php" hash="6b2a25e18e45aadba2dcc351e98a2b5a"/><file name="frames.php" hash="fb19dc3564fce2f43b3b5b7867a7d75f"/><file name="http.php" hash="b282fa48bca0ad837d0b30ce3d0c3a28"/><file name="invoker.php" hash="b3482030f6f245cc64cef9f014d45f87"/><file name="mock_objects.php" hash="d65cd917978a294d978c1604aeab3d2e"/><dir name="packages"><dir name="coverage"><file name="generate_coverage.sh" hash="ecd3e44a45f56eaa33518572a273503a"/></dir><dir name="lastcraft"><file name="lastcraft.xslt" hash="c71c8217b83f703c6294dcdcda5be290"/><file name="make_lastcraft_docs.sh" hash="8978ed7ca3660a7123566f8541907f11"/><file name="site_map.xml" hash="bcd564acd3eb3cff5a18686f02637a56"/><file name="transform_all_lastcraft.php" hash="cd2821d4c57898157ab5081f600f9378"/></dir><dir name="onpk"><file name="map_onpk.xml" hash="f17c2dab0b4efa4fcc6d36416ce9eef9"/><file name="onpk.xslt" hash="4b0d049cca443dce8cd61dab712079d0"/><file name="transform_all_onpk.php" hash="9736c0e920674516df65e79f692dd180"/></dir><dir name="pear"><file name="package.xml" hash="dac6d5411165d37a1b38704e6f54b274"/></dir><dir name="phing"><file name="extension.xml" hash="be4b310fccd271f884bb1bf8820df119"/></dir><dir name="phpdoc"><file name="make_phpdoc_docs.sh" hash="c91c7dc65f37a42e8dce403a439917f2"/><file name="phpdoc_docs.xslt" hash="504a9ca691ce8f8a5de26a6b6ef55793"/><file name="simpletest.ini" hash="d7f0cabe8bd211f414297a475b72222c"/></dir><dir name="simpletest.org"><file name="index.php" hash="09bd28a5f3930a2533084e0d49357c12"/><file name="integration.php" hash="4c11262a6b77ba1c7ba5cf139b5a4228"/><file name="map.xml" hash="4b1cf9fdd2a0fb6920df3793ab933f1f"/><file name="package.php" hash="5c5464196aea20948a6b042eca58c341"/><file name="template.html" hash="6eaa5af4a917150f42ef43eab9691255"/><dir name="test"><dir name="package"><file name="content_without_section.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><dir name="en"><file name="synchronisation.xml" hash="cfad55fdd47691e5d5ffc49d0dc73804"/></dir><dir name="fr"><file name="no-synchronisation.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="synchronisation.xml" hash="402eb1fe6abf7479bb93600c6680ca55"/></dir><file name="here_download.xml" hash="4ed80f3e0e12ec023e71e2efab3daec3"/><file name="here_overview.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_simpletest.xml" hash="ec1e970e4e681f61745ea034b8e2911a"/><file name="here_start_testing.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_support.xml" hash="42a071977c1d5cf7419165ff504fcc6e"/><file name="here_unit-tester.xml" hash="17f28ae6cd7cffd61bb7b5da5e1c2282"/><file name="map.xml" hash="830a0d14f19d9a2d2a0ca4d87f95e60e"/><file name="one_section_changelogged.xml" hash="ef839cfab9c2901bc933c676a7bb8ac1"/><file name="one_section_milestoned.xml" hash="9bab3e9f367606a36d4a1e9c242c2a97"/><file name="one_section_with_autorum_php.xml" hash="70592701244fc5d737fa8f10e0b60440"/><file name="one_section_with_php_code.xml" hash="88ffca5e5d3500baaf12cdbc283f1a82"/><file name="script_and_ul.xml" hash="0e0d425619b28d352aaee73ffb9dab98"/></dir><file name="package_test.php" hash="9587007e4428dc361c5d401dd9548933"/></dir></dir><dir name="sourceforge"><file name="build_tarball.sh" hash="e6f37d859fae8a720814ce6ca19bf04f"/><file name="bundled_docs.xslt" hash="d6fd9824f6bd7e5836ed7830bdecd5fe"/><file name="bundled_map.xml" hash="8e0114ac5fafe32432b2411ad658d0a3"/><file name="make_bundled_docs.sh" hash="daf66c5e7f4b127c4e2be65a6a4cad08"/></dir></dir><file name="page.php" hash="e1b7d6443461f6b38fe35e6d93196302"/><file name="php_parser.php" hash="88a3ac023682dd506d0bf9a83a163928"/><file name="recorder.php" hash="0f7054d9ec8f397847776a6b23486b3c"/><file name="reflection_php5.php" hash="7d8f9f2b701a31b702805812eb27ad60"/><file name="remote.php" hash="faee7e6c71a75c5837c126d69212c1a4"/><file name="reporter.php" hash="1a45fad1b8cf0e0cbfa59436a7db69f1"/><file name="scorer.php" hash="407afbc78ede064047284efd06d1573a"/><file name="selector.php" hash="74fdcebec47f531d27ff31c70f58ddbf"/><file name="shell_tester.php" hash="ae7e4cb05db2dc3a1e8cdb9e5fe687b7"/><file name="simpletest.php" hash="27bd3557db083b9a3d0826e318a8ba43"/><file name="socket.php" hash="c7bca250fbab409082a7f4cba0cb92e5"/><file name="tag.php" hash="8c31276f078afbccd555f14a8522638d"/><dir name="test"><file name="acceptance_test.php" hash="ffb78c72da45769bd05480bace0e2440"/><file name="adapter_test.php" hash="089ed2dc33360dd8dda7d44f51347e0c"/><file name="all_tests.php" hash="e1cca5d913429f57f667e39340e6c3cd"/><file name="arguments_test.php" hash="fae94db949b54c9b7385a7ccacaca2b3"/><file name="authentication_test.php" hash="f16bcef77c7767ff20f828a758684736"/><file name="autorun_test.php" hash="1dce083825d8a7c8c127852e5802730d"/><file name="bad_test_suite.php" hash="181e5a57778639aeb3037ed51f062f69"/><file name="browser_test.php" hash="378d34c1fa3be0d68b22bcc674e4fb95"/><file name="collector_test.php" hash="40f68067c2c0e52ebf47c51183f4fbb8"/><file name="command_line_test.php" hash="500bd4bd8c8875b6f0dacad7a3d8622e"/><file name="compatibility_test.php" hash="d694b2e0183107afc232127b17bd511c"/><file name="cookies_test.php" hash="32e4ee16a213770dd99cd0c731950624"/><file name="detached_test.php" hash="344b507bccce782816b75c5c5da6d43d"/><file name="dumper_test.php" hash="d18d27b103f5ae962110a3b8a2e2205f"/><file name="eclipse_test.php" hash="b35ef78293d35ed1957eed94001df827"/><file name="encoding_test.php" hash="6f05c408bc8334418e8dd9d642033eaa"/><file name="errors_test.php" hash="712319188ac8f4eaa1054bde188a286e"/><file name="exceptions_test.php" hash="462c79c331ec0e540226b7d9bc9f2a85"/><file name="expectation_test.php" hash="b18301ebd50c3d76d9ec06f81d234a79"/><file name="extensions_tests.php" hash="88b81a9c71306a3cb1f8ec9597afdd36"/><file name="form_test.php" hash="6d1d1f5061428c3cab015694a7245de6"/><file name="frames_test.php" hash="ada1a277bf3688798d0464ef46a88e3d"/><file name="http_test.php" hash="4c0f306118ce47dfe22391d45f894530"/><file name="interfaces_test.php" hash="bafa0b74ecc836b9a39122d07b3fd6ef"/><file name="interfaces_test_php5_1.php" hash="33d42f8f1e928992bce67bae86d87e25"/><file name="live_test.php" hash="baee207bfcb55040feab53e565044365"/><file name="mock_objects_test.php" hash="64655b2744dee434469f6fe886f03483"/><file name="page_test.php" hash="a603ae712d1ca14450fc1fb80fa79d86"/><file name="parse_error_test.php" hash="01d19d1fe037033ae5b355a05422e82a"/><file name="parsing_test.php" hash="79315ef0998e5461c92da47a079f9ba0"/><file name="php_parser_test.php" hash="3e19d9ef36e7ff9da2ab81c632f25fe2"/><file name="recorder_test.php" hash="6e344c31000040c9a76e677eae5d760e"/><file name="reflection_php5_test.php" hash="469b67b9068b0ee9ddfedaed00bb490b"/><file name="remote_test.php" hash="23ae612ef6868226b8cd8dc5a5c76817"/><file name="shell_test.php" hash="6f25f47bb4278412badd23f686bc33e7"/><file name="shell_tester_test.php" hash="1f82c2fe96ce2ae73ce23fa768000453"/><file name="simpletest_test.php" hash="19c00c1e9cf94278051979137f8b190c"/><dir name="site"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="base_change_redirect.php" hash="3e7a9d0864439800d307d14f0ac23427"/><dir name="base_tag"><file name="base_link.html" hash="0fb0d4fc58c8efcdc4cc6a072406f333"/><file name="form.html" hash="4bf5728fb5793ba11a5e7ab865c50eac"/><file name="frameset.html" hash="206047c4f8b5aae344cd8cf3c9e8a5fa"/><file name="frameset_with_base_tag.html" hash="3b6bb1fbaa042d563d52fcc25c46fe61"/><file name="page_1.html" hash="2eeff2e06cb559e268d3023601ea9138"/><file name="page_2.html" hash="0c8670422465c7d990c8dae999e5bdf7"/><file name="relative_link.html" hash="c1555e3d568e959151309e1b5c6e6db1"/></dir><file name="cookie_based_counter.php" hash="dd7773002a7c5e03903b6cf35bcd522e"/><file name="counting_frameset.html" hash="0ebea4dd9f202014e8f7f90deb6bba8d"/><file name="double_base_change_redirect.php" hash="832b47dce4bd57f1967e388aa238fac1"/><file name="file.html" hash="4c163986c2dc1f8e74a4069184efb486"/><file name="form.html" hash="1eaab823afab219c4cb99076e20547dd"/><file name="form_data_encoded_form.html" hash="37b364932a59e5653db8d75a1b0f144a"/><file name="form_with_array_based_inputs.php" hash="0ef882721bc167c2ceac74dde0846bd1"/><file name="form_with_false_defaults.html" hash="d1ee151195ddfda8d762ee930955d600"/><file name="form_with_mixed_post_and_get.html" hash="55f87cced77c6d1b2500a50129c1f772"/><file name="form_with_quoted_values.php" hash="52dd4234ddff704133dc8d456b26c883"/><file name="form_with_radio_buttons.html" hash="d23fe6f32223666ae8900bda2906e103"/><file name="form_with_tricky_defaults.html" hash="a2992fd2206048d7f4951585d0268b6b"/><file name="form_with_unnamed_submit.html" hash="08836e7584473a795d372268f97b2e5a"/><file name="form_without_action.php" hash="535adcea7f660b5c563273d4a72e241f"/><file name="frame_a.html" hash="74a7ce5a305fd98dce37b2bdb641b874"/><file name="frame_b.html" hash="85eeec074c8c22d4fcb22ea11419b8d7"/><file name="frame_links.html" hash="83e5b360138b6a5605b9e4d44aa54f2d"/><file name="frameset.html" hash="4bd9f9f57790faba848010c0f54feace"/><dir name="front_controller_style"><file name="a_page.php" hash="bef83009f20b91f6d3c426db0820df35"/><file name="index.php" hash="49460e286d4731d5aa3df6407fa36ab0"/><file name="show_request.php" hash="43425cc05ede659f0435b6631a49ab3e"/></dir><file name="link_confirm.php" hash="c9afbfe455c2b51e5b3e84f6c7b01e0d"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="messy_frameset.html" hash="875d156da96c81bc3509d33562b2eb86"/><file name="multiple_widget_form.html" hash="3cf41196d2ea967e00260b108f82504e"/><file name="nested_frameset.html" hash="223349147fa5af19045de7ca61e9e76d"/><file name="network_confirm.php" hash="6a4f552177ed43aac428fde4206a5f84"/><file name="one_page_frameset.html" hash="d41571bb42d445396bbdb561fc2da3b2"/><file name="page_request.php" hash="035b0fec6b840751e8224c0f1dc707eb"/><dir name="path"><file name="base_change_redirect.php" hash="0920a342a7d43bdc952386ad84dea1b0"/><file name="network_confirm.php" hash="8f1e40a7d4c3dd88a2c31af4f086127a"/><file name="show_cookies.php" hash="b53fb77412c7993061967f1584a34068"/></dir><dir name="protected"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="network_confirm.php" hash="b42c1220320892a954fe41ecc2ccb6a9"/><file name=".htaccess" hash="f30780cfeab05516183f1b42e174b700"/><file name=".htpasswd" hash="1de4aa0031b82efd9857e5d688c6b6d9"/></dir><file name="redirect.php" hash="2e785fdceb4ec73f0472997af37c373c"/><file name="request_methods.php" hash="2d2c941a2c9084d8e7446f6b25d32c4e"/><file name="savant_style_form.html" hash="4c4bb6ddffaafa73c698a7af93fb269b"/><file name="search.png" hash="b9fe41794de0476a76987eb3cf4e2156"/><file name="self.php" hash="06f08beff5316e35ca2f784c5e336ebf"/><file name="self_form.php" hash="fa1d902566526b8c5494d734b5631333"/><file name="set_cookies.php" hash="a6ab7bd999ab14bfa9a6c731f465e73c"/><file name="slow_page.php" hash="a08ab767bcaa63cd5b58f88d5dd5d258"/><file name="timestamp.php" hash="7070a50a036292446cce617168841a1b"/><file name="upload_form.html" hash="d04d7e2601c374b6f9ca13de7a58095f"/><file name="upload_handler.php" hash="11d1256048330770f4a4fb0e8435062a"/><file name=".htaccess" hash="61e312cb9d1db877826e8aa77c282b2a"/></dir><file name="socket_test.php" hash="cc9d6986a6df035d5d64c08c0a4ea66f"/><dir name="support"><dir name="collector"><file name="collectable.1" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="collectable.2" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><file name="empty_test_file.php" hash="e25fc8d36540afc3e2711711385d530e"/><file name="failing_test.php" hash="08f0db1ec0f82084ff8eaf31669820e1"/><file name="latin1_sample" hash="e0e4859fcd6072bedb7aa1b6377d7ff1"/><file name="passing_test.php" hash="9e86efddd8c994598d081b73511ffa4a"/><file name="recorder_sample.php" hash="a1819efa081e91ccf60aabee5a9f7a6a"/><file name="spl_examples.php" hash="2d91c4b7e53f7e88d595ff9764b7541a"/><file name="supplementary_upload_sample.txt" hash="dd7472fdc569c968f2b14e0ad0f13a9b"/><file name="test1.php" hash="93eb5ee5206db603f17258d118c707b9"/><file name="upload_sample.txt" hash="0ce6cebb8d7754c9d4484ce78611d24d"/></dir><file name="tag_test.php" hash="95fe8acbaed8e5baecf47ce65f6b2a1e"/><file name="test_with_parse_error.php" hash="cffe3a940c5ff0e6a95fd4b2fc50113f"/><file name="unit_tester_test.php" hash="a1da5a58a818efdbae9ba4239dd1ba66"/><file name="unit_tests.php" hash="dac770d436709cac163eebb8a888902d"/><file name="url_test.php" hash="32d0880854343d93aa6cd35add0de49a"/><file name="user_agent_test.php" hash="77be8f5317298309b230c8d5b74dbf25"/><file name="utf8_test.php" hash="e8bacf74d12ab935a153f281d493c139"/><dir name="visual"><file name="visual_errors.php" hash="0498691bade2198f83245a1867a66a14"/></dir><file name="visual_test.php" hash="cd7505aaef902b45ad954c2f0fcf025d"/><file name="web_tester_test.php" hash="7d8db06ae24f610409156035646ca0b6"/><file name="xml_test.php" hash="84017dbb0176cec12e6c061e63c6ddf3"/></dir><file name="test_case.php" hash="3b13c289f4645222f4525ca32ff55fcc"/><file name="tidy_parser.php" hash="7d690cbd4174c0dd55650f17776679d1"/><dir name="tutorials"><dir name="SimpleTest"><file name="Expectations.pkg" hash="9588f8942ce97024069767f221f07679"/><file name="FormTesting.pkg" hash="b6fa7c27ffe522859b47edb21409de8c"/><file name="GroupTests.pkg" hash="c3ce22f6736b157a7193907985f041ba"/><file name="MockObjects.pkg" hash="f08cfc567158204e336cde9205b5ea0d"/><file name="PartialMock.pkg" hash="3e9753cc2ac611d08b8aa690817888b7"/><file name="Reporting.pkg" hash="fb0e62ddd5d478ad82df4f1b5fca6824"/><file name="ServerStubs.pkg" hash="75f28c80c87200aecaabd438fd8f92e2"/><file name="SimpleTest.pkg" hash="17b7d6f698822d798daa1174864cd147"/><file name="SimpleTest.pkg.ini" hash="62564da9231425fd5418c891ae0d8277"/><file name="UnitTestCase.pkg" hash="85ee5523757e3dd23fd449aa2612c867"/><file name="WebTester.pkg" hash="73c8600440665a79050b956457ba3caf"/></dir></dir><file name="unit_tester.php" hash="de853cd29e840ebf32cf6cc4219f95a4"/><file name="url.php" hash="e70b1045b89bc75abac39d1cb788b003"/><file name="user_agent.php" hash="d7822a5877b756c6119f6db53916016c"/><file name="web_tester.php" hash="9ecdb17974828fae668f45a8b781a0b6"/><file name="xml.php" hash="7b88c3ef197403483393184b6c1e6af5"/><file name=".gitignore" hash="e8a346051f935e6cb104e1dc40998a91"/><file name=".travis.yml" hash="944c26740b6da869954e34ab87d3bb1f"/></dir></dir></dir><file name=".DS_Store" hash="606ce9fd7afdc5511c4d49b7b5c87c88"/><file name=".git" hash="778272e6b6a4cfb49303eb8663669329"/><file name=".gitignore" hash="0e4735425dcb9b32241fcf493492c483"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="realtime.xml" hash="eee30d78996f906ceb4a42d82fec938f"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="card"><dir name="form"><file name="card.phtml" hash="b50c67ad211b603f0e45fd705361a4ab"/></dir><dir name="info"><file name="card.phtml" hash="7667a88bf6b048edffc73ccbe1501434"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="c4df033e2de87bd379908b966b795c28"/></dir></dir><dir name="realtime"><dir name="form"><file name="realtime.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="realtime.phtml" hash="92f5a9db36ed8c55aa902415ba5857f7"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir><dir name="checkout"><file name="success.phtml" hash="a6ced8f0e625c69e52c65967ae6cf433"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="realtime.xml" hash="eee30d78996f906ceb4a42d82fec938f"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="card"><dir name="form"><file name="card.phtml" hash="b50c67ad211b603f0e45fd705361a4ab"/></dir><dir name="info"><file name="card.phtml" hash="1f2c48a1e4a3f81d62c24a2b9a6183aa"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="c4df033e2de87bd379908b966b795c28"/></dir></dir><dir name="realtime"><dir name="form"><file name="realtime.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="realtime.phtml" hash="92f5a9db36ed8c55aa902415ba5857f7"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir><dir name="checkout"><file name="success.phtml" hash="a6ced8f0e625c69e52c65967ae6cf433"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Conekta_Bank.csv" hash="8c2269b2b60935b8a4b2e2a3fdf06566"/><file name="Conekta_Card.csv" hash="c7c0e6cc066f81cf72d0fbb775db48bb"/><file name="Conekta_Oxxo.csv" hash="7430d7fdea1e57f10a458ba1ec41cb1f"/><file name="Conekta_Realtime.csv" hash="7430d7fdea1e57f10a458ba1ec41cb1f"/><file name="Conekta_Spei.csv" hash="025868cd3fb6dd03f66c953c89a7259d"/></dir><dir name="es_MX"><file name="Conekta_Bank.csv" hash="797e2d3dc1af66d6ede62e5673eb0309"/><file name="Conekta_Card.csv" hash="dc9abc3ccb03a6aaf33810dc7d7acb00"/><file name="Conekta_Oxxo.csv" hash="020af87e670c3bfc3911cbd736a94fe6"/><file name="Conekta_Realtime.csv" hash="020af87e670c3bfc3911cbd736a94fe6"/><file name="Conekta_Spei.csv" hash="ecb9f70792296b3f9d322285f4deb6ec"/></dir></target></contents>
|
35 |
+
<compatible/>
|
36 |
+
<dependencies><required><php><min>5.3.0</min><max>7.0.0</max></php><extension><name>curl</name><min/><max/></extension><extension><name>json</name><min/><max/></extension><extension><name>mbstring</name><min/><max/></extension></required></dependencies>
|
37 |
+
</package>
|