From 3d7a906b2aa105801625a8e78dfc912df951f195 Mon Sep 17 00:00:00 2001 From: joaocouto-ifthenpay Date: Wed, 10 May 2023 09:03:20 +0000 Subject: [PATCH] release: module update from ifthenpay/dev_prestashop_8 (https://github.com/ifthenpay/dev_prestashop_8/commit/a73edc172defd45ab91a1cc9348fdddb0b96a5fb) --- .../classes/Admin/IfthenpayAdminRefund.php | 4 +- .../Admin/Payments/CCardAdminRefund.php | 3 +- .../Admin/Payments/MbwayAdminRefund.php | 3 +- ifthenpay/classes/Base/PaymentBase.php | 23 +- .../classes/Config/IfthenpayConfiguration.php | 4 +- .../Factory/Admin/AdminRefundFactory.php | 6 +- .../Prestashop/PrestashopModelFactory.php | 5 + ifthenpay/classes/Forms/CCardConfigForm.php | 38 ++- ifthenpay/classes/Forms/ConfigForm.php | 4 +- ifthenpay/classes/Forms/MbwayConfigForm.php | 73 +++-- .../classes/Forms/MultibancoConfigForm.php | 12 +- ifthenpay/classes/Forms/PayshopConfigForm.php | 34 +- .../Payments/Data/IfthenpayStrategy.php | 20 +- ifthenpay/classes/Utility/Utility.php | 11 +- ifthenpay/config.xml | 2 +- ifthenpay/ifthenpay.php | 26 +- ifthenpay/mails/en/refund.html | 135 -------- ifthenpay/mails/en/refund.txt | 15 - ifthenpay/mails/en/refund_token.html | 293 ++++++++++++++++++ ifthenpay/mails/en/refund_token.txt | 7 + ifthenpay/mails/pt/refund.html | 133 -------- ifthenpay/mails/pt/refund.txt | 15 - ifthenpay/mails/pt/refund_token.html | 291 +++++++++++++++++ ifthenpay/mails/pt/refund_token.txt | 7 + ifthenpay/mails/refund.html | 133 -------- ifthenpay/mails/refund.txt | 15 - ifthenpay/mails/refund_token.html | 291 +++++++++++++++++ ifthenpay/mails/refund_token.txt | 7 + ifthenpay/translations/pt.php | 45 +-- ..._0_1.css => ifthenpayAdminOrder_8_0_2.css} | 0 ...ig_8_0_1.css => ifthenpayConfig_8_0_2.css} | 0 ...0_1.css => ifthenpayConfirmPage_8_0_2.css} | 0 ...0_1.css => ifthenpayOrderDetail_8_0_2.css} | 0 ... => ifthenpayPaymentMethodSetup_8_0_2.css} | 0 ...ons_8_0_1.css => paymentOptions_8_0_2.css} | 0 ...1.js => adminAccountSettingsPage_8_0_2.js} | 0 ...Page_8_0_1.js => adminConfigPage_8_0_2.js} | 0 ...8_0_1.js => adminOrderCreatePage_8_0_2.js} | 0 ...8_0_1.js => adminOrderDetailPage_8_0_2.js} | 0 ....js => mbwayCountdownConfirmPage_8_0_2.js} | 0 ifthenpay/views/templates/hook/admin.tpl | 32 +- 41 files changed, 1132 insertions(+), 555 deletions(-) mode change 100644 => 100755 ifthenpay/classes/Admin/Payments/CCardAdminRefund.php mode change 100644 => 100755 ifthenpay/classes/Base/PaymentBase.php delete mode 100644 ifthenpay/mails/en/refund.html delete mode 100644 ifthenpay/mails/en/refund.txt create mode 100755 ifthenpay/mails/en/refund_token.html create mode 100755 ifthenpay/mails/en/refund_token.txt delete mode 100644 ifthenpay/mails/pt/refund.html delete mode 100644 ifthenpay/mails/pt/refund.txt create mode 100755 ifthenpay/mails/pt/refund_token.html create mode 100755 ifthenpay/mails/pt/refund_token.txt delete mode 100644 ifthenpay/mails/refund.html delete mode 100644 ifthenpay/mails/refund.txt create mode 100755 ifthenpay/mails/refund_token.html create mode 100755 ifthenpay/mails/refund_token.txt rename ifthenpay/views/css/{ifthenpayAdminOrder_8_0_1.css => ifthenpayAdminOrder_8_0_2.css} (100%) rename ifthenpay/views/css/{ifthenpayConfig_8_0_1.css => ifthenpayConfig_8_0_2.css} (100%) rename ifthenpay/views/css/{ifthenpayConfirmPage_8_0_1.css => ifthenpayConfirmPage_8_0_2.css} (100%) rename ifthenpay/views/css/{ifthenpayOrderDetail_8_0_1.css => ifthenpayOrderDetail_8_0_2.css} (100%) rename ifthenpay/views/css/{ifthenpayPaymentMethodSetup_8_0_1.css => ifthenpayPaymentMethodSetup_8_0_2.css} (100%) rename ifthenpay/views/css/{paymentOptions_8_0_1.css => paymentOptions_8_0_2.css} (100%) rename ifthenpay/views/js/{adminAccountSettingsPage_8_0_1.js => adminAccountSettingsPage_8_0_2.js} (100%) rename ifthenpay/views/js/{adminConfigPage_8_0_1.js => adminConfigPage_8_0_2.js} (100%) rename ifthenpay/views/js/{adminOrderCreatePage_8_0_1.js => adminOrderCreatePage_8_0_2.js} (100%) rename ifthenpay/views/js/{adminOrderDetailPage_8_0_1.js => adminOrderDetailPage_8_0_2.js} (100%) rename ifthenpay/views/js/{mbwayCountdownConfirmPage_8_0_1.js => mbwayCountdownConfirmPage_8_0_2.js} (100%) diff --git a/ifthenpay/classes/Admin/IfthenpayAdminRefund.php b/ifthenpay/classes/Admin/IfthenpayAdminRefund.php index 4a831c2..0669f9a 100644 --- a/ifthenpay/classes/Admin/IfthenpayAdminRefund.php +++ b/ifthenpay/classes/Admin/IfthenpayAdminRefund.php @@ -38,7 +38,7 @@ class IfthenpayAdminRefund extends IfthenpayStrategy public function execute() { $this->setDefaultData(); - $this->setDefaultEmailData(); - return AdminRefundFactory::build($this->order->payment, $this->paymentDefaultData, $this->ifthenpayModule, null, $this->emailDefaultData)->refundPayment(); + $this->setAdminEmailData(); + return AdminRefundFactory::build($this->order->payment, $this->paymentDefaultData, $this->ifthenpayModule, null, $this->emailAdminData)->refundPayment(); } } diff --git a/ifthenpay/classes/Admin/Payments/CCardAdminRefund.php b/ifthenpay/classes/Admin/Payments/CCardAdminRefund.php old mode 100644 new mode 100755 index d3707ce..745dfc6 --- a/ifthenpay/classes/Admin/Payments/CCardAdminRefund.php +++ b/ifthenpay/classes/Admin/Payments/CCardAdminRefund.php @@ -25,6 +25,7 @@ namespace PrestaShop\Module\Ifthenpay\Admin\Payments; +use PrestaShop\Module\Ifthenpay\Utility\Utility; if (!defined('_PS_VERSION_')) { exit; @@ -40,7 +41,7 @@ public function refundPayment() $this->setPaymentModel('ccard'); $this->getFromDatabaseById(); $this->setEmailVariables(); - $this->sendEmail('refund', 'Confirmação de Reembolso'); + $this->sendEmailToAdmin('refund_token', Utility::getMailTranslationString('ccard', 'refund')); return $this->securityCode; } } diff --git a/ifthenpay/classes/Admin/Payments/MbwayAdminRefund.php b/ifthenpay/classes/Admin/Payments/MbwayAdminRefund.php index 7de554e..b0c414a 100644 --- a/ifthenpay/classes/Admin/Payments/MbwayAdminRefund.php +++ b/ifthenpay/classes/Admin/Payments/MbwayAdminRefund.php @@ -25,6 +25,7 @@ namespace PrestaShop\Module\Ifthenpay\Admin\Payments; +use PrestaShop\Module\Ifthenpay\Utility\Utility; if (!defined('_PS_VERSION_')) { exit; @@ -40,7 +41,7 @@ public function refundPayment() $this->setPaymentModel('mbway'); $this->getFromDatabaseById(); $this->setEmailVariables(); - $this->sendEmail('refund', 'Confirmação de Reembolso'); + $this->sendEmailToAdmin('refund', Utility::getMailTranslationString('mbway', 'refund')); return $this->securityCode; } } diff --git a/ifthenpay/classes/Base/PaymentBase.php b/ifthenpay/classes/Base/PaymentBase.php old mode 100644 new mode 100755 index 946265b..998ef86 --- a/ifthenpay/classes/Base/PaymentBase.php +++ b/ifthenpay/classes/Base/PaymentBase.php @@ -40,6 +40,7 @@ abstract class PaymentBase protected $paymentDefaultData; protected $smartyDefaultData; protected $emailDefaultData; + protected $emailAdminData; protected $paymentGatewayResultData; protected $ifthenpayGateway; protected $paymentModel; @@ -74,7 +75,7 @@ public function getFromDatabaseById() } protected function sendEmail($emailTemplate, $emailSubject) - { + { \Mail::Send( (int)$this->paymentDefaultData->order->id_lang, $emailTemplate, @@ -92,6 +93,26 @@ protected function sendEmail($emailTemplate, $emailSubject) ); } + protected function sendEmailToAdmin($emailTemplate, $emailSubject) + { + $context = \Context::getContext(); + \Mail::Send( + (int)$context->employee->id_lang, + $emailTemplate, + $emailSubject, + $this->emailDefaultData, + $context->employee->email, + $context->employee->firstname . ' ' . $context->employee->lastname, + null, + null, + null, + null, + _PS_MODULE_DIR_ . 'ifthenpay/mails/', + false, + (int)$this->paymentDefaultData->order->id_shop + ); + } + public function getSmartyVariables() { return $this->smartyDefaultData; diff --git a/ifthenpay/classes/Config/IfthenpayConfiguration.php b/ifthenpay/classes/Config/IfthenpayConfiguration.php index 1957c3f..535eeeb 100644 --- a/ifthenpay/classes/Config/IfthenpayConfiguration.php +++ b/ifthenpay/classes/Config/IfthenpayConfiguration.php @@ -85,7 +85,6 @@ private function uninstallByPaymentMethod() \Configuration::deleteByName('IFTHENPAY_MULTIBANCO_URL_CALLBACK'); \Configuration::deleteByName('IFTHENPAY_MULTIBANCO_CHAVE_ANTI_PHISHING'); \Configuration::deleteByName('IFTHENPAY_MULTIBANCO_CANCEL_ORDER_AFTER_TIMEOUT'); - break; case 'mbway': \Configuration::deleteByName('IFTHENPAY_MBWAY_KEY'); @@ -94,7 +93,7 @@ private function uninstallByPaymentMethod() \Configuration::deleteByName('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT'); \Configuration::deleteByName('IFTHENPAY_MBWAY_SHOW_COUNTDOWN'); \Configuration::deleteByName('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT'); - + \Configuration::deleteByName('IFTHENPAY_MBWAY_REFUND'); break; case 'payshop': \Configuration::deleteByName('IFTHENPAY_PAYSHOP_KEY'); @@ -106,6 +105,7 @@ private function uninstallByPaymentMethod() case 'ccard': \Configuration::deleteByName('IFTHENPAY_CCARD_KEY'); \Configuration::deleteByName('IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT'); + \Configuration::deleteByName('IFTHENPAY_CCARD_REFUND'); break; default: } diff --git a/ifthenpay/classes/Factory/Admin/AdminRefundFactory.php b/ifthenpay/classes/Factory/Admin/AdminRefundFactory.php index 08e03fc..111d48f 100644 --- a/ifthenpay/classes/Factory/Admin/AdminRefundFactory.php +++ b/ifthenpay/classes/Factory/Admin/AdminRefundFactory.php @@ -40,13 +40,13 @@ public static function build( $paymentDefaultData, $ifthenpayModule, $smartyDefaultData = null, - $emailDefaultData = null + $emailAdminData = null ) { switch ($type) { case 'mbway': - return new MbwayAdminRefund($ifthenpayModule, $paymentDefaultData, $smartyDefaultData, $emailDefaultData); + return new MbwayAdminRefund($ifthenpayModule, $paymentDefaultData, $smartyDefaultData, $emailAdminData); case 'ccard': - return new CCardAdminRefund($ifthenpayModule, $paymentDefaultData, $smartyDefaultData, $emailDefaultData); + return new CCardAdminRefund($ifthenpayModule, $paymentDefaultData, $smartyDefaultData, $emailAdminData); default: throw new \Exception('Unknown Admin Refund class'); } diff --git a/ifthenpay/classes/Factory/Prestashop/PrestashopModelFactory.php b/ifthenpay/classes/Factory/Prestashop/PrestashopModelFactory.php index af9863e..9abce6e 100644 --- a/ifthenpay/classes/Factory/Prestashop/PrestashopModelFactory.php +++ b/ifthenpay/classes/Factory/Prestashop/PrestashopModelFactory.php @@ -60,4 +60,9 @@ public static function buildCustomer($id = null) { return new \Customer($id); } + + public static function buildEmployee($id = null) + { + return new \Employee($id); + } } diff --git a/ifthenpay/classes/Forms/CCardConfigForm.php b/ifthenpay/classes/Forms/CCardConfigForm.php index 01661d1..f277804 100644 --- a/ifthenpay/classes/Forms/CCardConfigForm.php +++ b/ifthenpay/classes/Forms/CCardConfigForm.php @@ -36,10 +36,8 @@ class CCardConfigForm extends ConfigForm { protected $paymentMethod = 'ccard'; - protected $options = []; // array of entity options for GUI select - /** * "gets" the form into object... it sets the form that will display in the payment method configuration * @@ -49,8 +47,9 @@ public function getForm() { // assign template variables $this->setSmartyVariables(); - $this->setFormParent(); + + // sets the $this->options $this->setEntityOptions(); $this->form['form']['input'][] = [ @@ -71,18 +70,39 @@ public function getForm() 'type' => 'switch', 'label' => $this->ifthenpayModule->l('Cancel CCard Order', pathinfo(__FILE__)['filename']), 'name' => 'IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT', - 'desc' => $this->ifthenpayModule->l('Cancel order if not payed within 30 minutes after confirmation. This is triggered when admin visits the order list page.'), + 'desc' => $this->ifthenpayModule->l('Cancel order if not payed within 30 minutes after confirmation. This is triggered when admin visits the order list page.', pathinfo(__FILE__)['filename']), + 'is_bool' => true, + 'values' => [ + [ + 'id' => 'active_on', + 'value' => true, + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) + ], + [ + 'id' => 'active_off', + 'value' => false, + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) + ] + ] + ]; + + // activate partial refund method + $this->form['form']['input'][] = [ + 'type' => 'switch', + 'label' => $this->ifthenpayModule->l('Partial Refund', pathinfo(__FILE__)['filename']), + 'name' => 'IFTHENPAY_CCARD_REFUND', + 'desc' => $this->ifthenpayModule->l('Allows the admin to make partial refunds directly to the Ifthenpay Payment Gateway.', pathinfo(__FILE__)['filename']), 'is_bool' => true, 'values' => [ [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; @@ -101,6 +121,7 @@ protected function getConfigFormValues() return array_merge(parent::getCommonConfigFormValues(), [ 'IFTHENPAY_CCARD_KEY' => \Configuration::get('IFTHENPAY_CCARD_KEY'), 'IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT' => \Configuration::get('IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT'), + 'IFTHENPAY_CCARD_REFUND' => \Configuration::get('IFTHENPAY_CCARD_REFUND') ]); } @@ -133,7 +154,7 @@ public function processForm() // save specific values \Configuration::updateValue('IFTHENPAY_CCARD_KEY', $this->gatewayDataBuilder->getData()->subEntidade); \Configuration::updateValue('IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT', \Tools::getValue('IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT')); - + \Configuration::updateValue('IFTHENPAY_CCARD_REFUND', \Tools::getValue('IFTHENPAY_CCARD_REFUND')); $this->updatePayMethodCommonValues(); // response msg after submiting form @@ -142,7 +163,7 @@ public function processForm() return true; } else { - + return false; } } @@ -176,5 +197,6 @@ public function deleteConfigValues() $this->deleteCommonConfigValues(); \Configuration::deleteByName('IFTHENPAY_CCARD_KEY'); \Configuration::deleteByName('IFTHENPAY_CCARD_CANCEL_ORDER_AFTER_TIMEOUT'); + \Configuration::deleteByName('IFTHENPAY_CCARD_REFUND'); } } diff --git a/ifthenpay/classes/Forms/ConfigForm.php b/ifthenpay/classes/Forms/ConfigForm.php index 27866dd..277231e 100644 --- a/ifthenpay/classes/Forms/ConfigForm.php +++ b/ifthenpay/classes/Forms/ConfigForm.php @@ -174,12 +174,12 @@ protected function addActivateCallbackToForm() [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; diff --git a/ifthenpay/classes/Forms/MbwayConfigForm.php b/ifthenpay/classes/Forms/MbwayConfigForm.php index fb2a4b5..c4eb999 100644 --- a/ifthenpay/classes/Forms/MbwayConfigForm.php +++ b/ifthenpay/classes/Forms/MbwayConfigForm.php @@ -36,11 +36,8 @@ class MbwayConfigForm extends ConfigForm { protected $paymentMethod = 'mbway'; - protected $options = []; // array of entity options for GUI select - - /** * "gets" the form into object... it sets the form that will display in the payment method configuration * @@ -50,9 +47,26 @@ public function getForm() { // assign template variables $this->setSmartyVariables(); - $this->setFormParent(); + + // sets the $this->options $this->setEntityOptions(); + + // select mbway key + $this->form['form']['input'][] = [ + 'type' => 'select', + 'label' => $this->ifthenpayModule->l('MB WAY key', pathinfo(__FILE__)['filename']), + 'desc' => $this->ifthenpayModule->l('Choose MB WAY key', pathinfo(__FILE__)['filename']), + 'name' => 'IFTHENPAY_MBWAY_KEY', + 'required' => true, + 'options' => [ + 'query' => $this->options, + 'id' => 'id', + 'name' => 'name' + ] + ]; + + // activate auto callback $this->addActivateCallbackToForm(); // cancel after timer of 30 minutes @@ -60,52 +74,61 @@ public function getForm() 'type' => 'switch', 'label' => $this->ifthenpayModule->l('Cancel MB WAY Order', pathinfo(__FILE__)['filename']), 'name' => 'IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT', - 'desc' => $this->ifthenpayModule->l('Cancel order if not payed within 30 minutes after confirmation. This is triggered when admin visits the order list page and will only work if the callback is activated.'), + 'desc' => $this->ifthenpayModule->l('Cancel order if not payed within 30 minutes after confirmation. This is triggered when admin visits the order list page and will only work if the callback is activated.', pathinfo(__FILE__)['filename']), 'is_bool' => true, 'values' => [ [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; + // show javascript countdown after order confirmation $this->form['form']['input'][] = [ 'type' => 'switch', 'label' => $this->ifthenpayModule->l('MB WAY Countdown', pathinfo(__FILE__)['filename']), 'name' => 'IFTHENPAY_MBWAY_SHOW_COUNTDOWN', - 'desc' => $this->ifthenpayModule->l('Display MB WAY Countdown after confirming order. Disable this option if having conflicts with "one page checkout" plugins.'), + 'desc' => $this->ifthenpayModule->l('Display MB WAY Countdown after confirming order. Disable this option if having conflicts with "one page checkout" plugins.', pathinfo(__FILE__)['filename']), 'is_bool' => true, 'values' => [ [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; - // select mbway key + + // activate partial refund method $this->form['form']['input'][] = [ - 'type' => 'select', - 'label' => $this->ifthenpayModule->l('MB WAY key', pathinfo(__FILE__)['filename']), - 'desc' => $this->ifthenpayModule->l('Choose MB WAY key', pathinfo(__FILE__)['filename']), - 'name' => 'IFTHENPAY_MBWAY_KEY', - 'required' => true, - 'options' => [ - 'query' => $this->options, - 'id' => 'id', - 'name' => 'name' + 'type' => 'switch', + 'label' => $this->ifthenpayModule->l('Partial Refund', pathinfo(__FILE__)['filename']), + 'name' => 'IFTHENPAY_MBWAY_REFUND', + 'desc' => $this->ifthenpayModule->l('Allows the admin to make partial refunds directly to the Ifthenpay Payment Gateway.', pathinfo(__FILE__)['filename']), + 'is_bool' => true, + 'values' => [ + [ + 'id' => 'active_on', + 'value' => true, + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) + ], + [ + 'id' => 'active_off', + 'value' => false, + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) + ] ] ]; @@ -118,6 +141,7 @@ public function getForm() $this->generateHelperForm(); } + protected function getConfigFormValues() { $mbWayCountdown = \Configuration::get('IFTHENPAY_MBWAY_SHOW_COUNTDOWN') !== false ? \Configuration::get('IFTHENPAY_MBWAY_SHOW_COUNTDOWN') : '1'; @@ -125,20 +149,22 @@ protected function getConfigFormValues() return array_merge(parent::getCommonConfigFormValues(), [ 'IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT' => \Configuration::get('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT'), 'IFTHENPAY_MBWAY_KEY' => \Configuration::get('IFTHENPAY_MBWAY_KEY'), - 'IFTHENPAY_MBWAY_SHOW_COUNTDOWN' => $mbWayCountdown + 'IFTHENPAY_MBWAY_SHOW_COUNTDOWN' => $mbWayCountdown, + 'IFTHENPAY_MBWAY_REFUND' => \Configuration::get('IFTHENPAY_MBWAY_REFUND') ]); } + public function setSmartyVariables() { // common to all payment methods parent::assignSmartyPayMethodsCommonVars(); // specific to this payment method - \Context::getContext()->smarty->assign('mbwayKey', \Configuration::get('IFTHENPAY_MBWAY_KEY')); } + public function setGatewayBuilderData() { $getMbwayKeyFromRequest = \Tools::getValue('IFTHENPAY_MBWAY_KEY'); @@ -149,6 +175,7 @@ public function setGatewayBuilderData() $this->gatewayDataBuilder->setSubEntidade($getMbwayKeyFromRequest ? $getMbwayKeyFromRequest : \Configuration::get('IFTHENPAY_MBWAY_KEY')); } + public function processForm() { if ($this->isValid()) { @@ -159,6 +186,7 @@ public function processForm() \Configuration::updateValue('IFTHENPAY_MBWAY_KEY', $this->gatewayDataBuilder->getData()->subEntidade); \Configuration::updateValue('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT', \Tools::getValue('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT')); \Configuration::updateValue('IFTHENPAY_MBWAY_SHOW_COUNTDOWN', \Tools::getValue('IFTHENPAY_MBWAY_SHOW_COUNTDOWN')); + \Configuration::updateValue('IFTHENPAY_MBWAY_REFUND', \Tools::getValue('IFTHENPAY_MBWAY_REFUND')); $this->setIfthenpayCallback(); $this->updatePayMethodCommonValues(); @@ -202,5 +230,6 @@ public function deleteConfigValues() \Configuration::deleteByName('IFTHENPAY_MBWAY_CHAVE_ANTI_PHISHING'); \Configuration::deleteByName('IFTHENPAY_MBWAY_CANCEL_ORDER_AFTER_TIMEOUT'); \Configuration::deleteByName('IFTHENPAY_MBWAY_SHOW_COUNTDOWN'); + \Configuration::deleteByName('IFTHENPAY_MBWAY_REFUND'); } } diff --git a/ifthenpay/classes/Forms/MultibancoConfigForm.php b/ifthenpay/classes/Forms/MultibancoConfigForm.php index e26aa9a..44cb5eb 100644 --- a/ifthenpay/classes/Forms/MultibancoConfigForm.php +++ b/ifthenpay/classes/Forms/MultibancoConfigForm.php @@ -36,7 +36,6 @@ class MultibancoConfigForm extends ConfigForm { protected $paymentMethod = 'multibanco'; - protected $subEntityOptions = []; // array of subentity options for GUI select protected $options = []; // array of entity options for GUI select @@ -50,11 +49,11 @@ public function getForm() { // assign template variables $this->setSmartyVariables(); - $this->setFormParent(); + + // sets the $this->options $this->setEntityOptions(); $this->setSubEntityOptions(); - $this->addActivateCallbackToForm(); // ENTITY $this->form['form']['input'][] = [ @@ -109,15 +108,18 @@ public function getForm() [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; + + // activate auto callback + $this->addActivateCallbackToForm(); // add min max and country form elements $this->addMinMaxFieldsToForm(); diff --git a/ifthenpay/classes/Forms/PayshopConfigForm.php b/ifthenpay/classes/Forms/PayshopConfigForm.php index 92e24ec..c85168e 100644 --- a/ifthenpay/classes/Forms/PayshopConfigForm.php +++ b/ifthenpay/classes/Forms/PayshopConfigForm.php @@ -36,19 +36,17 @@ class PayshopConfigForm extends ConfigForm { protected $paymentMethod = 'payshop'; - - protected $options = []; // array of entity options for GUI select - - + protected $options = []; // array of entity options for GUI select public function getForm() { // assign template variables - $this->setSmartyVariables(); - + $this->setSmartyVariables(); $this->setFormParent(); - $this->setEntityOptions(); // sets the $this->options - $this->addActivateCallbackToForm(); + + // sets the $this->options + $this->setEntityOptions(); + $this->form['form']['input'][] = [ 'type' => 'select', 'label' => $this->ifthenpayModule->l('Payshop key', pathinfo(__FILE__)['filename']), @@ -61,12 +59,9 @@ public function getForm() 'name' => 'name' ] ]; - $this->form['form']['input'][] = [ - 'type' => 'text', - 'label' => $this->ifthenpayModule->l('Deadline', pathinfo(__FILE__)['filename']), - 'name' => 'IFTHENPAY_PAYSHOP_VALIDADE', - 'desc' => $this->ifthenpayModule->l('Choose the number of days (from 1 to 99), leave empty if you do not want expiration.', pathinfo(__FILE__)['filename']) - ]; + + // activate auto callback + $this->addActivateCallbackToForm(); // cancel after deadline $this->form['form']['input'][] = [ @@ -79,16 +74,23 @@ public function getForm() [ 'id' => 'active_on', 'value' => true, - 'label' => $this->ifthenpayModule->l('Activate', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('ON', pathinfo(__FILE__)['filename']) ], [ 'id' => 'active_off', 'value' => false, - 'label' => $this->ifthenpayModule->l('Disabled', pathinfo(__FILE__)['filename']) + 'label' => $this->ifthenpayModule->l('OFF', pathinfo(__FILE__)['filename']) ] ] ]; + $this->form['form']['input'][] = [ + 'type' => 'text', + 'label' => $this->ifthenpayModule->l('Deadline', pathinfo(__FILE__)['filename']), + 'name' => 'IFTHENPAY_PAYSHOP_VALIDADE', + 'desc' => $this->ifthenpayModule->l('Choose the number of days (from 1 to 99), leave empty if you do not want expiration.', pathinfo(__FILE__)['filename']) + ]; + // add min max and country form elements $this->addMinMaxFieldsToForm(); $this->addCountriesFieldToForm(); diff --git a/ifthenpay/classes/Payments/Data/IfthenpayStrategy.php b/ifthenpay/classes/Payments/Data/IfthenpayStrategy.php index 7023b3a..2d097c3 100644 --- a/ifthenpay/classes/Payments/Data/IfthenpayStrategy.php +++ b/ifthenpay/classes/Payments/Data/IfthenpayStrategy.php @@ -38,11 +38,11 @@ class IfthenpayStrategy protected $paymentDefaultData; protected $smartyDefaultData; protected $emailDefaultData; + protected $emailAdminData; protected $order; protected $paymentValueFormated; protected $ifthenpayModule; - public function __construct($order, $ifthenpayModule) { $this->ifthenpayModule = $ifthenpayModule; @@ -60,6 +60,14 @@ protected function setDefaultData() $this->paymentDefaultData->setCustomer(PrestashopModelFactory::buildCustomer((string) $this->order->id_customer)); } + protected function setAdminData() + { + $context = \Context::getContext(); + $this->paymentDefaultData->setOrder($this->order); + $this->paymentDefaultData->setPaymentMethod($this->order->payment); + $this->paymentDefaultData->setCustomer(PrestashopModelFactory::buildEmployee((string) $context->employee->id)); + } + protected function setDefaultEmailData() { $data = $this->paymentDefaultData->getData(); @@ -68,4 +76,14 @@ protected function setDefaultEmailData() $this->emailDefaultData['{lastname}'] = $data->customer->lastname; $this->emailDefaultData['{total_paid}'] = $this->paymentValueFormated; } + + protected function setAdminEmailData() + { + $context = \Context::getContext(); + $data = $this->paymentDefaultData->getData(); + $this->emailAdminData['{order_name}'] = $data->order->reference; + $this->emailAdminData['{firstname}'] = $context->employee->firstname; + $this->emailAdminData['{lastname}'] = $context->employee->lastname; + $this->emailAdminData['{total_paid}'] = $this->paymentValueFormated; + } } diff --git a/ifthenpay/classes/Utility/Utility.php b/ifthenpay/classes/Utility/Utility.php index 828e4e3..f5b9fe0 100644 --- a/ifthenpay/classes/Utility/Utility.php +++ b/ifthenpay/classes/Utility/Utility.php @@ -90,10 +90,13 @@ public static function getFormatedPrice($order) public static function getMailTranslationString($paymentType, $type = '') { - if ($type === 'details') { - return \Context::getContext()->language->iso_code === 'pt' ? 'Dados de pagamento ' . ucfirst($paymentType) : 'Payment details for ' . ucfirst($paymentType); - } else { - return \Context::getContext()->language->iso_code === 'pt' ? 'Pagamento em falta...' : 'Payment missing...'; + switch ($type) { + case 'refund': + return \Context::getContext()->language->iso_code === 'pt' ? 'Confirmação de Reembolso ' . ucfirst($paymentType) : 'Refund Confirmation for ' . ucfirst($paymentType); + case 'details': + return \Context::getContext()->language->iso_code === 'pt' ? 'Dados de pagamento ' . ucfirst($paymentType) : 'Payment details for ' . ucfirst($paymentType); + default: + return \Context::getContext()->language->iso_code === 'pt' ? 'Pagamento em falta...' : 'Payment missing...'; } } diff --git a/ifthenpay/config.xml b/ifthenpay/config.xml index afb5a60..779c331 100644 --- a/ifthenpay/config.xml +++ b/ifthenpay/config.xml @@ -2,7 +2,7 @@ ifthenpay - + diff --git a/ifthenpay/ifthenpay.php b/ifthenpay/ifthenpay.php index 891db34..88c8d04 100755 --- a/ifthenpay/ifthenpay.php +++ b/ifthenpay/ifthenpay.php @@ -49,7 +49,7 @@ public function __construct() { $this->name = 'ifthenpay'; $this->tab = 'payments_gateways'; - $this->version = '8.0.1'; + $this->version = '8.0.2'; $this->author = 'Ifthenpay'; $this->need_instance = 0; $this->bootstrap = true; @@ -263,7 +263,7 @@ protected function getConfigForm() 'type' => 'switch', 'label' => $this->l('Sandbox Mode'), 'name' => 'IFTHENPAY_ACTIVATE_SANDBOX_MODE', - 'desc' => $this->l('Activate sandbox mode, to test the module without activating the callback.'), + 'desc' => $this->l('Enable sandbox mode in order to test the module without having to enable the callback payment option.'), 'is_bool' => true, 'values' => [ [ @@ -912,7 +912,6 @@ public function hookdisplayAdminOrder($params) $this->context->cookie->__unset('success'); $this->context->cookie->write(); } - if ($this->context->cookie->__isset('error')) { $message = $this->displayError($this->context->cookie->__get('error')); $this->context->cookie->__unset('error'); @@ -928,13 +927,28 @@ public function hookdisplayAdminOrder($params) $message )->execute(); + /** + * Partial Refund configuration + */ + switch($order->payment) { + case 'mbway': + $switchRefund = Configuration::get('IFTHENPAY_MBWAY_REFUND'); + break; + case 'ccard': + $switchRefund = Configuration::get('IFTHENPAY_CCARD_REFUND'); + break; + default: + $switchRefund = false; + } + $this->smarty->assign($ifthenpayAdminOrder->getSmartyVariables()->toArray()); $this->smarty->assign('paymentMethods', (array) unserialize($this->ifthenpayConfig['IFTHENPAY_USER_PAYMENT_METHODS'])); + $this->smarty->assign('swtichRefund', $switchRefund); $this->smarty->assign('refundNotAvailable', $this->l('The partial refund feature is not available for ')); - $this->smarty->assign('confirmRefund', $this->l('Are you sure you want to make a refund? If so, you will receive a security code via email.')); + $this->smarty->assign('confirmRefund', $this->l('Are you sure you want to make a refund of the payment previously made? If you proceed, the following operation will be irreversible.')); $this->smarty->assign('refundNotification', $this->l('Refund notification sent with success!')); - $this->smarty->assign('promptCode', $this->l('Please enter the security code from the email sent:')); - $this->smarty->assign('timeExceeded', $this->l('the validation time has been exceeded!')); + $this->smarty->assign('promptCode', $this->l('Please check your email inbox and enter the security code:')); + $this->smarty->assign('timeExceeded', $this->l(': the validation time has been exceeded!')); $this->smarty->assign('invalidCode', $this->l('Invalid security code')); $this->smarty->assign('validationSuccessful', $this->l('Security code was inserted successfully! You can now proceed with the refund.')); diff --git a/ifthenpay/mails/en/refund.html b/ifthenpay/mails/en/refund.html deleted file mode 100644 index a467209..0000000 --- a/ifthenpay/mails/en/refund.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - Message from store {shop_name} - - - - - - - - - - - - -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Hi {firstname} {lastname},
- Thanks for shopping at {shop_name}! -
-
- - - - - - -
  - -

- Your code is: {securityCode}

- - Your order with the reference {order_name} is waiting for your refund confirmation. Please place the above code in your Prestashop backoffice in order to validate the refund process . - -
-
 
-
- - - You can review your order and download your invoice at "Orders history" your customer account by clicking "My account" in our store. - - -
- - - If you have a visitor account, you can track your order at "Visitor orders" from our store. - -
-
 
- - \ No newline at end of file diff --git a/ifthenpay/mails/en/refund.txt b/ifthenpay/mails/en/refund.txt deleted file mode 100644 index d78a3df..0000000 --- a/ifthenpay/mails/en/refund.txt +++ /dev/null @@ -1,15 +0,0 @@ -Hi {firstname} {lastname}, - -Thank you for shopping in the store {shop_name}! - -Your code is: {securityCode} - -Your order with the reference {order_name} is waiting for your refund confirmation. Please place the above code in your Prestashop backoffice in order to validate the refund process. - -You can review your Order and download your Invoice in the "Order History" section from your Customer Account by clicking on "My Account" in our store. - -If you still have a Visitor Account, you can follow your Order by using this link: {shop_url} guest-tracking.php - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/ifthenpay/mails/en/refund_token.html b/ifthenpay/mails/en/refund_token.html new file mode 100755 index 0000000..8679ad3 --- /dev/null +++ b/ifthenpay/mails/en/refund_token.html @@ -0,0 +1,293 @@ + + + + + + + + + + + + + + + + Payment | ifthenpay + + + + + + + + + + + +
+ + + + + +
+ + + + +
+ + + + + + + + +
+ + + + +
+ + + +

+ + Your code is: {securityCode} + +

+

+ + This code will be active for 10 minutes. + If you do not enter it on the Refund page you just visited within that time, + you may have to restart the refund process. +

+ If you don't recognize or expect this email, + you can always report suspicious behavior to our support team. +
+
+
+ + + + + + + +

+ + + + +
+
+ + + + + + + + +
+ + + + +
+ + +

+ + Please do not reply to this email. + The sending address is only for transmitting automatic messages. + +

+ + +
+
+ +
+
+ +
+ + + diff --git a/ifthenpay/mails/en/refund_token.txt b/ifthenpay/mails/en/refund_token.txt new file mode 100755 index 0000000..f44e634 --- /dev/null +++ b/ifthenpay/mails/en/refund_token.txt @@ -0,0 +1,7 @@ +Your code is: {securityCode} + +This code will be active for 10 minutes. If you do not enter it on the Refund page you just visited within that time, you may have to restart the refund process. + +If you don't recognize or expect this email, you can always report suspicious behavior to our support team. + +Please do not reply to this email. The sending address is only for transmitting automatic messages. \ No newline at end of file diff --git a/ifthenpay/mails/pt/refund.html b/ifthenpay/mails/pt/refund.html deleted file mode 100644 index 9dd4a6d..0000000 --- a/ifthenpay/mails/pt/refund.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Mensagem a partir da loja {shop_name} - - - - - - - - - - - - -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Olá {firstname} {lastname},
- Obrigado por fazer compras na {shop_name}! -
-
- - - - - - -
  - -

- O seu código é: {securityCode}

- - A sua encomenda com a referência {order_name} encontra-se a aguardar pela sua confirmação de reembolso. Por favor coloque o código acima no seu backoffice Prestashop de modo a validar o processo de reembolso. -
-
 
-
- - - Pode rever a sua encomenda e descarregar a sua fatura em "Histórico de encomendas" da sua conta de cliente clicando em "A minha conta" na nossa loja. - -
- - - Se tiver uma conta de visitante, pode seguir a sua encomenda em "Encomendas de visitantes" da nossa loja. - -
-
 
- - \ No newline at end of file diff --git a/ifthenpay/mails/pt/refund.txt b/ifthenpay/mails/pt/refund.txt deleted file mode 100644 index b5b922c..0000000 --- a/ifthenpay/mails/pt/refund.txt +++ /dev/null @@ -1,15 +0,0 @@ -Olá {firstname} {lastname}, - -Obrigado por ter feito compras na loja {shop_name}! - -O seu código é: {securityCode} - -A sua encomenda {order_name} encontra-se a aguardar pela sua confirmação de reembolso. Por favor coloque o código acima no seu backoffice Prestashop de modo a validar o processo de reembolso. - -Pode rever a sua Encomenda e realizar a descarga (download) da sua Fatura na secção "Histórico de Encomendas" a partir da sua Conta de Cliente por clicar em "Minha Conta" na nossa loja. - -Se possui ainda uma Conta de Visitante, pode seguir a sua Encomenda por usar este link: {shop_url}guest-tracking.php - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/ifthenpay/mails/pt/refund_token.html b/ifthenpay/mails/pt/refund_token.html new file mode 100755 index 0000000..d3fbdfe --- /dev/null +++ b/ifthenpay/mails/pt/refund_token.html @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + Pagamento | ifthenpay + + + + + + + + + + + +
+ + + + + +
+ + + + +
+ + + + + + + + +
+ + + + +
+ + + +

+ + O seu código é: {securityCode} + +

+

+ + Este código irá estar ativo durante 10 minutos. + Se não o inserir na página de Reembolso, que acabou de visitar, + dentro desse espaço de tempo, poderá ter que reiniciar o processo de reembolso. +

+ Se não reconhecer ou esperar este e-mail, poderá sempre relatar comportamento + suspeito à nossa equipa de suporte. +

+
+ + + + + + + +

+ + + + +
+
+ + + + + + + + +
+ + + + +
+ + +

Por + favor não responda a este email. O endereço de + envio serve apenas para transmitir mensagens + automáticas.

+ + +
+
+ +
+
+ +
+ + + diff --git a/ifthenpay/mails/pt/refund_token.txt b/ifthenpay/mails/pt/refund_token.txt new file mode 100755 index 0000000..6cc74c8 --- /dev/null +++ b/ifthenpay/mails/pt/refund_token.txt @@ -0,0 +1,7 @@ +O seu código é: {securityCode} + +Este código irá estar ativo durante 10 minutos. Se não o inserir na página de Reembolso, que acabou de visitar, dentro desse espaço de tempo, poderá ter que reiniciar o processo de reembolso. + +Se não reconhecer ou esperar este e-mail, poderá sempre relatar comportamento suspeito à nossa equipa de suporte. + +Por favor não responda a este email. O endereço de envio serve apenas para transmitir mensagens automáticas. \ No newline at end of file diff --git a/ifthenpay/mails/refund.html b/ifthenpay/mails/refund.html deleted file mode 100644 index 9dd4a6d..0000000 --- a/ifthenpay/mails/refund.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Mensagem a partir da loja {shop_name} - - - - - - - - - - - - -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Olá {firstname} {lastname},
- Obrigado por fazer compras na {shop_name}! -
-
- - - - - - -
  - -

- O seu código é: {securityCode}

- - A sua encomenda com a referência {order_name} encontra-se a aguardar pela sua confirmação de reembolso. Por favor coloque o código acima no seu backoffice Prestashop de modo a validar o processo de reembolso. -
-
 
-
- - - Pode rever a sua encomenda e descarregar a sua fatura em "Histórico de encomendas" da sua conta de cliente clicando em "A minha conta" na nossa loja. - -
- - - Se tiver uma conta de visitante, pode seguir a sua encomenda em "Encomendas de visitantes" da nossa loja. - -
-
 
- - \ No newline at end of file diff --git a/ifthenpay/mails/refund.txt b/ifthenpay/mails/refund.txt deleted file mode 100644 index b5b922c..0000000 --- a/ifthenpay/mails/refund.txt +++ /dev/null @@ -1,15 +0,0 @@ -Olá {firstname} {lastname}, - -Obrigado por ter feito compras na loja {shop_name}! - -O seu código é: {securityCode} - -A sua encomenda {order_name} encontra-se a aguardar pela sua confirmação de reembolso. Por favor coloque o código acima no seu backoffice Prestashop de modo a validar o processo de reembolso. - -Pode rever a sua Encomenda e realizar a descarga (download) da sua Fatura na secção "Histórico de Encomendas" a partir da sua Conta de Cliente por clicar em "Minha Conta" na nossa loja. - -Se possui ainda uma Conta de Visitante, pode seguir a sua Encomenda por usar este link: {shop_url}guest-tracking.php - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/ifthenpay/mails/refund_token.html b/ifthenpay/mails/refund_token.html new file mode 100755 index 0000000..d3fbdfe --- /dev/null +++ b/ifthenpay/mails/refund_token.html @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + Pagamento | ifthenpay + + + + + + + + + + + +
+ + + + + +
+ + + + +
+ + + + + + + + +
+ + + + +
+ + + +

+ + O seu código é: {securityCode} + +

+

+ + Este código irá estar ativo durante 10 minutos. + Se não o inserir na página de Reembolso, que acabou de visitar, + dentro desse espaço de tempo, poderá ter que reiniciar o processo de reembolso. +

+ Se não reconhecer ou esperar este e-mail, poderá sempre relatar comportamento + suspeito à nossa equipa de suporte. +

+
+ + + + + + + +

+ + + + +
+
+ + + + + + + + +
+ + + + +
+ + +

Por + favor não responda a este email. O endereço de + envio serve apenas para transmitir mensagens + automáticas.

+ + +
+
+ +
+
+ +
+ + + diff --git a/ifthenpay/mails/refund_token.txt b/ifthenpay/mails/refund_token.txt new file mode 100755 index 0000000..6cc74c8 --- /dev/null +++ b/ifthenpay/mails/refund_token.txt @@ -0,0 +1,7 @@ +O seu código é: {securityCode} + +Este código irá estar ativo durante 10 minutos. Se não o inserir na página de Reembolso, que acabou de visitar, dentro desse espaço de tempo, poderá ter que reiniciar o processo de reembolso. + +Se não reconhecer ou esperar este e-mail, poderá sempre relatar comportamento suspeito à nossa equipa de suporte. + +Por favor não responda a este email. O endereço de envio serve apenas para transmitir mensagens automáticas. \ No newline at end of file diff --git a/ifthenpay/translations/pt.php b/ifthenpay/translations/pt.php index 568af12..9ca54d8 100755 --- a/ifthenpay/translations/pt.php +++ b/ifthenpay/translations/pt.php @@ -9,7 +9,7 @@ $_MODULE['<{ifthenpay}prestashop>ifthenpay_77a1e7b60678684757ac820103a5460f'] = 'Chave de acesso ao backoffice'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_c9cc8cce247e49bae79f15173ce97354'] = 'Salvar'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_8eaf9dd80ecfbd6de7c83cf3b707232b'] = 'Modo Sandbox'; -$_MODULE['<{ifthenpay}prestashop>ifthenpay_89655c4fbf25851e95f95ee579a14b09'] = 'Ative o modo sandbox para testar o módulo sem ativar o callback.'; +$_MODULE['<{ifthenpay}prestashop>ifthenpay_00ccf3b81fa03fcbd4ad936394e12d98'] = 'Ativar o modo sandbox a fim de testar o módulo sem a necessidade de ativar a opção callback.'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Ativado'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativado'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_ec53a8c4f07baed5d8825072c89799be'] = 'Estado'; @@ -21,12 +21,11 @@ $_MODULE['<{ifthenpay}prestashop>ifthenpay_68b694e3fa9e145d0062587526875551'] = 'Métodos de pagamento atualizados com sucesso!'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_61fb4576f3e45f8fbea20a5117c543ac'] = 'Erro ao salvar métodos de pagamento!'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_d22e8bf6263dfeb9e56945a2075b6b34'] = 'Pagamento por '; -$_MODULE['<{ifthenpay}prestashop>ifthenpay_cbc25f377fb2f0c1f2dfa043f9677a4f'] = 'Detalhe da ordem de pagamento apenas está disponível em contexto de loja. Selecione a loja no seletor suspenso na parte superior da tela'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_a1bec2c3a9270c7739478cc5a50977c1'] = 'O reembolso parcial não está disponível para '; -$_MODULE['<{ifthenpay}prestashop>ifthenpay_770b99deedabc9e353ea4f752044a757'] = 'Tem a certeza que deseja fazer um reembolso? Se sim, receberá um código de segurança por e-mail.'; +$_MODULE['<{ifthenpay}prestashop>ifthenpay_71eae2197220f2227cb189ec46669a96'] = 'Tem a certeza que deseja fazer um reembolso do pagamento anteriormente realizado? Caso proceda, a seguinte operação será irreversível.'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_f7718ee0bb474e598102b877afc29d98'] = 'Notificação de reembolso enviada com sucesso!'; -$_MODULE['<{ifthenpay}prestashop>ifthenpay_230db71d4ef6ceed02244557e76b26e2'] = 'Digite o código de segurança do e-mail enviado:'; -$_MODULE['<{ifthenpay}prestashop>ifthenpay_3e7582429b20a80c1b6b0e94644cf32d'] = 'o tempo de validação foi excedido!'; +$_MODULE['<{ifthenpay}prestashop>ifthenpay_888fb570b9a1d651916afb4b28bcccd4'] = 'Por favor verifique a caixa de entrada do seu e-mail e introduza o código de segurança:'; +$_MODULE['<{ifthenpay}prestashop>ifthenpay_dc17aadb429dfaeebed6f8a152fb77db'] = ': o tempo de validação foi excedido!'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_1b4754eb6d429ebc7d871dff7fbbb4cf'] = 'Código de segurança inválido'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_8329d709a558cef86f5b15183e57bd90'] = 'O código de segurança foi inserido com sucesso! Agora poderá prosseguir com o reembolso.'; $_MODULE['<{ifthenpay}prestashop>ifthenpay_08563326ded6815ba7dc6a1f7ff908f2'] = 'Ocorreu um errro ao obter os dados do método de pagamento, verifique os logs para mais informação.'; @@ -47,17 +46,19 @@ $_MODULE['<{ifthenpay}prestashop>ccardconfigform_ac1d5c290d4b2176a26575ea5dc3c655'] = 'Chave CCard'; $_MODULE['<{ifthenpay}prestashop>ccardconfigform_e6885a9d3fa0a1a7d4106c46ba2f9fe5'] = 'Escolha a Chave CCard'; $_MODULE['<{ifthenpay}prestashop>ccardconfigform_0d6184f604b11a1906364b29c0166b34'] = 'Cancelar Encomenda Ccard'; -$_MODULE['<{ifthenpay}prestashop>ccardconfigform_558214076f3f19ff1ada2f3b342a11a2'] = 'Cancela encomenda se não for paga dentro de 30 minutos após a confirmação. É executado quando o admin visita a página de lista de encomendas.'; -$_MODULE['<{ifthenpay}prestashop>ccardconfigform_a13367a8e2a3f3bf4f3409079e3fdf87'] = 'Ativar'; -$_MODULE['<{ifthenpay}prestashop>ccardconfigform_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativar'; +$_MODULE['<{ifthenpay}prestashop>ccardconfigform_558214076f3f19ff1ada2f3b342a11a2'] = 'Cancela encomenda se não for paga dentro de 30 minutos após a confirmação. É executado quando o administrador visita a página de lista de encomendas.'; +$_MODULE['<{ifthenpay}prestashop>ccardconfigform_90651ebea9a35ec4e018c8157492e17c'] = 'Ativado'; +$_MODULE['<{ifthenpay}prestashop>ccardconfigform_88559a0cfd8250c9d65970cc145c92d4'] = 'Desativado'; +$_MODULE['<{ifthenpay}prestashop>ccardconfigform_c985a711556e2edf5cac28dfbdb43ff0'] = 'Reembolso Parcial'; +$_MODULE['<{ifthenpay}prestashop>ccardconfigform_172d2c272a7ecb427387b7d30bf819b3'] = 'Permite que o administrador possa efetuar reembolsos parciais diretamente com a Gateway de pagamentos da Ifthenpay.'; $_MODULE['<{ifthenpay}prestashop>payshopconfigform_96a43d03a15c37a755ba073dbded41b1'] = 'Chave Payshop'; $_MODULE['<{ifthenpay}prestashop>payshopconfigform_3904ace72e3ea07abc47497c3e1ed8ec'] = 'Escolha a Chave Payshop'; -$_MODULE['<{ifthenpay}prestashop>payshopconfigform_159f7d51b9a4ff702c9b5543b8f7980f'] = 'Validade'; -$_MODULE['<{ifthenpay}prestashop>payshopconfigform_c0f0687c262de6620384fc1e99f54d5b'] = 'Escolha o número de dias (de 1 a 99). Deixe vazio se não pretender expiração.'; $_MODULE['<{ifthenpay}prestashop>payshopconfigform_4d4577e71b968aff7d67381ccdbe698c'] = 'Cancelar Encomenda Payshop'; $_MODULE['<{ifthenpay}prestashop>payshopconfigform_e05014b208c52abad532620055dee892'] = 'Cancela encomenda se não for paga antes da Validade. É executado quando o admin visita a página de lista de encomendas e necessita que tenha a Validade atribuída.'; -$_MODULE['<{ifthenpay}prestashop>payshopconfigform_a13367a8e2a3f3bf4f3409079e3fdf87'] = 'Ativar'; -$_MODULE['<{ifthenpay}prestashop>payshopconfigform_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativar'; +$_MODULE['<{ifthenpay}prestashop>payshopconfigform_90651ebea9a35ec4e018c8157492e17c'] = 'Ativado'; +$_MODULE['<{ifthenpay}prestashop>payshopconfigform_88559a0cfd8250c9d65970cc145c92d4'] = 'Desativado'; +$_MODULE['<{ifthenpay}prestashop>payshopconfigform_159f7d51b9a4ff702c9b5543b8f7980f'] = 'Validade'; +$_MODULE['<{ifthenpay}prestashop>payshopconfigform_c0f0687c262de6620384fc1e99f54d5b'] = 'Escolha o número de dias (de 1 a 99). Deixe vazio se não pretender expiração.'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_1a434befae3f49ae09347ded52032f6f'] = 'Entidade'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_6b46678cf658dc51a2a8b71db8a49205'] = 'Escolha a Entidade'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_536d445375d07170a4964fb242c18c39'] = 'Sub-Entidade'; @@ -66,15 +67,15 @@ $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_43b9ffbb87947aca1c5f2a4b27b04b63'] = 'Selecione os dias de Validade. Ao selecionar 0, a referência expira no próprio dia às 23:59. Ao selecionar \"Sem Validade\", a referência não expira.'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_bf7cb6b4440bf6acd3269f0c9961524c'] = 'Cancelar Encomenda Multibanco'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_e05014b208c52abad532620055dee892'] = 'Cancela encomenda se não for paga antes da Validade. É executado quando o admin visita a página de lista de encomendas e necessita que tenha a Validade atribuída.'; -$_MODULE['<{ifthenpay}prestashop>multibancoconfigform_a13367a8e2a3f3bf4f3409079e3fdf87'] = 'Ativar'; -$_MODULE['<{ifthenpay}prestashop>multibancoconfigform_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativar'; +$_MODULE['<{ifthenpay}prestashop>multibancoconfigform_90651ebea9a35ec4e018c8157492e17c'] = 'Ativado'; +$_MODULE['<{ifthenpay}prestashop>multibancoconfigform_88559a0cfd8250c9d65970cc145c92d4'] = 'Desativado'; $_MODULE['<{ifthenpay}prestashop>multibancoconfigform_c277b03ba68f89052c31d3fbf192b81d'] = 'Sem Validade'; $_MODULE['<{ifthenpay}prestashop>configform_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuração'; $_MODULE['<{ifthenpay}prestashop>configform_c9cc8cce247e49bae79f15173ce97354'] = 'Salvar'; $_MODULE['<{ifthenpay}prestashop>configform_406c70d61a3eefd08d468bd8a7b1b77f'] = 'Callback'; $_MODULE['<{ifthenpay}prestashop>configform_847437ba907f7aaf71d4da80cef19e6e'] = 'Ativar callback automaticamente. Se o modo sandbox estiver ativo, o callback não ativará.'; -$_MODULE['<{ifthenpay}prestashop>configform_a13367a8e2a3f3bf4f3409079e3fdf87'] = 'Ativado'; -$_MODULE['<{ifthenpay}prestashop>configform_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativado'; +$_MODULE['<{ifthenpay}prestashop>configform_90651ebea9a35ec4e018c8157492e17c'] = 'Ativado'; +$_MODULE['<{ifthenpay}prestashop>configform_88559a0cfd8250c9d65970cc145c92d4'] = 'Desativado'; $_MODULE['<{ifthenpay}prestashop>configform_ba087184ee6e25ec7a1b51b8897679e3'] = 'Valor Mínimo de Encomenda'; $_MODULE['<{ifthenpay}prestashop>configform_083ed98fe173b63c2449f410f1b1f3b2'] = 'Exibe este método de pagamento para encomendas com valor total superior ao valor inserido.'; $_MODULE['<{ifthenpay}prestashop>configform_8052ade5baca2959aaa9b8fb1a62bae2'] = 'Valor Máximo de Encomenda'; @@ -83,14 +84,16 @@ $_MODULE['<{ifthenpay}prestashop>configform_ff55c63f99e78602d2061e33888204e4'] = 'Ordena os métodos de pagamento na página de checkout. Ordena do menor para o maior, por exemplo, (Multibanco: 1, MB WAY: 4, CCARD: 2) resulta em (Multibanco, CCARD, MB WAY). Esta opção apenas afeta os métodos de pagamento deste módulo.'; $_MODULE['<{ifthenpay}prestashop>configform_52b7e372bca509e26e66340426dc8531'] = 'Restrições de Países'; $_MODULE['<{ifthenpay}prestashop>configform_7f677130ed1a95194d57209385064523'] = 'Exibe este método de pagamento para encomendas com país de envio dentro dos selecionados. Deixe vazio (sem seleção) para permitir todos os países. Use a tecla CTRL e o lado direito do rato para seleção multipla.'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_f509bfde859916c38f876eec7d7bb814'] = 'Chave MB WAY'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_b6f32a76c083c0abc94f7934946f9630'] = 'Escolha a Chave MB WAY'; $_MODULE['<{ifthenpay}prestashop>mbwayconfigform_ecc8615e7d20238229148d9db6cef308'] = 'Cancelar Encomenda MB WAY'; $_MODULE['<{ifthenpay}prestashop>mbwayconfigform_a413869069673c333d0bc4c8ba7328f9'] = 'Cancela encomenda se não for paga dentro de 30 minutos após a confirmação. É executado quando o admin visita a página de lista de encomendas e necessita que o callback esteja ativo.'; -$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_a13367a8e2a3f3bf4f3409079e3fdf87'] = 'Ativado'; -$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desativado'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_90651ebea9a35ec4e018c8157492e17c'] = 'Ativado'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_88559a0cfd8250c9d65970cc145c92d4'] = 'Desativado'; $_MODULE['<{ifthenpay}prestashop>mbwayconfigform_ebea5d9dd6b7cf70342dbc10b5e3c1d2'] = 'Contador MB WAY'; $_MODULE['<{ifthenpay}prestashop>mbwayconfigform_b6c87a037f6231097bdc3cfb8c2eeb7d'] = 'Exibe o Contador MB WAY após confirmar a encomenda. Desative esta funcionalidade se tiver conflitos com plugins de \"one page checkout\".'; -$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_f509bfde859916c38f876eec7d7bb814'] = 'Chave MB WAY'; -$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_b6f32a76c083c0abc94f7934946f9630'] = 'Escolha a Chave MB WAY'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_c985a711556e2edf5cac28dfbdb43ff0'] = 'Reembolso Parcial'; +$_MODULE['<{ifthenpay}prestashop>mbwayconfigform_172d2c272a7ecb427387b7d30bf819b3'] = 'Permite que o administrador possa efetuar reembolsos parciais diretamente com a Gateway de pagamentos da Ifthenpay.'; $_MODULE['<{ifthenpay}prestashop>callbackoffline_414c9b5355141d37397db5bd3700346d'] = 'Callback recebido e validado com sucesso para o método de pagamento '; $_MODULE['<{ifthenpay}prestashop>callbackonline_db26e10564e958809d798e8048fcbc0a'] = 'Token de segurança inválido'; $_MODULE['<{ifthenpay}prestashop>callbackonline_472c0114336642a097060b6a5bfa12e3'] = 'Pagamento por cartão de crédito não é válido'; @@ -209,7 +212,7 @@ $_MODULE['<{ifthenpay}prestashop>config_39378e4ed45f9d286ae667780ad270b7'] = 'O seu módulo está atualizado!'; $_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_1ebf6b62a890e57840d9eed25d069624'] = 'Método de pagamento %s'; $_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_7ad8d66a3bc93f5ebaebc0092882fcb4'] = 'Este módulo permite o pagamento seguro por %s'; -$_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_72265b70acdcc3728ef11442b6c1536b'] = 'Se o cliente optar por pagar por %s, o estado da encomenda será colocado em \\\"Aguardar pagamento por %s\\\"'; +$_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_72265b70acdcc3728ef11442b6c1536b'] = 'Se o cliente optar por pagar por %s, o estado da encomenda será colocado em em \"Aguardar pagamento por %s\"'; $_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_55707fb9ad3705039365be529d5441e5'] = 'Quando o pagamento for feito, o estado da encomenda mudará para \\\"Pagamento confirmado por %s'; $_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_72ca82aa8d05626d154550e665ec9b26'] = 'Este módulo permite o pagamento seguro por cartão de crédito'; $_MODULE['<{ifthenpay}prestashop>paymentmethodsetup_539160f1dfd0df24e844c3144263f5f6'] = 'Caso o cliente opte por pagar com cartão de crédito, o estado da encomenda será colocado em \\\"Aguardar pagamento com cartão de crédito\\\"'; diff --git a/ifthenpay/views/css/ifthenpayAdminOrder_8_0_1.css b/ifthenpay/views/css/ifthenpayAdminOrder_8_0_2.css similarity index 100% rename from ifthenpay/views/css/ifthenpayAdminOrder_8_0_1.css rename to ifthenpay/views/css/ifthenpayAdminOrder_8_0_2.css diff --git a/ifthenpay/views/css/ifthenpayConfig_8_0_1.css b/ifthenpay/views/css/ifthenpayConfig_8_0_2.css similarity index 100% rename from ifthenpay/views/css/ifthenpayConfig_8_0_1.css rename to ifthenpay/views/css/ifthenpayConfig_8_0_2.css diff --git a/ifthenpay/views/css/ifthenpayConfirmPage_8_0_1.css b/ifthenpay/views/css/ifthenpayConfirmPage_8_0_2.css similarity index 100% rename from ifthenpay/views/css/ifthenpayConfirmPage_8_0_1.css rename to ifthenpay/views/css/ifthenpayConfirmPage_8_0_2.css diff --git a/ifthenpay/views/css/ifthenpayOrderDetail_8_0_1.css b/ifthenpay/views/css/ifthenpayOrderDetail_8_0_2.css similarity index 100% rename from ifthenpay/views/css/ifthenpayOrderDetail_8_0_1.css rename to ifthenpay/views/css/ifthenpayOrderDetail_8_0_2.css diff --git a/ifthenpay/views/css/ifthenpayPaymentMethodSetup_8_0_1.css b/ifthenpay/views/css/ifthenpayPaymentMethodSetup_8_0_2.css similarity index 100% rename from ifthenpay/views/css/ifthenpayPaymentMethodSetup_8_0_1.css rename to ifthenpay/views/css/ifthenpayPaymentMethodSetup_8_0_2.css diff --git a/ifthenpay/views/css/paymentOptions_8_0_1.css b/ifthenpay/views/css/paymentOptions_8_0_2.css similarity index 100% rename from ifthenpay/views/css/paymentOptions_8_0_1.css rename to ifthenpay/views/css/paymentOptions_8_0_2.css diff --git a/ifthenpay/views/js/adminAccountSettingsPage_8_0_1.js b/ifthenpay/views/js/adminAccountSettingsPage_8_0_2.js similarity index 100% rename from ifthenpay/views/js/adminAccountSettingsPage_8_0_1.js rename to ifthenpay/views/js/adminAccountSettingsPage_8_0_2.js diff --git a/ifthenpay/views/js/adminConfigPage_8_0_1.js b/ifthenpay/views/js/adminConfigPage_8_0_2.js similarity index 100% rename from ifthenpay/views/js/adminConfigPage_8_0_1.js rename to ifthenpay/views/js/adminConfigPage_8_0_2.js diff --git a/ifthenpay/views/js/adminOrderCreatePage_8_0_1.js b/ifthenpay/views/js/adminOrderCreatePage_8_0_2.js similarity index 100% rename from ifthenpay/views/js/adminOrderCreatePage_8_0_1.js rename to ifthenpay/views/js/adminOrderCreatePage_8_0_2.js diff --git a/ifthenpay/views/js/adminOrderDetailPage_8_0_1.js b/ifthenpay/views/js/adminOrderDetailPage_8_0_2.js similarity index 100% rename from ifthenpay/views/js/adminOrderDetailPage_8_0_1.js rename to ifthenpay/views/js/adminOrderDetailPage_8_0_2.js diff --git a/ifthenpay/views/js/mbwayCountdownConfirmPage_8_0_1.js b/ifthenpay/views/js/mbwayCountdownConfirmPage_8_0_2.js similarity index 100% rename from ifthenpay/views/js/mbwayCountdownConfirmPage_8_0_1.js rename to ifthenpay/views/js/mbwayCountdownConfirmPage_8_0_2.js diff --git a/ifthenpay/views/templates/hook/admin.tpl b/ifthenpay/views/templates/hook/admin.tpl index 437fecd..b20d2fc 100755 --- a/ifthenpay/views/templates/hook/admin.tpl +++ b/ifthenpay/views/templates/hook/admin.tpl @@ -143,13 +143,16 @@