Skip to content

Commit

Permalink
PIPRES-427: ideal v2 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed Jun 11, 2024
1 parent f465a4b commit 0fc66b8
Show file tree
Hide file tree
Showing 18 changed files with 29 additions and 350 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Changelog #

## Changes in release 6.2.1 ##
+ Ideal v2 payment method improvement

## Changes in release 6.2.0 ##
+ New payment methods: Bancomat and Alma
+ Apple certificate update
Expand Down
61 changes: 0 additions & 61 deletions src/Builder/Content/PaymentOption/IdealDropdownInfoBlock.php

This file was deleted.

25 changes: 0 additions & 25 deletions src/Builder/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,31 +372,6 @@ protected function getAccountSettingsSection($isApiKeyProvided)
],
];

$input = array_merge($input, [
[
'type' => 'select',
'label' => $this->module->l('Issuer list', self::FILE_NAME),
'tab' => $generalSettings,
'desc' => $this->module->l('Some payment methods (e.g. iDEAL) have an issuer list. Select where to display the list.', self::FILE_NAME),
'name' => Config::MOLLIE_ISSUERS[(int) $this->configuration->get(Config::MOLLIE_ENVIRONMENT) ? 'production' : 'sandbox'],
'options' => [
'query' => [
[
'id' => Config::ISSUERS_ON_CLICK,
'name' => $this->module->l('In the shop checkout', self::FILE_NAME),
],
[
'id' => Config::ISSUERS_PAYMENT_PAGE,
'name' => $this->module->l('In the Mollie Checkout', self::FILE_NAME),
],
],
'id' => 'id',
'name' => 'name',
],
],
]
);

$input[] = [
'type' => 'mollie-h2',
'tab' => $generalSettings,
Expand Down
7 changes: 1 addition & 6 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class Config
const LOGOS_NORMAL = 'normal';
const LOGOS_HIDE = 'hide';

const ISSUERS_ON_CLICK = 'on-click';
const ISSUERS_PAYMENT_PAGE = 'payment-page';
const METHODS_CONFIG = 'MOLLIE_METHODS_CONFIG';

const ENVIRONMENT_TEST = 0;
Expand Down Expand Up @@ -113,10 +111,7 @@ class Config

const MOLLIE_IMAGES = 'MOLLIE_IMAGES';
const MOLLIE_SHOW_RESEND_PAYMENT_LINK = 'MOLLIE_SHOW_RESEND_PAYMENT_LINK';
const MOLLIE_ISSUERS = [
'sandbox' => 'MOLLIE_SANDBOX_ISSUERS',
'production' => 'MOLLIE_PRODUCTION_ISSUERS',
];

const MOLLIE_CSS = 'MOLLIE_CSS';
const MOLLIE_DEBUG_LOG = 'MOLLIE_DEBUG_LOG';
const MOLLIE_METHOD_COUNTRIES = 'MOLLIE_METHOD_COUNTRIES';
Expand Down
4 changes: 0 additions & 4 deletions src/Handler/PaymentOption/PaymentOptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ private function isIdealPaymentMethod(MolPaymentMethod $paymentMethod)
return false;
}

if ($this->configurationAdapter->get(Config::MOLLIE_ISSUERS) !== Config::ISSUERS_ON_CLICK) {
return false;
}

return true;
}

Expand Down
1 change: 0 additions & 1 deletion src/Install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ protected function initConfig()
$this->configurationAdapter->updateValue(Config::MOLLIE_PAYMENTSCREEN_LOCALE, Config::PAYMENTSCREEN_LOCALE_BROWSER_LOCALE);
$this->configurationAdapter->updateValue(Config::MOLLIE_IFRAME, true);
$this->configurationAdapter->updateValue(Config::MOLLIE_IMAGES, Config::LOGOS_NORMAL);
$this->configurationAdapter->updateValue(Config::MOLLIE_ISSUERS, Config::ISSUERS_ON_CLICK);
$this->configurationAdapter->updateValue(Config::MOLLIE_CSS, '');
$this->configurationAdapter->updateValue(Config::MOLLIE_TRACKING_URLS, '');
$this->configurationAdapter->updateValue(Config::MOLLIE_DEBUG_LOG, Config::DEBUG_LOG_ERRORS);
Expand Down
1 change: 0 additions & 1 deletion src/Install/Uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ private function deleteConfig()
Config::MOLLIE_SEND_ORDER_CONFIRMATION,
Config::MOLLIE_IFRAME,
Config::MOLLIE_IMAGES,
Config::MOLLIE_ISSUERS,
Config::MOLLIE_CSS,
Config::MOLLIE_DEBUG_LOG,
Config::MOLLIE_DISPLAY_ERRORS,
Expand Down
27 changes: 1 addition & 26 deletions src/Provider/PaymentOption/IdealPaymentOptionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

