Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sl-221/cssurl feature removal #158

Merged
merged 11 commits into from
Oct 22, 2024
5 changes: 0 additions & 5 deletions controllers/admin/AdminSaferPayOfficialSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@ public function initOptions()
'type' => 'text',
'class' => 'fixed-width-xl',
],
SaferPayConfig::CSS_FILE => [
'title' => $this->l('CSS url'),
'type' => 'text',
'class' => 'fixed-width-xl',
],
],
'buttons' => [
'save_and_connect' => [
Expand Down
2 changes: 0 additions & 2 deletions src/Config/SaferPayConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class SaferPayConfig
const CREDIT_CARD_SAVE = 'SAFERPAY_CREDIT_CARD_SAVE';
const RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT = 'SAFERPAY_RESTRICT_REFUND_AMOUNT_TO_CAPTURED_AMOUNT';
const CONFIGURATION_NAME = 'SAFERPAY_CONFIGURATION_NAME';
const CSS_FILE = 'SAFERPAY_CSS_FILE';
const TEST_SUFFIX = '_TEST';
const API_VERSION = 1.37;
const PAYMENT_METHODS = [
Expand Down Expand Up @@ -376,7 +375,6 @@ public static function getUninstallConfiguration()
self::BUSINESS_LICENSE . self::TEST_SUFFIX,
self::PAYMENT_BEHAVIOR,
self::CONFIGURATION_NAME,
self::CSS_FILE,
self::PAYMENT_BEHAVIOR_WITHOUT_3D,
self::CREDIT_CARD_SAVE,
self::FIELDS_ACCESS_TOKEN,
Expand Down
14 changes: 0 additions & 14 deletions src/DTO/Request/Initialize/InitializeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ class InitializeRequest
*/
private $configSet;

/**
* @var string
*/
private $cssUrl;

/**
* @var Address
*/
Expand Down Expand Up @@ -131,7 +126,6 @@ public function __construct(
$notification,
DeliveryAddressForm $deliveryAddressForm,
$configSet,
$cssUrl,
Address $deliveryAddress,
Address $billingAddress,
$alias,
Expand All @@ -148,7 +142,6 @@ public function __construct(
$this->notification = $notification;
$this->deliveryAddressForm = $deliveryAddressForm;
$this->configSet = $configSet;
$this->cssUrl = $cssUrl;
$this->deliveryAddress = $deliveryAddress;
$this->billingAddress = $billingAddress;
$this->alias = $alias;
Expand Down Expand Up @@ -240,13 +233,6 @@ public function getAsArray()
$return['ConfigSet'] = $this->configSet;
}

if ($this->cssUrl) {
$return['Styling'] = [
'CssUrl' => $this->cssUrl,
'ContentSecurityEnabled' => true,
];
}

if ($this->alias || $this->fieldToken) {
unset($return['PaymentMethods']);
}
Expand Down
2 changes: 0 additions & 2 deletions src/Service/Request/InitializeRequestObjectCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public function create(
$notification = $isBusinessLicence ? null : $this->requestObjectCreator->createNotification($customerEmail, $notifyUrl);
$deliveryAddressForm = $this->requestObjectCreator->createDeliveryAddressForm();
$configSet = Configuration::get(SaferPayConfig::CONFIGURATION_NAME);
$cssUrl = Configuration::get(SaferPayConfig::CSS_FILE);

$customer = new Customer($customerId);
$deliveryAddress = new \Address($deliveryAddressId);
Expand All @@ -102,7 +101,6 @@ public function create(
$notification,
$deliveryAddressForm,
$configSet,
$cssUrl,
$deliveryAddress,
$invoiceAddress,
$alias,
Expand Down
7 changes: 6 additions & 1 deletion upgrade/install-1.2.2.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*@license SIX Payment Services
*/

use Invertus\SaferPay\Config\SaferPayConfig;

if (!defined('_PS_VERSION_')) {
exit;
}
Expand All @@ -31,6 +33,9 @@
*/
function upgrade_module_1_2_2($module)
{
return $module->registerHook('actionOrderHistoryAddAfter') && $module->unregisterHook('actionOrderStatusUpdate');
$module->registerHook('actionOrderHistoryAddAfter') && $module->unregisterHook('actionOrderStatusUpdate');
Configuration::deleteByName(SaferPayConfig::CSS_FILE);

return true;
}