diff --git a/202/build.xml b/202/build.xml index 9f095ac..ee2c72f 100644 --- a/202/build.xml +++ b/202/build.xml @@ -30,7 +30,7 @@ - + diff --git a/_dev/js/payment_bt.js b/_dev/js/payment_bt.js index e808923..4a2f6bf 100755 --- a/_dev/js/payment_bt.js +++ b/_dev/js/payment_bt.js @@ -241,7 +241,9 @@ const BraintreeSubmitPayment = () => { client: bt_client_instance, }, (ThreeDSecureerror, threeDSecure) => { if (ThreeDSecureerror) { + let popup_message = ''; btnConfirmation.prop('disabled', false); + switch (ThreeDSecureerror.code) { case 'THREEDS_HTTPS_REQUIRED': popup_message = bt_translations_https; diff --git a/_dev/scss/bt_admin.scss b/_dev/scss/bt_admin.scss index 574a463..3cb153d 100755 --- a/_dev/scss/bt_admin.scss +++ b/_dev/scss/bt_admin.scss @@ -37,6 +37,10 @@ display: flex !important; } +.bt__flex-wrap { + flex-wrap: wrap; +} + .stretchHeightForm form { height: 100%; } @@ -109,4 +113,14 @@ margin-right: 20px; } +.icon-lightbulb::before { + content: '\f0eb' !important; +} + +@media (max-width: 768px) { + .container-fluid .flex { + flex-direction: column; + } +} + diff --git a/braintreeofficial.php b/braintreeofficial.php index 6593d16..39845a7 100644 --- a/braintreeofficial.php +++ b/braintreeofficial.php @@ -470,6 +470,7 @@ public function hookActionOrderSlipAdd($params) $message = ''; $ex_detailed_message = ''; $capture = $this->serviceBraintreeOfficialCapture->loadByOrderBraintreeId($braintreeOrder->id); + if (Validate::isLoadedObject($capture) && !$capture->id_capture) { ProcessLoggerHandler::openLogger(); ProcessLoggerHandler::logError( @@ -482,8 +483,9 @@ public function hookActionOrderSlipAdd($params) $braintreeOrder->sandbox ); ProcessLoggerHandler::closeLogger(); - return true; + Tools::redirect($_SERVER['HTTP_REFERER'].'¬_payed_capture=1'); } + $status = $this->methodBraintreeOfficial->getTransactionStatus($braintreeOrder); if ($status == "submitted_for_settlement") { @@ -498,7 +500,7 @@ public function hookActionOrderSlipAdd($params) $braintreeOrder->sandbox ); ProcessLoggerHandler::closeLogger(); - return true; + Tools::redirect($_SERVER['HTTP_REFERER'].'¬_payed_capture=1'); } else { try { $refund_response = $this->methodBraintreeOfficial->partialRefund($params); @@ -537,6 +539,7 @@ public function hookActionOrderSlipAdd($params) $braintreeOrder->sandbox ); ProcessLoggerHandler::closeLogger(); + Tools::redirect($_SERVER['HTTP_REFERER'].'&error_refund=1'); } if ($ex_detailed_message) { ProcessLoggerHandler::openLogger(); @@ -550,6 +553,7 @@ public function hookActionOrderSlipAdd($params) $braintreeOrder->sandbox ); ProcessLoggerHandler::closeLogger(); + Tools::redirect($_SERVER['HTTP_REFERER'].'&error_refund=1'); } } } @@ -894,7 +898,7 @@ public function hookDisplayAdminOrderTop($params) protected function getPartialRefund() { $this->context->smarty->assign('chb_braintree_refund', $this->l('Refund Braintree')); - return $this->context->smarty->fetch('module:braintreeofficial/views/templates/hook/partialRefund.tpl'); + return $this->context->smarty->fetch(_PS_MODULE_DIR_ . 'braintreeofficial/views/templates/hook/partialRefund.tpl'); } public function hookDisplayAdminOrder($params) @@ -986,8 +990,8 @@ public function hookDisplayBackOfficeHeader() foreach ($ps_order_details as $order_detail) { // Switch to back order if needed - $product_stock = StockAvailable::getQuantityAvailableByProduct($order_detail['product_id'], $order_detail['product_attribute_id']); - if (Configuration::get('PS_STOCK_MANAGEMENT') && $product_stock <= 0) { + if (Configuration::get('PS_STOCK_MANAGEMENT') && + (int)$order_detail['product_quantity'] > (int)$order_detail['product_quantity_in_stock']) { $paid_state = Configuration::get('PS_OS_OUTOFSTOCK_PAID'); } } @@ -1067,9 +1071,12 @@ public function hookHeader() $carrierFees = $this->context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING); if ($carrierFees == 0) { - $messageForCustomer = $this->context->smarty->fetch('module:braintreeofficial/views/templates/front/_partials/messageForCustomerOne.tpl'); + $messageForCustomer = $this->context->smarty + ->assign('isSandbox', $this->methodBraintreeOfficial->isSandbox()) + ->fetch('module:braintreeofficial/views/templates/front/_partials/messageForCustomerOne.tpl'); } else { $this->context->smarty->assign('carrierFees', Tools::displayPrice($carrierFees)); + $this->context->smarty->assign('isSandbox', $this->methodBraintreeOfficial->isSandbox()); $messageForCustomer = $this->context->smarty->fetch('module:braintreeofficial/views/templates/front/_partials/messageForCustomerTwo.tpl'); } @@ -1252,7 +1259,8 @@ public function generateFormPB() 'path' => $this->_path, 'bt_method' => BRAINTREE_PAYPAL_PAYMENT, 'active_vaulting'=> Configuration::get('BRAINTREEOFFICIAL_VAULTING'), - 'show_paypal_benefits' => Configuration::get('BRAINTREEOFFICIAL_SHOW_PAYPAL_BENEFITS') + 'show_paypal_benefits' => Configuration::get('BRAINTREEOFFICIAL_SHOW_PAYPAL_BENEFITS'), + 'isSandbox' => $this->methodBraintreeOfficial->isSandbox() )); if (Configuration::get('BRAINTREEOFFICIAL_VAULTING')) { $payment_methods = $this->serviceBraintreeOfficialVaulting->getCustomerMethods($this->context->customer->id, BRAINTREE_PAYPAL_PAYMENT); @@ -1306,6 +1314,7 @@ public function generateFormBT() 'braintreeSubmitUrl'=> $this->context->link->getModuleLink($this->name, 'validation', array(), true), 'baseDir' => $this->context->link->getBaseLink($this->context->shop->id, true), 'method_bt' => BRAINTREE_CARD_PAYMENT, + 'isSandbox' => $this->methodBraintreeOfficial->isSandbox() )); return $this->context->smarty->fetch('module:braintreeofficial/views/templates/front/payment_bt.tpl'); diff --git a/classes/AdminBraintreeOfficialController.php b/classes/AdminBraintreeOfficialController.php index 087fc1e..4832149 100644 --- a/classes/AdminBraintreeOfficialController.php +++ b/classes/AdminBraintreeOfficialController.php @@ -38,6 +38,10 @@ public function __construct() public function init() { + if (\Tools::getValue('action') === 'set_sandbox_mode') { + \Configuration::updateValue('BRAINTREEOFFICIAL_SANDBOX', (int)\Tools::getValue('sandbox_mode')); + } + parent::init(); if ((int)\Configuration::get('BRAINTREEOFFICIAL_MIGRATION_FAILED') == 1) { @@ -49,6 +53,7 @@ public function init() } $this->context->smarty->assign('moduleDir', _MODULE_DIR_); + $this->context->smarty->assign('isModeSandbox', (int)\Configuration::get('BRAINTREEOFFICIAL_SANDBOX')); } public function renderForm($fields_form = null) @@ -201,4 +206,22 @@ public function getHooksUnregisteredMessage($hooks) $this->context->smarty->assign('hooks', $hooks); return $this->context->smarty->fetch($this->getTemplatePath() . '_partials/unregisteredHooksMessage.tpl'); } + + public function initPageHeaderToolbar() + { + $query = [ + 'token' => $this->token, + 'action' => 'set_sandbox_mode', + 'sandbox_mode' => \Configuration::get('BRAINTREEOFFICIAL_SANDBOX') ? 0 : 1 + ]; + $this->page_header_toolbar_btn['switch_sandbox'] = [ + 'desc' => $this->l('Sandbox mode'), + 'icon' => 'process-icon-toggle-' . (\Configuration::get('BRAINTREEOFFICIAL_SANDBOX') ? 'on' : 'off'), + 'help' => $this->l('Sandbox mode is the test environment where you\'ll be not able to collect any real payments.'), + 'href' => self::$currentIndex . '?' . http_build_query($query) + ]; + + parent::initPageHeaderToolbar(); + $this->context->smarty->clearAssign('help_link'); + } } diff --git a/classes/MethodBraintreeOfficial.php b/classes/MethodBraintreeOfficial.php index 5ce2bf6..05fd8be 100644 --- a/classes/MethodBraintreeOfficial.php +++ b/classes/MethodBraintreeOfficial.php @@ -1035,4 +1035,12 @@ public function getShortcutJsVars($page) return $tplVars; } + + /** + * @return bool + */ + public function isSandbox() + { + return (int)Configuration::get('BRAINTREEOFFICIAL_SANDBOX'); + } } diff --git a/controllers/admin/AdminBraintreeOfficialHelp.php b/controllers/admin/AdminBraintreeOfficialHelp.php index 8bdd440..855a12f 100644 --- a/controllers/admin/AdminBraintreeOfficialHelp.php +++ b/controllers/admin/AdminBraintreeOfficialHelp.php @@ -48,7 +48,7 @@ public function init() */ public function initContent() { - $need_rounding = (Configuration::get('PS_ROUND_TYPE') != Order::ROUND_ITEM) || (Configuration::get('PS_PRICE_ROUND_MODE') != PS_ROUND_HALF_DOWN); + $need_rounding = (Configuration::get('PS_ROUND_TYPE') != Order::ROUND_ITEM) || (Configuration::get('PS_PRICE_ROUND_MODE') != PS_ROUND_HALF_UP); $tpl_vars = array( 'need_rounding' => $need_rounding, ); diff --git a/controllers/admin/AdminBraintreeOfficialSetup.php b/controllers/admin/AdminBraintreeOfficialSetup.php index 0916cea..f5434a9 100644 --- a/controllers/admin/AdminBraintreeOfficialSetup.php +++ b/controllers/admin/AdminBraintreeOfficialSetup.php @@ -63,10 +63,6 @@ public function initContent() $formMerchantAccounts = $this->renderForm(); $this->clearFieldsForm(); - $this->initEnvironmentSettings(); - $formEnvironmentSettings = $this->renderForm(); - $this->clearFieldsForm(); - $this->initStatusBlock(); $formStatus = $this->renderForm(); $this->clearFieldsForm(); @@ -75,7 +71,6 @@ public function initContent() 'formAccountSettings' => $formAccountSettings, 'formPaymentSettings' => $formPaymentSettings, 'formMerchantAccounts' => $formMerchantAccounts, - 'formEnvironmentSettings' => $formEnvironmentSettings, 'formStatus' => $formStatus, 'showMessageAboutStateName' => (int)Configuration::get('BRAINTREEOFFICIAL_SHOW_MESSAGE_ABOUT_STATE_NAME') diff --git a/translations/br.php b/translations/br.php new file mode 100644 index 0000000..207cfff --- /dev/null +++ b/translations/br.php @@ -0,0 +1,30 @@ + + * @copyright PayPal + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +global $_MODULE; +$_MODULE = array(); +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Modo Sandbox : todas as transações serão fictícias'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Modo Sandbox : é o ambiente de teste onde você não será capaz de coletar nenhum pagamento real'; diff --git a/translations/de.php b/translations/de.php index 2f81704..d62b07b 100644 --- a/translations/de.php +++ b/translations/de.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -261,3 +261,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Beim Erstellen Ihres Web-Ablaufs ist ein Fehler aufgetreten. Überprüfen Sie Ihre Zugangsdaten.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Der Zugriff auf die API über ein Braintree-Konto ist nicht möglich?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Der Zugriff auf die API über ein Braintree-Konto ist nicht möglich?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Sandbox-Modus: Alle Transaktionen sind rein fiktiv'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Sandbox-Modus: dies ist die Testumgebung, in der Sie keine echten Zahlungen veranlassen können'; diff --git a/translations/en.php b/translations/en.php index 9ded7c7..d728bed 100644 --- a/translations/en.php +++ b/translations/en.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -250,3 +250,5 @@ $_MODULE['<{braintreeofficial}prestashop>tablelogs_88427ec035734b45aae9f7d8859a5008'] = 'Transaction ID:'; $_MODULE['<{braintreeofficial}prestashop>tablelogs_7761b2ef39506fa88f2a02bb18f00d29'] = 'Payment tools'; $_MODULE['<{braintreeofficial}prestashop>tablelogs_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Sandbox mode : all transactions will be fictitious'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Sandbox mode : is the test environment where you will not be able to collect any real payments'; diff --git a/translations/es.php b/translations/es.php index 50554bb..734bb49 100644 --- a/translations/es.php +++ b/translations/es.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -273,3 +273,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Se ha producido un error al crear tu experiencia web. Comprueba tus credenciales.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = '¿Es imposible acceder a la API a través de la cuenta Braintree?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = '¿Es imposible acceder a la API a través de la cuenta Braintree?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Modo Sandbox: todas las transacciones serán ficticias'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Modo Sandbox: es el entorno de prueba en el que no podrás cobrar ningún pago real'; diff --git a/translations/fr.php b/translations/fr.php index d7732be..b8ca52c 100644 --- a/translations/fr.php +++ b/translations/fr.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -274,3 +274,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Une erreur est survenue lors de la création de votre expérience web. Vérifiez vos identifiants.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossible d\'accéder à l\'API via le compte Braintree?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossible d\'accéder à l\'API via le compte Braintree?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Mode Sanbox: Toutes les transactions seront fictives'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Mode Sanbox: est un environement de test sur lequel vous ne collecterez pas de paiements réels'; diff --git a/translations/index.php b/translations/index.php index d33e943..27d35b6 100644 --- a/translations/index.php +++ b/translations/index.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) diff --git a/translations/it.php b/translations/it.php index 1b23d4c..2b892c6 100644 --- a/translations/it.php +++ b/translations/it.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -273,3 +273,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Errore durante la creazione della tua esperienza web. Controlla le credenziali.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossibile accedere all\'API tramite l\'account Braintree?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossibile accedere all\'API tramite l\'account Braintree?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Modalità Sandbox: tutte le transazioni saranno fittizie'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Modalità Sandbox: è l\'ambiente di prova dove non sarete in grado di raccogliere alcun pagamento reale'; diff --git a/translations/mx.php b/translations/mx.php new file mode 100644 index 0000000..165d04b --- /dev/null +++ b/translations/mx.php @@ -0,0 +1,30 @@ + + * @copyright PayPal + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +global $_MODULE; +$_MODULE = array(); +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Modo Sandbox: todas las transacciones serán ficticias'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Modo Sandbox: es el entorno de prueba en el que no podrás cobrar ningún pago real'; diff --git a/translations/nl.php b/translations/nl.php index e060495..9e74646 100644 --- a/translations/nl.php +++ b/translations/nl.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -261,3 +261,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Er is een fout opgetreden bij het creëren van uw webervaring. Controleer uw inloggegevens.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Onmogelijk om toegang te krijgen tot API via Braintree-account?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Onmogelijk om toegang te krijgen tot API via Braintree-account?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Sandbox modus: alle transacties zijn fictief'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Sandbox modus: is de testomgeving waar u niet in staat zult zijn om echte betalingen te innen'; diff --git a/translations/pl.php b/translations/pl.php index 176ffa5..8047495 100644 --- a/translations/pl.php +++ b/translations/pl.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -255,3 +255,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Wystąpił błąd podczas tworzenia strony internetowej. Sprawdź swoje dane uwierzytelniające.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Nie można uzyskać dostępu do interfejsu API za pośrednictwem konta Braintree?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Nie można uzyskać dostępu do interfejsu API za pośrednictwem konta Braintree?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Tryb Sandbox: wszystkie transakcje będą fikcyjne'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Tryb Sandbox: jest środowiskiem testowym, w którym nie można przyjąć prawdziwych płatności'; diff --git a/translations/pt.php b/translations/pt.php index f2d1599..e075765 100644 --- a/translations/pt.php +++ b/translations/pt.php @@ -1,6 +1,6 @@ * @copyright PayPal * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) @@ -261,3 +261,5 @@ $_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialmigration_51a9f5fc2e4d9b1c8aa4a60a7c725243'] = 'Ocorreu um erro ao criar a sua experiência na Web. Verifique as suas credenciais.'; $_MODULE['<{braintreeofficial}prestashop>help_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossível acessar a API via conta Braintree?'; $_MODULE['<{braintreeofficial}prestashop>formaccount_5c4a03273ee4e687ae2547a2416f59c0'] = 'Impossível acessar a API via conta Braintree?'; +$_MODULE['<{braintreeofficial}prestashop>messagesandbox_e8fdd95502f3d9eef321833fe60aed0c'] = 'Modo Sandbox : todas as transacções serão fictícias'; +$_MODULE['<{braintreeofficial}prestashop>adminbraintreeofficialcontroller_b38308023e216ac4faf73789566556c2'] = 'Modo Sandbox : é o ambiente de teste onde não será possível recolher quaisquer pagamentos reais'; diff --git a/views/templates/admin/_partials/blockPreviewButtonContext.tpl b/views/templates/admin/_partials/blockPreviewButtonContext.tpl index 1f824dd..3b26cb4 100644 --- a/views/templates/admin/_partials/blockPreviewButtonContext.tpl +++ b/views/templates/admin/_partials/blockPreviewButtonContext.tpl @@ -73,7 +73,7 @@ -
+
{l s='Shortcut converts best when activated on both product pages & cart page' mod='braintreeofficial'}
diff --git a/views/templates/admin/admin.tpl b/views/templates/admin/admin.tpl new file mode 100644 index 0000000..f3aafc9 --- /dev/null +++ b/views/templates/admin/admin.tpl @@ -0,0 +1,61 @@ +{* +* 2007-2021 PayPal +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author 2007-2021 PayPal +* @copyright PayPal +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* +*} + +{if isset($isModeSandbox) && $isModeSandbox} + +{/if} + +{block name='content'}{/block} + diff --git a/views/templates/admin/customizeCheckout.tpl b/views/templates/admin/customizeCheckout.tpl index aed2a2c..36c7364 100644 --- a/views/templates/admin/customizeCheckout.tpl +++ b/views/templates/admin/customizeCheckout.tpl @@ -25,13 +25,18 @@ * International Registered Trademark & Property of PrestaShop SA *} -{include './_partials/headerLogo.tpl'} +{extends file='./admin.tpl'} -{if isset($form)} - {$form nofilter} {*can not escape a variable. Variable contains html code*} -{/if} +{block name='content'} + {include './_partials/headerLogo.tpl'} + + {if isset($form)} + {$form nofilter} {*can not escape a variable. Variable contains html code*} + {/if} + + {if isset($advancedForm)} + {$advancedForm nofilter} {*can not escape a variable. Variable contains html code*} + {/if} +{/block} -{if isset($advancedForm)} - {$advancedForm nofilter} {*can not escape a variable. Variable contains html code*} -{/if} diff --git a/views/templates/admin/help.tpl b/views/templates/admin/help.tpl index f83f389..1a5bc82 100644 --- a/views/templates/admin/help.tpl +++ b/views/templates/admin/help.tpl @@ -22,75 +22,80 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{include './_partials/headerLogo.tpl'} -{if isset($need_rounding) && $need_rounding} - {include file="./_partials/block_info.tpl"} -{/if} +{extends file='./admin.tpl'} -
- +
+{/block} diff --git a/views/templates/admin/setup.tpl b/views/templates/admin/setup.tpl index c1d5490..3dd4a4a 100644 --- a/views/templates/admin/setup.tpl +++ b/views/templates/admin/setup.tpl @@ -18,44 +18,45 @@ * needs please refer to http://www.prestashop.com for more information. * * @author 202-ecommerce - * @copyright PayPal - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA - *} +* @copyright PayPal +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} -{if isset($showMessageAboutStateName) && $showMessageAboutStateName} - {include './_partials/messageAboutStateName.tpl'} -{/if} +{extends file='./admin.tpl'} -{include './_partials/headerLogo.tpl'} +{block name='content'} + {if isset($showMessageAboutStateName) && $showMessageAboutStateName} + {include './_partials/messageAboutStateName.tpl'} + {/if} -
-
-
- {if isset($formAccountSettings)} - {$formAccountSettings nofilter} {*can not escape a variable. Variable contains html code*} - {/if} -
-
- {if isset($formEnvironmentSettings)} - {$formEnvironmentSettings nofilter} {*can not escape a variable. Variable contains html code*} - {/if} -
-
+ {include './_partials/headerLogo.tpl'} -
-
- {if isset($formPaymentSettings)} - {$formPaymentSettings nofilter} {*can not escape a variable. Variable contains html code*} - {/if} - {if isset($formMerchantAccounts)} - {$formMerchantAccounts nofilter} {*can not escape a variable. Variable contains html code*} - {/if} +
+
+
+ {if isset($formAccountSettings)} + {$formAccountSettings nofilter} {*can not escape a variable. Variable contains html code*} + {/if} +
+
+ {if isset($formStatus)} + {$formStatus nofilter} {*can not escape a variable. Variable contains html code*} + {/if} +
-
- {if isset($formStatus)} - {$formStatus nofilter} {*can not escape a variable. Variable contains html code*} - {/if} + +
+
+ {if isset($formMerchantAccounts)} + {$formMerchantAccounts nofilter} {*can not escape a variable. Variable contains html code*} + {/if} +
+
+ {if isset($formPaymentSettings)} + {$formPaymentSettings nofilter} {*can not escape a variable. Variable contains html code*} + {/if} +
-
\ No newline at end of file +{/block} diff --git a/views/templates/front/_partials/messageForCustomerOne.tpl b/views/templates/front/_partials/messageForCustomerOne.tpl index b533086..2fb00c0 100644 --- a/views/templates/front/_partials/messageForCustomerOne.tpl +++ b/views/templates/front/_partials/messageForCustomerOne.tpl @@ -25,6 +25,10 @@ * International Registered Trademark & Property of PrestaShop SA *} +{if isset($isSandbox) && $isSandbox} + {include 'module:braintreeofficial/views/templates/front/_partials/messageSandbox.tpl'} +{/if} +
{{l s='You have to [b]finish your payment[/b] done with your PayPal account ' mod='braintreeofficial'}|braintreereplace nofilter} {if isset($payerEmail)}{$payerEmail|escape:'htmlall':'utf-8'}{/if} diff --git a/views/templates/front/_partials/messageForCustomerTwo.tpl b/views/templates/front/_partials/messageForCustomerTwo.tpl index 087fb54..3f2b1a7 100644 --- a/views/templates/front/_partials/messageForCustomerTwo.tpl +++ b/views/templates/front/_partials/messageForCustomerTwo.tpl @@ -25,6 +25,10 @@ * International Registered Trademark & Property of PrestaShop SA *} +{if isset($isSandbox) && $isSandbox} + {include 'module:braintreeofficial/views/templates/front/_partials/messageSandbox.tpl'} +{/if} +
{{l s='You have to [b]finish your payment[/b] done with your PayPal account ' mod='braintreeofficial'}|braintreereplace nofilter} {if isset($payerEmail)}{$payerEmail|escape:'htmlall':'utf-8'}{/if} diff --git a/views/templates/front/_partials/messageSandbox.tpl b/views/templates/front/_partials/messageSandbox.tpl new file mode 100644 index 0000000..f89d0a9 --- /dev/null +++ b/views/templates/front/_partials/messageSandbox.tpl @@ -0,0 +1,30 @@ +{* +* 2007-2020 PayPal +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author 2007-2020 PayPal +* @author 202 ecommerce + +* @copyright 202-ecommerce +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
+ {l s='Sandbox mode: all transactions will be fictitious.' mod='braintreeofficial'} +
diff --git a/views/templates/front/payment_bt.tpl b/views/templates/front/payment_bt.tpl index cfe4d15..716d7cc 100755 --- a/views/templates/front/payment_bt.tpl +++ b/views/templates/front/payment_bt.tpl @@ -25,6 +25,11 @@ * International Registered Trademark & Property of PrestaShop SA *} +{if isset($isSandbox) && $isSandbox} +
+ {include 'module:braintreeofficial/views/templates/front/_partials/messageSandbox.tpl'} +
+{/if} {*Displaying a button or the iframe*}
diff --git a/views/templates/front/payment_pbt.tpl b/views/templates/front/payment_pbt.tpl index f8ce068..6ba20be 100755 --- a/views/templates/front/payment_pbt.tpl +++ b/views/templates/front/payment_pbt.tpl @@ -25,6 +25,12 @@ * International Registered Trademark & Property of PrestaShop SA *} +{if isset($isSandbox) && $isSandbox} +
+ {include 'module:braintreeofficial/views/templates/front/_partials/messageSandbox.tpl'} +
+{/if} + {if isset($show_paypal_benefits) && $show_paypal_benefits} {include file='module:braintreeofficial/views/templates/front/paypal_info.tpl'} {/if} diff --git a/views/templates/hook/partialRefund.tpl b/views/templates/hook/partialRefund.tpl index 4263ab7..a06bee6 100755 --- a/views/templates/hook/partialRefund.tpl +++ b/views/templates/hook/partialRefund.tpl @@ -35,7 +35,7 @@ // Create checkbox and insert for Braintree refund if ($('#doPartialRefundBraintree').length == 0) { let newCheckBox = `

`; $('button[name=partialRefund]').parent('.partial_refund_fields').prepend(newCheckBox); } @@ -49,7 +49,7 @@