use Mollie;
use Mollie\Adapter\LegacyContext;
use Mollie\Builder\Content\PaymentOption\IdealDropdownInfoBlock;
use Mollie\Provider\CreditCardLogoProvider;
use Mollie\Provider\OrderTotal\OrderTotalProviderInterface;
use Mollie\Provider\PaymentFeeProviderInterface;
Expand Down Expand Up @@ -81,11 +80,6 @@ class IdealPaymentOptionProvider implements PaymentOptionProviderInterface
*/
private $templateParser;

/**
* @var IdealDropdownInfoBlock
*/
private $idealDropdownInfoBlock;

/**
* @var LanguageService
*/
Expand All @@ -99,7 +93,6 @@ public function __construct(
CreditCardLogoProvider $creditCardLogoProvider,
PaymentFeeProviderInterface $paymentFeeProvider,
TemplateParserInterface $templateParser,
IdealDropdownInfoBlock $idealDropdownInfoBlock,
LanguageService $languageService,
OrderTotalProviderInterface $orderTotalProvider
) {
Expand All @@ -108,7 +101,6 @@ public function __construct(
$this->creditCardLogoProvider = $creditCardLogoProvider;
$this->paymentFeeProvider = $paymentFeeProvider;
$this->templateParser = $templateParser;
$this->idealDropdownInfoBlock = $idealDropdownInfoBlock;
$this->languageService = $languageService;
$this->orderTotalProvider = $orderTotalProvider;
}
Expand All @@ -131,31 +123,14 @@ public function getPaymentOption(MolPaymentMethod $paymentMethod): PaymentOption
['method' => $paymentMethod->getPaymentMethodName(), 'rand' => Mollie\Utility\TimeUtility::getCurrentTimeStamp()],
true
));
$paymentOption->setInputs([
'token' => [
'name' => 'issuer',
'type' => 'hidden',
'value' => '',
],
]);

$paymentOption->setAdditionalInformation($this->templateParser->parseTemplate(
$this->context->getSmarty(),
$this->idealDropdownInfoBlock,
$this->module->getLocalPath() . 'views/templates/hook/ideal_dropdown.tpl'
));

$paymentOption->setLogo($this->creditCardLogoProvider->getMethodOptionLogo($paymentMethod));

$paymentFeeData = $this->paymentFeeProvider->getPaymentFee($paymentMethod, $this->orderTotalProvider->getOrderTotal());

