diff --git a/controllers/admin/AdminSaferPayOfficialSettingsController.php b/controllers/admin/AdminSaferPayOfficialSettingsController.php index 4bd0e3589..9630cb8f4 100755 --- a/controllers/admin/AdminSaferPayOfficialSettingsController.php +++ b/controllers/admin/AdminSaferPayOfficialSettingsController.php @@ -362,7 +362,7 @@ public function ajaxProcessSaveGeneralSettings() } $configuration->set(SaferPayConfig::CONFIGURATION_NAME, $configurationName); $hostedFieldsTemplate = $this->getIntValue($data, 'hostedFieldsTemplate'); - if ($hostedFieldsTemplate < 1 || $hostedFieldsTemplate > 3) { + if ($hostedFieldsTemplate < 1 || $hostedFieldsTemplate > 2) { $hostedFieldsTemplate = SaferPayConfig::HOSTED_FIELDS_TEMPLATE_DEFAULT; } $configuration->set(SaferPayConfig::HOSTED_FIELDS_TEMPLATE, $hostedFieldsTemplate); @@ -605,7 +605,7 @@ private function collectSettingsData() 'orderStateAwaitingPayment' => (int) $configuration->get(SaferPayConfig::SAFERPAY_ORDER_STATE_CHOICE_AWAITING_PAYMENT), 'paymentDescription' => (string) $configuration->get(SaferPayConfig::SAFERPAY_PAYMENT_DESCRIPTION), 'configurationName' => (string) $configuration->get(SaferPayConfig::CONFIGURATION_NAME), - 'hostedFieldsTemplate' => (int) $configuration->get(SaferPayConfig::HOSTED_FIELDS_TEMPLATE), + 'hostedFieldsTemplate' => $this->getHostedFieldsTemplateForDisplay($configuration), 'modulePath' => $this->module->getPathUri(), 'orderIdOption' => (int) $configuration->get(SaferPayConfig::SAFERPAY_ORDER_ID_OPTION), 'debugMode' => (bool) $configuration->get(SaferPayConfig::SAFERPAY_DEBUG_MODE), @@ -627,6 +627,24 @@ private function collectSettingsData() return $data; } + /** + * Hosted-field style "3" (Inline Layout with Card) has been removed; clamp any + * legacy stored value to a still-supported style so the settings UI stays valid. + * + * @param SaferPayConfiguration $configuration + * @return int + */ + private function getHostedFieldsTemplateForDisplay($configuration) + { + $template = (int) $configuration->get(SaferPayConfig::HOSTED_FIELDS_TEMPLATE); + + if ($template < 1 || $template > 2) { + return SaferPayConfig::HOSTED_FIELDS_TEMPLATE_DEFAULT; + } + + return $template; + } + /** * Get all translatable strings for the React frontend */ diff --git a/controllers/front/ajax.php b/controllers/front/ajax.php index e26b30dc4..fb7b9ef64 100644 --- a/controllers/front/ajax.php +++ b/controllers/front/ajax.php @@ -134,17 +134,11 @@ private function getFailControllerLink($cartId, $secureKey, $moduleId) private function getSuccessControllerName($isBusinessLicence, $fieldToken) { - $successController = ControllerName::SUCCESS; - - if ($isBusinessLicence) { - $successController = ControllerName::SUCCESS_IFRAME; - } - if ($fieldToken) { - $successController = ControllerName::SUCCESS_HOSTED; + return ControllerName::SUCCESS_HOSTED; } - return $successController; + return ControllerName::SUCCESS; } private function submitHostedFields() diff --git a/controllers/front/failIFrame.php b/controllers/front/failIFrame.php deleted file mode 100644 index 1cc08c65b..000000000 --- a/controllers/front/failIFrame.php +++ /dev/null @@ -1,107 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -use Invertus\SaferPay\Config\SaferPayConfig; -use Invertus\SaferPay\Controller\AbstractSaferPayController; -use Invertus\SaferPay\Enum\ControllerName; -use Invertus\SaferPay\Logger\LoggerInterface; - -if (!defined('_PS_VERSION_')) { - exit; -} - -class SaferPayOfficialFailIFrameModuleFrontController extends AbstractSaferPayController -{ - const FILE_NAME = 'failIFrame'; - - protected $display_header = false; - protected $display_footer = false; - - public function init() - { - $this->display_header = true; - - parent::init(); - } - - public function initContent() - { - parent::initContent(); - - $cart = new \Cart(Tools::getValue('cartId')); - - /** - * Note: deleting cart prevents - * from further failing when creating order with same cart - */ - $cart->delete(); - - /** @var LoggerInterface $logger */ - $logger = $this->module->getService(LoggerInterface::class); - - $logger->debug(sprintf('%s - Controller called', self::FILE_NAME)); - - $logger->debug(sprintf('%s - Controller action ended', self::FILE_NAME)); - - - $this->setTemplate(SaferPayConfig::SAFERPAY_TEMPLATE_LOCATION . '/front/loading.tpl'); - } - - public function setMedia() - { - parent::setMedia(); - - $cartId = Tools::getValue('cartId'); - $moduleId = Tools::getValue('moduleId'); - $orderId = Tools::getValue('orderId'); - $secureKey = Tools::getValue('secureKey'); - - $failUrl = $this->context->link->getModuleLink( - $this->module->name, - ControllerName::FAIL, - [ - 'cartId' => $cartId, - 'secureKey' => $secureKey, - 'orderId' => $orderId, - 'moduleId' => $moduleId, - ], - true - ); - - $this->context->controller->registerStylesheet( - $this->module->name . '-iframe-css', - 'modules/' . $this->module->name . '/views/css/front/loading.css' - ); - - Media::addJsDef([ - 'redirectUrl' => $failUrl, - ]); - - $this->context->controller->registerJavascript( - $this->module->name . '-iframe-js', - '/modules/' . $this->module->name . '/views/js/front/saferpay_iframe.js' - ); - - return true; - } -} diff --git a/controllers/front/failValidation.php b/controllers/front/failValidation.php index d00ea2b00..270f4d55b 100644 --- a/controllers/front/failValidation.php +++ b/controllers/front/failValidation.php @@ -77,12 +77,10 @@ public function postProcess() $saferPayOrder->update(); $cartDuplicationService->restoreCart($cartId); - $isBusinessLicence = Tools::getValue(\Invertus\SaferPay\Config\SaferPayConfig::IS_BUSINESS_LICENCE); - $controller = $isBusinessLicence ? 'failIFrame' : 'fail'; $failUrl = $this->context->link->getModuleLink( $this->module->name, - $controller, + 'fail', [ 'cartId' => $cartId, 'secureKey' => $secureKey, diff --git a/controllers/front/hostedIframe.php b/controllers/front/hostedIframe.php deleted file mode 100644 index 91daa8f05..000000000 --- a/controllers/front/hostedIframe.php +++ /dev/null @@ -1,128 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -use Invertus\SaferPay\Config\SaferPayConfig; -use Invertus\SaferPay\Logger\LoggerInterface; -use PrestaShop\PrestaShop\Core\Checkout\TermsAndConditions; - -if (!defined('_PS_VERSION_')) { - exit; -} - -class SaferPayOfficialHostedIframeModuleFrontController extends ModuleFrontController -{ - const FILE_NAME = 'hostedIframe'; - - /** @var \SaferPayOfficial */ - public $module; - - public function initContent() - { - /** @var LoggerInterface $logger */ - $logger = $this->module->getService(LoggerInterface::class); - - $logger->debug(sprintf('%s - Controller called', self::FILE_NAME)); - - parent::initContent(); - - $paymentMethod = Tools::getValue('saved_card_method'); - $selectedCard = Tools::getValue("selectedCreditCard_{$paymentMethod}"); - - $this->context->smarty->assign([ - 'credit_card_front_url' => "{$this->module->getPathUri()}views/img/example-card/credit-card-front.png", - 'credit_card_back_url' => "{$this->module->getPathUri()}views/img/example-card/credit-card-back.png", - 'tos_cms' => SaferPayConfig::isVersionAbove177() ? $this->getDefaultTermsAndConditions() : null, - 'saferpay_selected_card' => $selectedCard, - ]); - - $logger->debug(sprintf('%s - Controller action ended', self::FILE_NAME)); - - $this->setTemplate( - SaferPayConfig::SAFERPAY_HOSTED_TEMPLATE_LOCATION . - 'template' . - Configuration::get(SaferPayConfig::HOSTED_FIELDS_TEMPLATE) . - '.tpl' - ); - } - - public function setMedia() - { - parent::setMedia(); - - Media::addJsDef([ - 'saferpay_field_access_token' => SaferPayConfig::getFieldAccessToken(), - 'saferpay_field_url' => SaferPayConfig::getFieldUrl(), - 'holder_name' => $this->module->l('Holder name', self::FILE_NAME), - 'saferpay_official_ajax_url' => $this->context->link->getModuleLink('saferpayofficial', 'ajax'), - 'saved_card_method' => Tools::getValue('saved_card_method'), - 'isBusinessLicence' => Tools::getValue('isBusinessLicence'), - ]); - - $this->context->controller->registerJavascript( - 'remote-saferpay-fields-js-lib', - SaferPayConfig::FIELDS_LIBRARY_DEFAULT_VALUE, - ['server' => 'remote', 'position' => 'bottom', 'priority' => 20] - ); - - $this->context->controller->registerJavascript( - 'hosted-template-js-init', - 'modules/' . $this->module->name . '/views/js/front/hosted-templates/template' . - Configuration::get(SaferPayConfig::HOSTED_FIELDS_TEMPLATE) . - ".js" - ); - $this->context->controller->registerJavascript( - 'hosted-template-js-submit', - 'modules/' . $this->module->name . '/views/js/front/hosted-templates/template_submit.js' - ); - - $this->context->controller->registerStylesheet( - 'theme-css', - 'modules/' . $this->module->name . '/views/css/front/hosted-templates/template' . - Configuration::get(SaferPayConfig::HOSTED_FIELDS_TEMPLATE) . - ".css" - ); - - return true; - } - - protected function getDefaultTermsAndConditions() - { - $cms = new CMS((int) Configuration::get('PS_CONDITIONS_CMS_ID'), $this->context->language->id); - - if (!Validate::isLoadedObject($cms)) { - return false; - } - - $link = $this->context->link->getCMSLink($cms, $cms->link_rewrite, (bool) Configuration::get('PS_SSL_ENABLED')); - - $termsAndConditions = new TermsAndConditions(); - $termsAndConditions - ->setText( - '[' . $cms->meta_title . ']', - $link - ) - ->setIdentifier('terms-and-conditions-footer'); - - return $termsAndConditions->format(); - } -} diff --git a/controllers/front/iframe.php b/controllers/front/iframe.php deleted file mode 100644 index 9d32ec99b..000000000 --- a/controllers/front/iframe.php +++ /dev/null @@ -1,149 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -use Invertus\SaferPay\Config\SaferPayConfig; -use Invertus\SaferPay\Controller\AbstractSaferPayController; -use Invertus\SaferPay\Controller\Front\CheckoutController; -use Invertus\SaferPay\Core\Payment\DTO\CheckoutData; -use Invertus\SaferPay\Enum\ControllerName; -use Invertus\SaferPay\Logger\LoggerInterface; - -if (!defined('_PS_VERSION_')) { - exit; -} - -class SaferPayOfficialIFrameModuleFrontController extends AbstractSaferPayController -{ - const FILE_NAME = 'iframe'; - - public $display_column_left = false; - - public function postProcess() - { - /** @var LoggerInterface $logger */ - $logger = $this->module->getService(LoggerInterface::class); - - $logger->debug(sprintf('%s - Controller called', self::FILE_NAME)); - - $cart = $this->context->cart; - $redirectLink = $this->context->link->getPageLink( - 'order', - true, - null, - [ - 'step' => 1, - ] - ); - if ($cart->id_customer == 0 - || $cart->id_address_delivery == 0 - || $cart->id_address_invoice == 0 - || !$this->module->active - ) { - Tools::redirect($redirectLink); - } - - $authorized = false; - foreach (Module::getPaymentModules() as $module) { - if ($module['name'] === $this->module->name) { - $authorized = true; - break; - } - } - if (!$authorized) { - $this->errors[] = $this->module->l('This payment method is not available.', self::FILE_NAME); - - $this->redirectWithNotifications($redirectLink); - } - - $customer = new Customer($cart->id_customer); - - if (!Validate::isLoadedObject($customer)) { - $logger->error(sprintf('%s - Customer not found', self::FILE_NAME), [ - 'context' => [], - 'exceptions' => [], - ]); - - Tools::redirect($redirectLink); - } - - $logger->debug(sprintf('%s - Controller action ended', self::FILE_NAME)); - } - - public function initContent() - { - parent::initContent(); - - $paymentMethod = Tools::getValue('saved_card_method'); - $selectedCard = Tools::getValue("selectedCreditCard_{$paymentMethod}"); - - try { - /** @var CheckoutController $checkoutController */ - $checkoutController = $this->module->getService(CheckoutController::class); - - // refactor it to create checkout data from validator request - $checkoutData = CheckoutData::create( - (int) $this->context->cart->id, - $paymentMethod, - (int) Tools::getValue(SaferPayConfig::IS_BUSINESS_LICENCE), - $selectedCard, - null, - null, - false, - 0 - ); - - $redirectUrl = $checkoutController->execute($checkoutData); - } catch (\Exception $exception) { - $redirectUrl = $this->context->link->getModuleLink( - $this->module->name, - ControllerName::FAIL, - [ - 'cartId' => $this->context->cart->id, - 'orderId' => Order::getIdByCartId($this->context->cart->id), - 'secureKey' => $this->context->cart->secure_key, - 'moduleId' => $this->module->id, - ], - true - ); - $this->redirectWithNotifications($redirectUrl); - } - - $this->context->smarty->assign([ - 'redirect' => $redirectUrl, - ]); - - $this->setTemplate(SaferPayConfig::SAFERPAY_TEMPLATE_LOCATION . '/front/saferpay_iframe.tpl'); - } - - public function setMedia() - { - parent::setMedia(); - - $this->registerStylesheet( - $this->module->name . '-iframe', - 'modules/' . $this->module->name . '/views/css/front/saferpay_iframe.css' - ); - - return true; - } -} diff --git a/controllers/front/return.php b/controllers/front/return.php index a65984b32..366fd7eec 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -112,8 +112,7 @@ public function postProcess() /** @var PaymentTypeProvider $paymentTypeProvider */ $paymentTypeProvider = $this->module->getService(PaymentTypeProvider::class); - if ($paymentTypeProvider->get($orderPayment) === PaymentType::IFRAME - || $paymentTypeProvider->get($orderPayment) === PaymentType::HOSTED_IFRAME) { + if ($paymentTypeProvider->get($orderPayment) === PaymentType::HOSTED_IFRAME) { $order = new Order(Order::getIdByCartId($cartId)); try { @@ -235,17 +234,11 @@ public function initContent() private function getSuccessControllerName($isBusinessLicence, $fieldToken, $usingSavedCard) { - $successController = ControllerName::SUCCESS; - - if ($isBusinessLicence) { - $successController = ControllerName::SUCCESS_IFRAME; - } - if ($fieldToken || $usingSavedCard) { - $successController = ControllerName::SUCCESS_HOSTED; + return ControllerName::SUCCESS_HOSTED; } - return $successController; + return ControllerName::SUCCESS; } /** @@ -389,30 +382,9 @@ private function createAndValidateOrder($assertResponseBody, $transactionStatus, private function getFailController($orderPayment) { - /** @var PaymentTypeProvider $paymentTypeProvider */ - $paymentTypeProvider = $this->module->getService(PaymentTypeProvider::class); - /** @var LoggerInterface $logger */ $logger = $this->module->getService(LoggerInterface::class); - $logger->debug('Getting fail controller', [ - 'context' => [], - 'controller' => self::FILE_NAME, - 'order_payment' => $orderPayment, - ]); - - $paymentRedirectType = $paymentTypeProvider->get($orderPayment); - - if ($paymentRedirectType === PaymentType::IFRAME) { - $logger->debug('Fail controller is FAIL_IFRAME', [ - 'context' => [], - 'controller' => self::FILE_NAME, - 'order_payment' => $orderPayment, - ]); - - return ControllerName::FAIL_IFRAME; - } - $logger->debug('Fail controller is FAIL', [ 'context' => [], 'controller' => self::FILE_NAME, diff --git a/controllers/front/successIFrame.php b/controllers/front/successIFrame.php deleted file mode 100644 index a75980d9e..000000000 --- a/controllers/front/successIFrame.php +++ /dev/null @@ -1,203 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -use Invertus\SaferPay\Config\SaferPayConfig; -use Invertus\SaferPay\Controller\AbstractSaferPayController; -use Invertus\SaferPay\Enum\ControllerName; -use Invertus\SaferPay\Logger\LoggerInterface; -use Invertus\SaferPay\Utility\ExceptionUtility; - -if (!defined('_PS_VERSION_')) { - exit; -} - -class SaferPayOfficialSuccessIFrameModuleFrontController extends AbstractSaferPayController -{ - const FILE_NAME = 'successIFrame'; - - protected $display_header = false; - protected $display_footer = false; - - public function init() - { - $this->display_header = true; - - parent::init(); - } - - public function postProcess() // todo refactor this by the logic provided - { - /** @var LoggerInterface $logger */ - $logger = $this->module->getService(LoggerInterface::class); - - $logger->debug(sprintf('%s - Controller called', self::FILE_NAME)); - - $cartId = Tools::getValue('cartId'); - $orderId = Tools::getValue('orderId'); - $secureKey = Tools::getValue('secureKey'); - $moduleId = Tools::getValue('moduleId'); - - $cart = new Cart($cartId); - - if ($cart->secure_key !== $secureKey) { - $this->errors[] = $this->module->l('Failed to validate cart.', self::FILE_NAME); - - $this->redirectWithNotifications($this->getOrderLink()); - } - - /** Purchase is made with card that needs to be saved */ - if (Tools::getValue('selectedCard') <= 0) { - return; - } - - try { - $logger->debug(sprintf('%s - Controller action ended', self::FILE_NAME)); - - Tools::redirect($this->getOrderConfirmationLink($cartId, $moduleId, $orderId, $secureKey)); - } catch (Exception $e) { - $logger->error($e->getMessage(), [ - 'context' => [], - 'exceptions' => ExceptionUtility::getExceptions($e), - ]); - - Tools::redirect( - $this->context->link->getModuleLink( - $this->module->name, - ControllerName::FAIL_IFRAME, - [ - 'cartId' => $cartId, - 'secureKey' => $secureKey, - 'orderId' => $orderId, - \Invertus\SaferPay\Config\SaferPayConfig::IS_BUSINESS_LICENCE => true, - ], - true - ) - ); - } - } - - public function initContent() - { - parent::initContent(); - $cartId = Tools::getValue('cartId'); - $moduleId = Tools::getValue('moduleId'); - $orderId = Tools::getValue('orderId'); - $secureKey = Tools::getValue('secureKey'); - - $orderLink = $this->context->link->getPageLink( - 'order-confirmation', - true, - null, - [ - 'id_cart' => $cartId, - 'id_module' => $moduleId, - 'id_order' => $orderId, - 'key' => $secureKey, - ] - ); - - $this->registerStylesheet( - $this->module->name . '-loading', - 'modules/' . $this->module->name . '/views/css/front/loading.css' - ); - - Media::addJsDef([ - 'redirectUrl' => $orderLink, - ]); - - $this->setTemplate(SaferPayConfig::SAFERPAY_TEMPLATE_LOCATION . '/front/loading.tpl'); - } - - public function setMedia() - { - parent::setMedia(); - - $cartId = Tools::getValue('cartId'); - $moduleId = Tools::getValue('moduleId'); - $orderId = Tools::getValue('orderId'); - $secureKey = Tools::getValue('secureKey'); - - $orderLink = $this->context->link->getPageLink( - 'order-confirmation', - true, - null, - [ - 'id_cart' => $cartId, - 'id_module' => $moduleId, - 'id_order' => $orderId, - 'key' => $secureKey, - ] - ); - - $this->registerStylesheet( - $this->module->name . '-loading', - 'modules/' . $this->module->name . '/views/css/front/loading.css' - ); - - Media::addJsDef([ - 'redirectUrl' => $orderLink, - ]); - - $this->context->controller->registerJavascript( - $this->module->name . '-iframe', - 'modules/' . $this->module->name . '/views/js/front/saferpay_iframe.js' - ); - - return true; - } - - /** - * @param int $cartId - * @param int $moduleId - * @param int $orderId - * @param string $secureKey - * - * @return string - */ - private function getOrderConfirmationLink($cartId, $moduleId, $orderId, $secureKey) - { - return $this->context->link->getPageLink( - 'order-confirmation', - true, - null, - [ - 'id_cart' => $cartId, - 'id_module' => $moduleId, - 'id_order' => $orderId, - 'key' => $secureKey, - ] - ); - } - - private function getOrderLink() - { - return $this->context->link->getPageLink( - 'order', - true, - null, - [ - 'step' => 1, - ] - ); - } -} diff --git a/src/Enum/ControllerName.php b/src/Enum/ControllerName.php index d1bfc5f2b..e3118226b 100644 --- a/src/Enum/ControllerName.php +++ b/src/Enum/ControllerName.php @@ -33,15 +33,11 @@ class ControllerName const CREDIT_CARDS = 'creditCards'; const CREDIT_CARDS_16 = 'creditCards16'; const FAIL = 'fail'; - const FAIL_IFRAME = 'failIFrame'; const FAIL_VALIDATION = 'failValidation'; - const HOSTED_IFRAME = 'hostedIframe'; - const IFRAME = 'iframe'; const NOTIFY = 'notify'; const PENDING_NOTIFY = 'pendingNotify'; const SUCCESS = 'success'; const SUCCESS_HOSTED = 'successHosted'; - const SUCCESS_IFRAME = 'successIFrame'; const VALIDATION = 'validation'; const RETURN_URL = 'return'; } diff --git a/src/Enum/PaymentType.php b/src/Enum/PaymentType.php index 865d7c52a..4442ebea8 100644 --- a/src/Enum/PaymentType.php +++ b/src/Enum/PaymentType.php @@ -30,6 +30,5 @@ class PaymentType { const BASIC = 'basic'; - const IFRAME = 'iframe'; const HOSTED_IFRAME = 'hosted_iframe'; } diff --git a/src/Presentation/Loader/PaymentFormAssetLoader.php b/src/Presentation/Loader/PaymentFormAssetLoader.php index 1c134406c..f4a517ec6 100644 --- a/src/Presentation/Loader/PaymentFormAssetLoader.php +++ b/src/Presentation/Loader/PaymentFormAssetLoader.php @@ -60,7 +60,6 @@ public function register($controller) 'saferpay_official_ajax_url' => $this->context->getLink()->getModuleLink('saferpayofficial', ControllerName::AJAX), 'saferpay_payment_types' => [ 'hosted_iframe' => PaymentType::HOSTED_IFRAME, - 'iframe' => PaymentType::IFRAME, 'basic' => PaymentType::BASIC, ], ]); @@ -154,7 +153,51 @@ private function registerDefaultCheckoutAssets($controller) $controller->registerStylesheet( $this->module->name . '-checkout', - 'modules/' . $this->module->name . '/views/css/front/saferpay_checkout.css' + 'modules/' . $this->module->name . '/views/css/front/saferpay_checkout.css', + ['version' => $this->module->version] + ); + + $this->registerInlineFieldsAssets($controller); + } + + /** + * Registers the Saferpay Fields SDK + inline renderer so Custom-Form cards show their + * card form inline in the default checkout instead of redirecting to a hosted page. + * Only relevant when the account has Fields (Business licence) and a field access token. + * + * @param OrderControllerCore $controller + */ + private function registerInlineFieldsAssets($controller) + { + if (!\Configuration::get(SaferPayConfig::BUSINESS_LICENSE . SaferPayConfig::getConfigSuffix())) { + return; + } + + if (!SaferPayConfig::getFieldAccessToken()) { + return; + } + + Media::addJsDef([ + 'saferpay_field_access_token' => SaferPayConfig::getFieldAccessToken(), + 'saferpay_field_url' => SaferPayConfig::getFieldUrl(), + 'holder_name' => $this->module->l('Holder name', 'PaymentFormAssetLoader'), + 'saferpay_internal_error' => $this->module->l('An error occurred while processing the card, please try again.', 'PaymentFormAssetLoader'), + 'saferpay_fields_incomplete_error' => $this->module->l('Please check the following:', 'PaymentFormAssetLoader'), + 'saferpay_field_label_cardnumber' => $this->module->l('Card number', 'PaymentFormAssetLoader'), + 'saferpay_field_label_expiration' => $this->module->l('Expiry date', 'PaymentFormAssetLoader'), + 'saferpay_field_label_cvc' => $this->module->l('CVC', 'PaymentFormAssetLoader'), + ]); + + $controller->registerJavascript( + 'remote-saferpay-fields-js-lib', + SaferPayConfig::FIELDS_LIBRARY_DEFAULT_VALUE, + ['server' => 'remote', 'position' => 'bottom', 'priority' => 20] + ); + + $controller->registerJavascript( + $this->module->name . '-inline-fields', + 'modules/' . $this->module->name . '/views/js/front/inline-fields.js', + ['position' => 'bottom', 'priority' => 21, 'version' => $this->module->version] ); } diff --git a/src/Provider/PaymentRedirectionProvider.php b/src/Provider/PaymentRedirectionProvider.php index b2f6f1317..f6564e212 100644 --- a/src/Provider/PaymentRedirectionProvider.php +++ b/src/Provider/PaymentRedirectionProvider.php @@ -26,7 +26,6 @@ use Invertus\SaferPay\Adapter\LegacyContext; use Invertus\SaferPay\Config\SaferPayConfig; use Invertus\SaferPay\Enum\ControllerName; -use Invertus\SaferPay\Enum\PaymentType; if (!defined('_PS_VERSION_')) { exit; @@ -39,13 +38,9 @@ class PaymentRedirectionProvider */ private $context; - /** @var PaymentTypeProvider */ - private $paymentTypeProvider; - - public function __construct(LegacyContext $context, PaymentTypeProvider $paymentTypeProvider) + public function __construct(LegacyContext $context) { $this->context = $context; - $this->paymentTypeProvider = $paymentTypeProvider; } /** @@ -55,26 +50,10 @@ public function __construct(LegacyContext $context, PaymentTypeProvider $payment */ public function provideRedirectionLinkByPaymentMethod($paymentMethod) { - $paymentType = $this->paymentTypeProvider->get($paymentMethod); - - if ($paymentType === PaymentType::HOSTED_IFRAME) { - return $this->context->getLink()->getModuleLink( - 'saferpayofficial', - ControllerName::HOSTED_IFRAME, - ['saved_card_method' => $paymentMethod, SaferPayConfig::IS_BUSINESS_LICENCE => true], - true - ); - } - - if ($paymentType === PaymentType::IFRAME) { - return $this->context->getLink()->getModuleLink( - 'saferpayofficial', - ControllerName::IFRAME, - ['saved_card_method' => $paymentMethod, SaferPayConfig::IS_BUSINESS_LICENCE => true], - true - ); - } - + // Card Fields render inline in the checkout (see inline-fields.js), which intercepts + // the submit. This redirect is only the no-JS fallback, so every method falls back to + // the Saferpay Payment Page. The legacy Transaction Interface and the hosted Fields + // page are no longer used. return $this->context->getLink()->getModuleLink( 'saferpayofficial', ControllerName::VALIDATION, diff --git a/src/Provider/PaymentTypeProvider.php b/src/Provider/PaymentTypeProvider.php index 88eb1ac39..1ddd1a70a 100644 --- a/src/Provider/PaymentTypeProvider.php +++ b/src/Provider/PaymentTypeProvider.php @@ -48,14 +48,13 @@ public function __construct( */ public function get(string $paymentMethod): string { + // Custom Form ON (Saferpay Fields, Business licence) => Saferpay Fields. + // Anything else (Custom Form OFF, non-Business) => Saferpay Payment Page. + // The legacy Transaction Interface (IFRAME) is no longer selectable (SL-374). if ($this->isHostedIframeRedirect($paymentMethod)) { return PaymentType::HOSTED_IFRAME; } - if ($this->isIframeRedirect($paymentMethod)) { - return PaymentType::IFRAME; - } - return PaymentType::BASIC; } @@ -63,30 +62,21 @@ public function get(string $paymentMethod): string * @param string $paymentMethod * @return bool */ - private function isIframeRedirect(string $paymentMethod): bool + private function isHostedIframeRedirect(string $paymentMethod): bool { - if (!in_array($paymentMethod, SaferPayConfig::TRANSACTION_METHODS)) { - return false; - } - if (!\Configuration::get(SaferPayConfig::BUSINESS_LICENSE . SaferPayConfig::getConfigSuffix())) { return false; } - return true; - } - - /** - * @param string $paymentMethod - * @return bool - */ - private function isHostedIframeRedirect(string $paymentMethod): bool - { - if (!$this->saferPayFieldRepository->isActiveByName($paymentMethod)) { - return false; + // Grouped cards render a single inline Fields form under the "Cards" option. + if ($paymentMethod === SaferPayConfig::PAYMENT_CARDS + && \Configuration::get(SaferPayConfig::SAFERPAY_GROUP_CARDS) + ) { + return true; } - if (!\Configuration::get(SaferPayConfig::BUSINESS_LICENSE . SaferPayConfig::getConfigSuffix())) { + // Individual cards use Fields when their "Custom form" toggle is on. + if (!$this->saferPayFieldRepository->isActiveByName($paymentMethod)) { return false; } diff --git a/views/css/front/hosted-templates/index.php b/views/css/front/hosted-templates/index.php deleted file mode 100644 index ee6227264..000000000 --- a/views/css/front/hosted-templates/index.php +++ /dev/null @@ -1,31 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/css/front/hosted-templates/template1.css b/views/css/front/hosted-templates/template1.css deleted file mode 100644 index 42d99342f..000000000 --- a/views/css/front/hosted-templates/template1.css +++ /dev/null @@ -1,38 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -#main { - background-color: #fff; - padding: 36px 42px; - border-radius: 36px; - box-shadow: 14px 14px 14px 14px #b3b3b3; - width: 450px; - margin-top: 30px; - margin-bottom: 100px; -} - -#wrapper, #center_column { - height: 600px; -} - -#fields-card-number, #fields-expiration, #fields-holder-name, #fields-cvc { - width: 100% !important; -} diff --git a/views/css/front/hosted-templates/template2.css b/views/css/front/hosted-templates/template2.css deleted file mode 100644 index 8d8d7911a..000000000 --- a/views/css/front/hosted-templates/template2.css +++ /dev/null @@ -1,65 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -#main { - background-color: #fff; - padding: 36px 42px; - border-radius: 36px; - box-shadow: 14px 14px #b3b3b3; - margin-top: 30px; - margin-bottom: 30px; - max-width: 700px; -} - -.form-group.row { - background-color: #E5E5E5; - border-radius: 8px; -} - -.col-form-label { - line-height: 2; - text-align: right; - padding-right: 0px; -} - -input.form-control { - border-color: #CFCFCF; - height: 46px; - padding-right: 0px; -} - -.col-sm-8 { - padding-right: 0px; -} - -#wrapper, #center_column { - height: 600px; -} - -@media (max-width: 576px) { - .col-sm-8 { - padding-left: 0; - } -} - -#fields-card-number, #fields-expiration, #fields-holder-name, #fields-cvc { - width: 100% !important; -} \ No newline at end of file diff --git a/views/css/front/hosted-templates/template3.css b/views/css/front/hosted-templates/template3.css deleted file mode 100644 index 1ee756eff..000000000 --- a/views/css/front/hosted-templates/template3.css +++ /dev/null @@ -1,99 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -.input-box .col { - padding-right: 0; - padding-left: 0; -} - -.input-container, .button-container { - display: flex; - justify-content: center; -} - -.form-control { - border: none; -} - -.submit-button { - width: 100%; -} - -.input-box .col { - padding-right: 5px; - padding-bottom: 5px; -} - -.input-box .col:last-child { - padding-right: 0; - padding-bottom: 0; -} - -@media (max-width: 767px) { - .input-box .col { - padding-right: 0; - } -} - -.credit-card-image { - width: 384px; - height: 249px; -} - -#credit-card { - background: url(../../../img/example-card/credit-card-front.png) no-repeat; - background-size: contain; -} - -.cardnumber { - background: url(../../../img/example-card/credit-card-front-card-number.png) no-repeat !important; -} - -.expiration { - background: url(../../../img/example-card/credit-card-front-expiration.png) no-repeat !important; -} - -.cvc { - background: url(../../../img/example-card/credit-card-back-cvc.png) no-repeat !important; -} - -.image-container { - flex: 1; - display: flex; - justify-content: center; - transition: transform 1s; -} - -.rotate-to-back { - transform: rotateY(-180deg); -} - -.rotate-element { - transform: rotateY(180deg); -} - -#fields-card-number, #fields-expiration, #fields-cvc { - width: 100% !important; -} - -#wrapper, #center_column { - height: 600px; -} \ No newline at end of file diff --git a/views/css/front/saferpay_checkout.css b/views/css/front/saferpay_checkout.css index f7fe67431..dc66ce0c9 100644 --- a/views/css/front/saferpay_checkout.css +++ b/views/css/front/saferpay_checkout.css @@ -51,3 +51,25 @@ input[type="radio"][name^="saved_card_"] { vertical-align: middle !important; margin: 0 !important; } + +/* The Saferpay Fields card inputs are cross-origin iframes. Their inner input border is + removed via the SDK "style" option, so this is the single visible field border. */ +.saferpay-inline-fields iframe { + display: block; + width: 100%; + border: 1px solid #ced4da; + border-radius: 3px; + box-sizing: border-box; + background: #fff; +} + +/* Focus feedback: the SDK's own focus styling is cleared (it shrank the field), so we + highlight the iframe border instead while a field is active. */ +.saferpay-inline-fields .form-group.is-focused iframe { + border-color: #2fb5d2; +} + +/* Highlight a field whose contents are invalid/missing (takes precedence over focus). */ +.saferpay-inline-fields .form-group.has-error iframe { + border-color: #e74c3c; +} diff --git a/views/css/front/saferpay_iframe.css b/views/css/front/saferpay_iframe.css deleted file mode 100644 index 4e2c35c08..000000000 --- a/views/css/front/saferpay_iframe.css +++ /dev/null @@ -1,25 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -#saferpay-iframe { - width: 100%; - height: 500px; -} \ No newline at end of file diff --git a/views/img/example-card/credit-card-back-cvc.png b/views/img/example-card/credit-card-back-cvc.png deleted file mode 100644 index e0ea287c8..000000000 Binary files a/views/img/example-card/credit-card-back-cvc.png and /dev/null differ diff --git a/views/img/example-card/credit-card-back.png b/views/img/example-card/credit-card-back.png deleted file mode 100644 index a0b502da4..000000000 Binary files a/views/img/example-card/credit-card-back.png and /dev/null differ diff --git a/views/img/example-card/credit-card-front-card-number.png b/views/img/example-card/credit-card-front-card-number.png deleted file mode 100644 index 71d3a64c0..000000000 Binary files a/views/img/example-card/credit-card-front-card-number.png and /dev/null differ diff --git a/views/img/example-card/credit-card-front-expiration.png b/views/img/example-card/credit-card-front-expiration.png deleted file mode 100644 index de2c924bb..000000000 Binary files a/views/img/example-card/credit-card-front-expiration.png and /dev/null differ diff --git a/views/img/example-card/credit-card-front.png b/views/img/example-card/credit-card-front.png deleted file mode 100644 index 3e6191119..000000000 Binary files a/views/img/example-card/credit-card-front.png and /dev/null differ diff --git a/views/img/example-card/index.php b/views/img/example-card/index.php deleted file mode 100644 index ee6227264..000000000 --- a/views/img/example-card/index.php +++ /dev/null @@ -1,31 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/img/hosted-templates/template3.jpg b/views/img/hosted-templates/template3.jpg deleted file mode 100644 index 7e4876621..000000000 Binary files a/views/img/hosted-templates/template3.jpg and /dev/null differ diff --git a/views/js/admin/settings-app/src/components/settings/general-settings.tsx b/views/js/admin/settings-app/src/components/settings/general-settings.tsx index 52b795687..2eac25f0f 100644 --- a/views/js/admin/settings-app/src/components/settings/general-settings.tsx +++ b/views/js/admin/settings-app/src/components/settings/general-settings.tsx @@ -85,14 +85,6 @@ export function GeneralSettings() {

- {/* Hosted field info banner */} -
- -

- {t('hostedFieldInfo')} -

-
- {/* Hosted field style selector */}
@@ -107,20 +99,25 @@ export function GeneralSettings() { {t('classicLayout')} {t('labeledLayout')} - {t('inlineLayoutWithCard')}

{t('hostedFieldStyleDescription')}

+ {/* Info banner sits next to the selector it describes */} +
+ +

+ {t('hostedFieldInfo')} +

+
{ diff --git a/views/js/front/hosted-templates/template1.js b/views/js/front/hosted-templates/template1.js deleted file mode 100644 index 1ec9ae6c4..000000000 --- a/views/js/front/hosted-templates/template1.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -var fields_to_validate = [ - "holdername", - "cardnumber", - "expiration", - "cvc" -]; - -$(document).ready(function () { - SaferpayFields.init({ - apiKey: saferpay_field_access_token, - url: saferpay_field_url, - placeholders: { - holdername: holder_name, - cardnumber: '0000 0000 0000 0000', - expiration: 'MM/YYYY', - cvc: '000' - }, - onSuccess: function () { - var element = document.getElementById('submit_hosted_field'); - element.removeAttribute('disabled'); - }, - onError: function (evt) { - $('.initialize-error-message').text(evt.message); - $('.initialize-error').show(); - }, - onValidated: function (e) { - $('.validation-error').show(); - - if (e.isValid) { - $('.error-' + e.fieldType).hide(); - } else { - $('.error-' + e.fieldType).show(); - } - - var invalidFields = fields_to_validate.filter(function (item) { - return $('.error-' + item).is(':visible') - }) - - if (invalidFields.length === 0) { - $('.validation-error').hide(); - } - } - }) -}); \ No newline at end of file diff --git a/views/js/front/hosted-templates/template2.js b/views/js/front/hosted-templates/template2.js deleted file mode 100644 index e5950597a..000000000 --- a/views/js/front/hosted-templates/template2.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -var fields_to_validate = [ - "holdername", - "cardnumber", - "expiration", - "cvc" -]; - -$(document).ready(function () { - SaferpayFields.init({ - apiKey: saferpay_field_access_token, - url: saferpay_field_url, - placeholders: { - holdername: holder_name, - cardnumber: '0000 0000 0000 0000', - expiration: 'MM/YYYY', - cvc: '000' - }, - onError: function (evt) { - $('.initialize-error-message').text(evt.message); - $('.initialize-error').show(); - }, - onSuccess: function () { - var element = document.getElementById('submit_hosted_field'); - element.removeAttribute('disabled'); - }, - onValidated: function (e) { - $('.validation-error').show(); - - if (e.isValid) { - $('.error-' + e.fieldType).hide(); - } else { - $('.error-' + e.fieldType).show(); - } - - var invalidFields = fields_to_validate.filter(function (item) { - return $('.error-' + item).is(':visible') - }) - - if (invalidFields.length === 0) { - $('.validation-error').hide(); - } - } - }); -}); \ No newline at end of file diff --git a/views/js/front/hosted-templates/template3.js b/views/js/front/hosted-templates/template3.js deleted file mode 100644 index 31c24d77c..000000000 --- a/views/js/front/hosted-templates/template3.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -var fields_to_validate = [ - "cardnumber", - "expiration", - "cvc" -]; - -$(document).ready(function () { - SaferpayFields.init({ - apiKey: saferpay_field_access_token, - url: saferpay_field_url, - placeholders: { - cardnumber: '0000 0000 0000 0000', - expiration: 'MM/YY', - cvc: '000' - }, - onError: function (evt) { - $('.initialize-error-message').text(evt.message); - $('.initialize-error').show(); - }, - onSuccess: function () { - var element = document.getElementById("submit_hosted_field"); - element.removeAttribute("disabled"); - }, - onFocus: function (e) { - var imageContainer = $('.image-container'); - var creditCardContainer = $('.credit-card-container'); - var creditCard = $('#credit-card'); - var frontElements = [ - 'cardnumber', - 'expiration' - ]; - - if (frontElements.includes(e.fieldType)) { - if (imageContainer.hasClass('rotate-to-back')) { - imageContainer.removeClass('rotate-to-back'); - - setTimeout(function () { - creditCardContainer.removeClass('rotate-element'); - creditCard.removeClass('cardnumber expiration cvc'); - creditCard.addClass(e.fieldType); - }, 300); - } else { - creditCardContainer.removeClass('rotate-element'); - creditCard.removeClass('cardnumber expiration cvc'); - creditCard.addClass(e.fieldType); - } - } else { - imageContainer.addClass('rotate-to-back'); - - setTimeout(function () { - creditCardContainer.addClass('rotate-element'); - creditCard.removeClass('cardnumber expiration cvc'); - creditCard.addClass(e.fieldType); - }, 300); - } - }, - onValidated: function (e) { - $('.validation-error').show(); - - if (e.isValid) { - $('.error-' + e.fieldType).hide(); - } else { - $('.error-' + e.fieldType).show(); - } - - var invalidFields = fields_to_validate.filter(function (item) { - return $('.error-' + item).is(':visible') - }) - - if (invalidFields.length === 0) { - $('.validation-error').hide(); - } - } - }); -}); \ No newline at end of file diff --git a/views/js/front/hosted-templates/template_submit.js b/views/js/front/hosted-templates/template_submit.js deleted file mode 100644 index 9e041cc2c..000000000 --- a/views/js/front/hosted-templates/template_submit.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -$(document).ready(function () { - document.getElementById('submit_hosted_field').onclick = function () { - if (!areAllFieldsValid) { - return; - } - - SaferpayFields.submit({ - onSuccess: function (evt) { - - $.ajax(saferpay_official_ajax_url, { - method: 'POST', - data: { - action: 'submitHostedFields', - paymentMethod: saved_card_method, - selectedCard: $("[name=saferpay_selected_card]").val(), - fieldToken: evt.token, - isBusinessLicence: isBusinessLicence, - ajax: 1 - }, - success: function (response) { - if (isJsonString(response)) { - window.location = $.parseJSON(response).url; - } else { - $('.internal-error').show(); - } - } - }); - - }, - onError: function (evt) { - showSubmissionError(evt.message); - } - }); - }; -}); - -function areAllFieldsValid() { - let invalidFields = fields_to_validate.filter(function (item) { - return $('.error-' + item).is(':visible') - }) - - return invalidFields.length === 0; -} - -function isJsonString(str) { - try { - JSON.parse(str); - } catch (e) { - return false; - } - - return true; -} - -function showSubmissionError(message) { - $('.submission-error-message').text(message); - $('.submission-error').show(); -} \ No newline at end of file diff --git a/views/js/front/inline-fields.js b/views/js/front/inline-fields.js new file mode 100644 index 000000000..0f59b2e1d --- /dev/null +++ b/views/js/front/inline-fields.js @@ -0,0 +1,340 @@ +/** + *NOTICE OF LICENSE + * + *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu + *@copyright SIX Payment Services + *@license SIX Payment Services + */ + +/** + * Renders the Saferpay Fields card form inline in the default PrestaShop checkout. + * + * The Saferpay Fields SDK binds to four fixed element IDs (fields-holder-name, + * fields-card-number, fields-expiration, fields-cvc), offers no way to scope to a + * container and no teardown. Moving an initialised field iframe in the DOM reloads it and + * breaks the binding. To show the form directly under whichever Saferpay card option is + * selected, we therefore render a fresh form (plain readonly-input placeholders) INTO the + * selected option's container and (re-)initialise the SDK on it. Selecting a different card + * option rebuilds the form there and re-initialises — re-init is supported as long as the + * placeholders are fresh DIV/SPAN/readonly-input elements, not the iframes of a prior init. + */ +(function () { + if (typeof saferpay_field_access_token === 'undefined' || !saferpay_field_access_token) { + return; + } + + var SLOT_ID = 'saferpay-inline-fields'; + var safeHolderName = typeof holder_name !== 'undefined' ? holder_name : 'Holder name'; + var safeInternalError = typeof saferpay_internal_error !== 'undefined' + ? saferpay_internal_error + : 'An error occurred, please try again.'; + + // The container id the form is currently rendered into, to avoid a redundant + // rebuild+re-init when the same option fires a spurious change event. + var renderedContainerId = null; + + // The customer-entered card inputs live in cross-origin Saferpay iframes, so their + // validity is only known through the SDK's onValidated callback. It fires when a field + // loses focus; an untouched field never fires it. We therefore default every required + // field to invalid so an all-empty form is correctly blocked on submit. + var REQUIRED_FIELDS = ['holdername', 'cardnumber', 'expiration', 'cvc']; + var fieldValidity = {}; + + // The Saferpay Fields SDK binds to fixed element IDs. Map each field type to its element + // so we can highlight the matching form-group on validation. + var FIELD_ELEMENT_IDS = { + holdername: 'fields-holder-name', + cardnumber: 'fields-card-number', + expiration: 'fields-expiration', + cvc: 'fields-cvc' + }; + + function resetValidity() { + fieldValidity = {}; + REQUIRED_FIELDS.forEach(function (fieldType) { + fieldValidity[fieldType] = false; + }); + } + + // Toggle a state class on the form-group wrapping a given field's iframe. + function toggleFieldClass(fieldType, className, on) { + var elementId = FIELD_ELEMENT_IDS[fieldType]; + if (elementId) { + $('#' + elementId).closest('.form-group').toggleClass(className, on); + } + } + + function fieldLabel(fieldType) { + var labels = { + holdername: safeHolderName, + cardnumber: typeof saferpay_field_label_cardnumber !== 'undefined' ? saferpay_field_label_cardnumber : 'Card number', + expiration: typeof saferpay_field_label_expiration !== 'undefined' ? saferpay_field_label_expiration : 'Expiry date', + cvc: typeof saferpay_field_label_cvc !== 'undefined' ? saferpay_field_label_cvc : 'CVC' + }; + return labels[fieldType] || fieldType; + } + + function fieldsFormMarkup() { + return '' + + '
' + + ' ' + + ' ' + + ' ' + + '
' + + ' ' + + ' ' + + '
' + + '
' + + ' ' + + ' ' + + '
' + + '
' + + '
' + + ' ' + + ' ' + + '
' + + '
' + + ' ' + + ' ' + + '
' + + '
' + + ' ' + + '
'; + } + + // A Saferpay card option that renders inline Fields (Custom Form ON). These carry the + // hidden saferpayPaymentType input set to the hosted_iframe value. + function isInlineFieldsOption($form) { + var type = $form.find('[name="saferpayPaymentType"]').val(); + return typeof saferpay_payment_types !== 'undefined' + && type === saferpay_payment_types.hosted_iframe; + } + + function selectedCardValue($form) { + var method = $form.find('[name="saved_card_method"]').val(); + return parseInt($form.find('[name="selectedCreditCard_' + method + '"]').val(), 10) || 0; + } + + function removeSlot() { + $('#' + SLOT_ID).remove(); + renderedContainerId = null; + } + + // Render a fresh Fields form into the selected option's container and initialise the SDK + // on it. Rebuilding fresh readonly-input placeholders each time keeps re-initialisation + // valid when the customer switches between card options. + function renderInto($container) { + var containerId = $container.attr('id'); + if (renderedContainerId === containerId && $('#' + SLOT_ID).length) { + return; + } + + removeSlot(); + resetValidity(); + + $container.append(fieldsFormMarkup()); + renderedContainerId = containerId; + + SaferpayFields.init({ + accessToken: saferpay_field_access_token, + url: saferpay_field_url, + placeholders: { + holdername: safeHolderName, + cardnumber: '0000 0000 0000 0000', + expiration: 'MM/YYYY', + cvc: '000' + }, + // The card inputs render inside cross-origin iframes; module CSS cannot reach + // them. Drop the SDK's default per-field input border (the single visible border + // is drawn on the iframe by saferpay_checkout.css), normalise the height so all + // four fields match, and vertically centre the text via line-height. The :focus + // rule repeats the sizing and clears the SDK's focus border/outline so the field + // does not shrink or gain a stray outline when active — focus feedback is instead + // shown on the iframe border via the onFocus/onBlur handlers below. + // Let the input size to its content and centre the text via equal top/bottom + // padding (native single-line centering). Forcing an explicit height/line-height + // fought the SDK's own iframe sizing and pushed the text off-centre. + style: { + '.form-control': 'box-sizing: border-box; width: 100%; margin: 0; padding: 8px 12px; line-height: normal; font-size: 14px; border: none; background: transparent;', + '.form-control:focus': 'border: none; outline: none; box-shadow: none;' + }, + onError: function (evt) { + $('#' + SLOT_ID + ' .initialize-error-message').text(evt.message); + $('#' + SLOT_ID + ' .initialize-error').show(); + }, + onValidated: function (evt) { + if (!evt || typeof evt.fieldType === 'undefined') { + return; + } + if (fieldValidity.hasOwnProperty(evt.fieldType)) { + fieldValidity[evt.fieldType] = !!evt.isValid; + } + toggleFieldClass(evt.fieldType, 'has-error', !evt.isValid); + }, + onFocus: function (evt) { + if (evt) { + toggleFieldClass(evt.fieldType, 'is-focused', true); + } + }, + onBlur: function (evt) { + if (evt) { + toggleFieldClass(evt.fieldType, 'is-focused', false); + } + } + }); + } + + function showSubmissionError(message) { + $('#' + SLOT_ID + ' .submission-error-message').text(message); + $('#' + SLOT_ID + ' .submission-error').show(); + } + + function hideSubmissionError() { + $('#' + SLOT_ID + ' .submission-error').hide(); + } + + // PrestaShop's theme adds a "disabled" class to the place-order button when it is + // clicked (to guard against double submits). When we abort the submit — because a field + // is invalid or the SDK rejects it — nothing re-enables the button, so the customer is + // stuck. Restore it here so they can retry after fixing the fields. + function reEnablePlaceOrder() { + $('#payment-confirmation button[type="submit"]').removeClass('disabled').removeAttr('disabled'); + } + + // Returns the list of required fields that are not currently valid, marking each as + // invalid so the user sees which ones need attention. + function invalidFieldLabels() { + var labels = []; + REQUIRED_FIELDS.forEach(function (fieldType) { + if (!fieldValidity[fieldType]) { + labels.push(fieldLabel(fieldType)); + toggleFieldClass(fieldType, 'has-error', true); + } + }); + return labels; + } + + function incompleteFieldsMessage(labels) { + var prefix = typeof saferpay_fields_incomplete_error !== 'undefined' + ? saferpay_fields_incomplete_error + : 'Please check the following:'; + return prefix + ' ' + labels.join(', '); + } + + function submitFields($form) { + SaferpayFields.submit({ + onSuccess: function (evt) { + $.ajax(saferpay_official_ajax_url, { + method: 'POST', + data: { + action: 'submitHostedFields', + paymentMethod: $form.find('[name="saved_card_method"]').val(), + selectedCard: 0, + fieldToken: evt.token, + isBusinessLicence: 1, + ajax: 1 + }, + success: function (response) { + try { + // jQuery may already have parsed a JSON response into an object. + var data = typeof response === 'string' ? JSON.parse(response) : response; + if (data && data.url) { + window.location = data.url; + } else { + $('#' + SLOT_ID + ' .internal-error').show(); + reEnablePlaceOrder(); + } + } catch (e) { + $('#' + SLOT_ID + ' .internal-error').show(); + reEnablePlaceOrder(); + } + }, + error: function () { + $('#' + SLOT_ID + ' .internal-error').show(); + reEnablePlaceOrder(); + } + }); + }, + onError: function (evt) { + // The SDK's raw message (e.g. "cannot store data, because fields contains + // invalid or missing data") is not actionable. Surface the same clear, + // field-specific message we use for pre-submit gating instead. + if (evt && evt.message) { + console.warn('Saferpay Fields submit error: ' + evt.message); + } + var labels = invalidFieldLabels(); + showSubmissionError(labels.length ? incompleteFieldsMessage(labels) : safeInternalError); + reEnablePlaceOrder(); + } + }); + } + + $(document).ready(function () { + if (!$('[name="saferpayPaymentType"]').length) { + return; + } + + // Render / remove the form as payment options are selected. Rendering into the + // selected option's own container places the fields directly under it. + $('body').on('change', 'input[name="payment-option"]', function () { + var $option = $('#pay-with-' + $(this).attr('id') + '-form'); + var $form = $option.find('form').first(); + + if ($form.length && isInlineFieldsOption($form) && selectedCardValue($form) <= 0) { + renderInto($option); + } else { + removeSlot(); + } + }); + + // Handle a payment option that is already selected on load (e.g. single option or + // themes that pre-select) — the change event would not fire on its own. + $('input[name="payment-option"]:checked').trigger('change'); + + // Intercept the place-order submit for inline Fields (new card) options. + $('body').on('submit', '[id^=pay-with-][id$=-form] form', function (event) { + var $form = $(this); + + if (!isInlineFieldsOption($form) || selectedCardValue($form) > 0) { + return; // saved-card & non-Fields flows are handled elsewhere + } + + event.preventDefault(); + event.stopImmediatePropagation(); + + hideSubmissionError(); + + // Block submission while any required card field is empty/invalid and tell the + // customer exactly which ones, instead of letting the SDK fail with a cryptic + // "cannot store data" message. + var labels = invalidFieldLabels(); + if (labels.length) { + showSubmissionError(incompleteFieldsMessage(labels)); + reEnablePlaceOrder(); + return; + } + + submitFields($form); + }); + }); +})(); diff --git a/views/js/front/saferpay_iframe.js b/views/js/front/saferpay_iframe.js deleted file mode 100644 index 24e07c6e2..000000000 --- a/views/js/front/saferpay_iframe.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - */ - -(function () { - if (top.location != location) { - top.location.href = redirectUrl; - } -})(); \ No newline at end of file diff --git a/views/templates/front/hosted-templates/index.php b/views/templates/front/hosted-templates/index.php deleted file mode 100644 index ee6227264..000000000 --- a/views/templates/front/hosted-templates/index.php +++ /dev/null @@ -1,31 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/front/hosted-templates/partials/all_errors.tpl b/views/templates/front/hosted-templates/partials/all_errors.tpl deleted file mode 100644 index 2fdddc0a7..000000000 --- a/views/templates/front/hosted-templates/partials/all_errors.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - - - - - - - \ No newline at end of file diff --git a/views/templates/front/hosted-templates/partials/all_errors_16.tpl b/views/templates/front/hosted-templates/partials/all_errors_16.tpl deleted file mode 100644 index 40eab9865..000000000 --- a/views/templates/front/hosted-templates/partials/all_errors_16.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - - - - - - - \ No newline at end of file diff --git a/views/templates/front/hosted-templates/partials/index.php b/views/templates/front/hosted-templates/partials/index.php deleted file mode 100644 index ee6227264..000000000 --- a/views/templates/front/hosted-templates/partials/index.php +++ /dev/null @@ -1,31 +0,0 @@ - - *@copyright SIX Payment Services - *@license SIX Payment Services - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/views/templates/front/hosted-templates/partials/initialize_error.tpl b/views/templates/front/hosted-templates/partials/initialize_error.tpl deleted file mode 100644 index c02c351ad..000000000 --- a/views/templates/front/hosted-templates/partials/initialize_error.tpl +++ /dev/null @@ -1,30 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} -
- {l s='Failed to initialize SaferPay Fields Form' mod='saferpayofficial'}
-
-
- -
-
- {l s='Please contact our customer support about this problem.' mod='saferpayofficial'} -
diff --git a/views/templates/front/hosted-templates/partials/internal_error.tpl b/views/templates/front/hosted-templates/partials/internal_error.tpl deleted file mode 100644 index 05ec55da4..000000000 --- a/views/templates/front/hosted-templates/partials/internal_error.tpl +++ /dev/null @@ -1,30 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} -
- {l s='Failed to successfully submit SaferPay Fields Form' mod='saferpayofficial'}
-
-
- {l s='Internal error occurred, unable to authorize payment' mod='saferpayofficial'} -
-
- {l s='Please contact our customer support about this problem' mod='saferpayofficial'} -
\ No newline at end of file diff --git a/views/templates/front/hosted-templates/partials/submission_error.tpl b/views/templates/front/hosted-templates/partials/submission_error.tpl deleted file mode 100644 index 5984b404a..000000000 --- a/views/templates/front/hosted-templates/partials/submission_error.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} -
- {l s='Failed to successfully submit SaferPay Fields Form' mod='saferpayofficial'} -
-
- -
\ No newline at end of file diff --git a/views/templates/front/hosted-templates/partials/validation_error.tpl b/views/templates/front/hosted-templates/partials/validation_error.tpl deleted file mode 100644 index e36877386..000000000 --- a/views/templates/front/hosted-templates/partials/validation_error.tpl +++ /dev/null @@ -1,33 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} -
- -
-
- -
-
- -
-
- -
\ No newline at end of file diff --git a/views/templates/front/hosted-templates/template1.tpl b/views/templates/front/hosted-templates/template1.tpl deleted file mode 100644 index 503132ae3..000000000 --- a/views/templates/front/hosted-templates/template1.tpl +++ /dev/null @@ -1,103 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - -{extends file='checkout/checkout.tpl'} - - - {block name='head'} - {include file='_partials/head.tpl'} - {/block} - - -{block name='checkout_process'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
-
- - -
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - - - - -
- - -{/block} - -{block name='content'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
-
- - -
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - - - - -
- - -{/block} \ No newline at end of file diff --git a/views/templates/front/hosted-templates/template2.tpl b/views/templates/front/hosted-templates/template2.tpl deleted file mode 100644 index c6f32b6b1..000000000 --- a/views/templates/front/hosted-templates/template2.tpl +++ /dev/null @@ -1,115 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - -{extends file='checkout/checkout.tpl'} - - - {block name='head'} - {include file='_partials/head.tpl'} - {/block} - - -{block name='content'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
-
- -
- - - -
- -{/block} - -{block name='checkout_process'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
-
- -
- - - -
- -{/block} \ No newline at end of file diff --git a/views/templates/front/hosted-templates/template3.tpl b/views/templates/front/hosted-templates/template3.tpl deleted file mode 100644 index cfd9375b8..000000000 --- a/views/templates/front/hosted-templates/template3.tpl +++ /dev/null @@ -1,127 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - -{extends file='checkout/checkout.tpl'} - - - {block name='head'} - {include file='_partials/head.tpl'} - {/block} - - -{block name='content'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
- -
- -
-
-
- - -
- -
- - -
- -
- - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - -{/block} - -{block name='checkout_process'} - - {include file="module:saferpayofficial/views/templates/front/hosted-templates/partials/all_errors.tpl"} - -
- -
- -
-
-
- - -
- -
- - -
- -
- - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - -{/block} \ No newline at end of file diff --git a/views/templates/front/saferpay_iframe.tpl b/views/templates/front/saferpay_iframe.tpl deleted file mode 100644 index 7180a76c2..000000000 --- a/views/templates/front/saferpay_iframe.tpl +++ /dev/null @@ -1,51 +0,0 @@ -{** - *NOTICE OF LICENSE - * - *This source file is subject to the Open Software License (OSL 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/osl-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 INVERTUS UAB www.invertus.eu - *@copyright SIX Payment Services - *@license SIX Payment Services - *} - -{extends file='checkout/checkout.tpl'} - - - {block name='head'} - {include file='_partials/head.tpl'} - {/block} - - -{block name='content'} -
- -
-{/block} - -{block name='checkout_process'} -
- -
-{/block} - -{block name='footer'} - -{/block}