Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions controllers/admin/AdminSaferPayOfficialSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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),
Expand All @@ -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
*/
Expand Down
10 changes: 2 additions & 8 deletions controllers/front/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
107 changes: 0 additions & 107 deletions controllers/front/failIFrame.php

This file was deleted.

4 changes: 1 addition & 3 deletions controllers/front/failValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
128 changes: 0 additions & 128 deletions controllers/front/hostedIframe.php

This file was deleted.

Loading
Loading