if ($paymentFeeData->isActive()) {
$paymentOption->setInputs(
[
[
'name' => 'issuer',
'type' => 'hidden',
'value' => '',
],
[
'type' => 'hidden',
'name' => 'payment-fee-price',
Expand Down
1 change: 0 additions & 1 deletion src/Service/ConfigFieldService.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function getConfigFieldsValues()
Config::MOLLIE_CSS => $this->configurationAdapter->get(Config::MOLLIE_CSS),
Config::MOLLIE_IMAGES => $this->configurationAdapter->get(Config::MOLLIE_IMAGES),
Config::MOLLIE_SHOW_RESEND_PAYMENT_LINK => $this->configurationAdapter->get(Config::MOLLIE_SHOW_RESEND_PAYMENT_LINK),
Config::MOLLIE_ISSUERS[(int) $this->configurationAdapter->get(Config::MOLLIE_ENVIRONMENT) ? 'production' : 'sandbox'] => $this->configurationAdapter->get(Config::MOLLIE_ISSUERS),

Config::MOLLIE_METHOD_COUNTRIES => $this->configurationAdapter->get(Config::MOLLIE_METHOD_COUNTRIES),
Config::MOLLIE_METHOD_COUNTRIES_DISPLAY => $this->configurationAdapter->get(Config::MOLLIE_METHOD_COUNTRIES_DISPLAY),
Expand Down
67 changes: 0 additions & 67 deletions src/Service/IssuerService.php

This file was deleted.

2 changes: 0 additions & 2 deletions src/Service/SettingsSaveService.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public function saveSettings(&$errors = [])

$mollieImages = $this->tools->getValue(Config::MOLLIE_IMAGES);
$showResentPayment = $this->tools->getValue(Config::MOLLIE_SHOW_RESEND_PAYMENT_LINK);
$mollieIssuers = $this->tools->getValue(Config::MOLLIE_ISSUERS[$environment ? 'production' : 'sandbox']);
$mollieCss = $this->tools->getValue(Config::MOLLIE_CSS);

if (!isset($mollieCss)) {
Expand Down Expand Up @@ -308,7 +307,6 @@ public function saveSettings(&$errors = [])
$this->configurationAdapter->updateValue(Config::MOLLIE_SINGLE_CLICK_PAYMENT, $mollieSingleClickPaymentEnabled);
$this->configurationAdapter->updateValue(Config::MOLLIE_IMAGES, $mollieImages);
$this->configurationAdapter->updateValue(Config::MOLLIE_SHOW_RESEND_PAYMENT_LINK, $showResentPayment);
$this->configurationAdapter->updateValue(Config::MOLLIE_ISSUERS, $mollieIssuers);
$this->configurationAdapter->updateValue(Config::MOLLIE_METHOD_COUNTRIES, (int) $mollieMethodCountriesEnabled);
$this->configurationAdapter->updateValue(Config::MOLLIE_METHOD_COUNTRIES_DISPLAY, (int) $mollieMethodCountriesDisplayEnabled);
$this->configurationAdapter->updateValue(Config::MOLLIE_CSS, $mollieCss);
Expand Down
1 change: 0 additions & 1 deletion upgrade/Upgrade-2.0.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
function upgrade_module_2_0_0()
{
Configuration::deleteByName('MOLLIE_VERSION');
Configuration::updateValue('MOLLIE_ISSUERS', 'payment-page');

return true;
}
3 changes: 0 additions & 3 deletions upgrade/Upgrade-6.0.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ function upgrade_module_6_0_1(Mollie $module): bool
$configuration->updateValue(Config::MOLLIE_IFRAME['production'], Configuration::get('MOLLIE_IFRAME'));
$configuration->updateValue(Config::MOLLIE_IFRAME['sandbox'], Configuration::get('MOLLIE_IFRAME'));

$configuration->updateValue(Config::MOLLIE_ISSUERS['production'], Configuration::get('MOLLIE_ISSUERS'));
$configuration->updateValue(Config::MOLLIE_ISSUERS['sandbox'], Configuration::get('MOLLIE_ISSUERS'));

$configuration->updateValue(Config::MOLLIE_SINGLE_CLICK_PAYMENT['production'], Configuration::get('MOLLIE_SINGLE_CLICK_PAYMENT'));
$configuration->updateValue(Config::MOLLIE_SINGLE_CLICK_PAYMENT['sandbox'], Configuration::get('MOLLIE_SINGLE_CLICK_PAYMENT'));

Expand Down
24 changes: 24 additions & 0 deletions upgrade/Upgrade-6.2.1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Mollie https://www.mollie.nl
*
* @author Mollie B.V. <[email protected]>
* @copyright Mollie B.V.
* @license https://github.com/mollie/PrestaShop/blob/master/LICENSE.md
*
* @see https://github.com/mollie/PrestaShop
*/

use Mollie\Adapter\ConfigurationAdapter;
use Mollie\Config\Config;

if (!defined('_PS_VERSION_')) {
exit;
}

function upgrade_module_6_2_1(Mollie $module): bool
{
//todo remove issuers list config
//todo remove table with issuers
return true;
}
27 changes: 0 additions & 27 deletions views/css/mollie.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,6 @@
color: #747474;
}

/****Mollie issuers****/
.mollie_issuer {
margin-left: auto;
margin-right: auto;
max-width: 400px;
}

.mollie_issuer_page {
box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, .2);
margin-top: 2rem;
margin-bottom: 2rem;
background: #fff;
padding: 1.25rem 1.875rem;
}

.mollie_issuers {
font-size: 16px;
margin-top: 1.25rem;
}

.mollie_issuers select, .mollie_issuers input {
border: 1px solid #D6D4D4;
border-radius: 4px;
background: #FBFBFB;
height: 20px;
}

.sortable-helper {
border-width: 2px!important;
-webkit-box-shadow: 2px 2px 16px -2px rgba(0,0,0,0.75);
Expand Down
Loading

0 comments on commit 0fc66b8

Please sign in to comment.