diff --git a/202/_dev/js/acdc.js b/202/_dev/js/acdc.js index e59557d2..5f9e6551 100644 --- a/202/_dev/js/acdc.js +++ b/202/_dev/js/acdc.js @@ -38,8 +38,6 @@ const ACDC = function(conf) { this.isMoveButtonAtEnd = conf['isMoveButtonAtEnd'] === undefined ? null : conf['isMoveButtonAtEnd']; this.buttonForm = conf['buttonForm'] === undefined ? null : conf['buttonForm']; - - this.isCardFields = conf['isCardFields'] === undefined ? false : conf['isCardFields']; }; ACDC.prototype.initButton = function() { @@ -71,7 +69,7 @@ ACDC.prototype.getIdOrder = function() { headers: { 'content-type': 'application/json;charset=utf-8' }, - body: JSON.stringify({page: 'cart', addAddress: 1, sca_verification: (this.isCardFields ? 'SCA_WHEN_REQUIRED' : '')}), + body: JSON.stringify({page: 'cart', addAddress: 1, sca_verification: 'SCA_WHEN_REQUIRED'}), }).then(function(res) { return res.json(); }).then(function(data) { @@ -111,11 +109,7 @@ ACDC.prototype.getPaypalButtonsContainer = function() { }; ACDC.prototype.initFields = function() { - if (this.isCardFields) { - this.initCardFields(); - } else { - this.initHostedFields(); - } + this.initCardFields(); }; ACDC.prototype.initCardFields = function() { diff --git a/classes/ACDC/AcdcPaymentMethod.php b/classes/ACDC/AcdcPaymentMethod.php index ecb596f4..e181664e 100644 --- a/classes/ACDC/AcdcPaymentMethod.php +++ b/classes/ACDC/AcdcPaymentMethod.php @@ -29,7 +29,6 @@ use Configuration; use Context; -use PayPal; use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\classes\Constants\PaypalConfigurations; @@ -66,11 +65,7 @@ public function render() protected function getTemplatePath() { - if ($this->isCardFields()) { - return 'module:paypal/views/templates/acdc/payment-option-card-fields.tpl'; - } else { - return 'module:paypal/views/templates/acdc/payment-option.tpl'; - } + return 'module:paypal/views/templates/acdc/payment-option.tpl'; } protected function getTplVars() @@ -79,7 +74,6 @@ protected function getTplVars() 'psPaypalDir' => _PS_MODULE_DIR_ . 'paypal', 'JSvars' => [ PaypalConfigurations::MOVE_BUTTON_AT_END => (int) Configuration::get(PaypalConfigurations::MOVE_BUTTON_AT_END), - 'isCardFields' => $this->isCardFields(), ], 'JSscripts' => $this->getScripts(), ]; @@ -90,23 +84,12 @@ protected function getTplVars() protected function getScripts() { $scripts = []; - - if ($this->isCardFields()) { - $srcLib = $this->method->getUrlJsSdkLib(['components' => 'card-fields,marks']); - } else { - $srcLib = $this->method->getUrlJsSdkLib(['components' => 'hosted-fields,marks']); - } - + $srcLib = $this->method->getUrlJsSdkLib(['components' => 'card-fields,marks']); $scripts['tot-paypal-acdc-sdk'] = [ 'src' => $srcLib, 'data-namespace' => 'totPaypalAcdcSdk', 'data-partner-attribution-id' => $this->getPartnerId(), ]; - - if (!$this->isCardFields()) { - $scripts['tot-paypal-acdc-sdk']['data-client-token'] = $this->getClientToken(); - } - $scripts['acdc'] = [ 'src' => __PS_BASE_URI__ . 'modules/paypal/views/js/acdc.js', ]; @@ -129,9 +112,4 @@ protected function getClientToken() return ''; } - - protected function isCardFields() - { - return (int) Configuration::get(PayPal::USE_CARD_FIELDS); - } } diff --git a/controllers/front/webhookhandler.php b/controllers/front/webhookhandler.php index 90f31245..87d4fd2f 100644 --- a/controllers/front/webhookhandler.php +++ b/controllers/front/webhookhandler.php @@ -72,7 +72,7 @@ public function run() } if (false == ($this->module->getWebhookOption()->isEnable() && $this->module->getWebhookOption()->isAvailable())) { - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + header($_SERVER['SERVER_PROTOCOL'] . ' 405 Method Not Allowed', true, 405); return; } @@ -102,7 +102,7 @@ public function run() null ); ProcessLoggerHandler::closeLogger(); - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request', true, 400); } } catch (\Exception $exception) { } catch (\Throwable $exception) {//for php version > 7 diff --git a/paypal.php b/paypal.php index 3a53cc5a..502868ee 100755 --- a/paypal.php +++ b/paypal.php @@ -122,8 +122,6 @@ class PayPal extends \PaymentModule implements WidgetInterface const ACCESS_TOKEN = 'PAYPAL_ACCESS_TOKEN'; - const USE_CARD_FIELDS = 'PAYPAL_USE_CARD_FIELDS'; - const SCA_WHEN_REQUIRED = 'SCA_WHEN_REQUIRED'; const SCA_ALWAYS = 'SCA_ALWAYS'; @@ -416,7 +414,6 @@ public function __construct() PaypalConfigurations::PUI_ENABLED => 1, PaypalConfigurations::SEPA_ENABLED => 1, PaypalConfigurations::ACDC_OPTION => 1, - self::USE_CARD_FIELDS => 1, ]; if (version_compare(_PS_VERSION_, '1.7.6', '<')) { diff --git a/views/templates/acdc/payment-option-card-fields.tpl b/views/templates/acdc/payment-option-card-fields.tpl deleted file mode 100644 index a909a5e8..00000000 --- a/views/templates/acdc/payment-option-card-fields.tpl +++ /dev/null @@ -1,69 +0,0 @@ -{** - * 2007-2024 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-2024 PayPal - * @author 202 ecommerce - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - * @copyright PayPal - * - *} - -{extends file='module:paypal/views/templates/acdc/payment-option.tpl'} - -{block name='style'} - -{/block} - diff --git a/views/templates/acdc/payment-option.tpl b/views/templates/acdc/payment-option.tpl index 66ede81a..1fe04906 100644 --- a/views/templates/acdc/payment-option.tpl +++ b/views/templates/acdc/payment-option.tpl @@ -28,11 +28,8 @@ {block name='style'}