Skip to content

Commit d5d6190

Browse files
committed
Merge branch 'refs/heads/release/7.5.5'
2 parents ecb0f9d + 37a494f commit d5d6190

File tree

9 files changed

+42
-90
lines changed

9 files changed

+42
-90
lines changed

mollie-payments-for-woocommerce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Mollie Payments for WooCommerce
44
* Plugin URI: https://www.mollie.com
55
* Description: Accept payments in WooCommerce with the official Mollie plugin
6-
* Version: 7.5.4
6+
* Version: 7.5.5
77
* Author: Mollie
88
* Author URI: https://www.mollie.com
99
* Requires at least: 5.0

resources/js/blocks/molliePaymentMethod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ const MollieComponent = (props) => {
246246
return <>{fields}</>;
247247
}
248248

249-
return <div><p></p></div>
249+
return <div><p>{item.content}</p></div>
250250
}
251251

252252

src/Activation/ActivationModule.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/Gateway/GatewayModule.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,19 @@ public function services(): array
108108
$availablePaymentMethods = $container->get('gateway.listAllMethodsAvailable');
109109
$klarnaOneFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.klarna_one_enabled', true);
110110
if (!$klarnaOneFlag) {
111-
return array_filter($availablePaymentMethods, static function ($method) {
111+
$availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) {
112112
return $method['id'] !== Constants::KLARNA;
113113
});
114114
}
115115
$bancomatpayFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.bancomatpay_enabled', true);
116116
if (!$bancomatpayFlag) {
117-
return array_filter($availablePaymentMethods, static function ($method) {
117+
$availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) {
118118
return $method['id'] !== Constants::BANCOMATPAY;
119119
});
120120
}
121-
$almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', false);
121+
$almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', true);
122122
if (!$almaFlag) {
123-
return array_filter($availablePaymentMethods, static function ($method) {
123+
$availablePaymentMethods = array_filter($availablePaymentMethods, static function ($method) {
124124
return $method['id'] !== Constants::ALMA;
125125
});
126126
}
@@ -808,8 +808,8 @@ public function addPhoneWhenRest($arrayContext)
808808
{
809809
$context = $arrayContext;
810810
$phoneMandatoryGateways = ['mollie_wc_gateway_in3'];
811-
$paymentMethod = $context->payment_data['payment_method'];
812-
if (in_array($paymentMethod, $phoneMandatoryGateways)) {
811+
$paymentMethod = $context->payment_data['payment_method'] ?? null;
812+
if ($paymentMethod && in_array($paymentMethod, $phoneMandatoryGateways)) {
813813
$billingPhone = $context->order->get_billing_phone();
814814
if (!empty($billingPhone) && $this->isPhoneValid($billingPhone)) {
815815
return;
@@ -819,7 +819,7 @@ public function addPhoneWhenRest($arrayContext)
819819
$context->order->save();
820820
return;
821821
}
822-
$billingPhone = $context->payment_data['billing_phone'];
822+
$billingPhone = $context->payment_data['billing_phone'] ?? null;
823823
if ($billingPhone && $this->isPhoneValid($billingPhone)) {
824824
$context->order->set_billing_phone($billingPhone);
825825
$context->order->save();
@@ -831,9 +831,9 @@ public function addBirthdateWhenRest($arrayContext)
831831
{
832832
$context = $arrayContext;
833833
$birthMandatoryGateways = ['mollie_wc_gateway_in3'];
834-
$paymentMethod = $context->payment_data['payment_method'];
835-
if (in_array($paymentMethod, $birthMandatoryGateways)) {
836-
$billingBirthdate = $context->payment_data['billing_birthdate'];
834+
$paymentMethod = $context->payment_data['payment_method'] ?? null;
835+
if ($paymentMethod && in_array($paymentMethod, $birthMandatoryGateways)) {
836+
$billingBirthdate = $context->payment_data['billing_birthdate'] ?? null;
837837
if ($billingBirthdate && $this->isBirthValid($billingBirthdate)) {
838838
$context->order->update_meta_data('billing_birthdate', $billingBirthdate);
839839
$context->order->save();

src/Gateway/Surcharge.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function buildDescriptionWithSurcharge($description, PaymentMethodI $paym
6666
*/
6767
public function buildDescriptionWithSurchargeForBlock(PaymentMethodI $paymentMethod)
6868
{
69-
$defaultDescription = $paymentMethod->getProperty('description') ?: '';
69+
$defaultDescription = $paymentMethod->getProperty('description') ?: ($paymentMethod->getProperty('defaultDescription') ?: '');
7070
$surchargeType = $paymentMethod->getProperty('payment_surcharge');
7171

7272
if (
@@ -76,9 +76,10 @@ public function buildDescriptionWithSurchargeForBlock(PaymentMethodI $paymentMet
7676
return $defaultDescription;
7777
}
7878
$feeText = $this->feeTextByType($surchargeType, $paymentMethod);
79-
$feeText = is_string($feeText) ? html_entity_decode($feeText) : false;
79+
$feeText = is_string($feeText) ? $defaultDescription . ' ' . html_entity_decode($feeText) : false;
80+
$defaultFeeText = $defaultDescription . ' ' . __('A surchage fee might apply');
8081

81-
return $feeText ?: __('A surchage fee might apply');
82+
return $feeText ?: $defaultFeeText;
8283
}
8384

8485
/**
@@ -336,7 +337,7 @@ protected function feeTextByType($surchargeType, PaymentMethodI $paymentMethod)
336337
protected function maybeAddTaxString(string $feeText): string
337338
{
338339
if (wc_tax_enabled()) {
339-
$feeText .= __(' (incl. VAT)', 'mollie-payments-for-woocommerce');
340+
$feeText .= __(' (excl. VAT)', 'mollie-payments-for-woocommerce');
340341
}
341342
return $feeText;
342343
}

src/PaymentMethods/Ideal.php

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public function getConfig(): array
1414
'id' => 'ideal',
1515
'defaultTitle' => __('iDEAL', 'mollie-payments-for-woocommerce'),
1616
'settingsDescription' => '',
17-
'defaultDescription' => __('Select your bank', 'mollie-payments-for-woocommerce'),
18-
'paymentFields' => true,
17+
'defaultDescription' => '',
18+
'paymentFields' => false,
1919
'instructions' => true,
2020
'supports' => [
2121
'products',
@@ -29,39 +29,6 @@ public function getConfig(): array
2929

3030
public function getFormFields($generalFormFields): array
3131
{
32-
$searchKey = 'advanced';
33-
$keys = array_keys($generalFormFields);
34-
$index = array_search($searchKey, $keys);
35-
$before = array_slice($generalFormFields, 0, $index + 1, true);
36-
$after = array_slice($generalFormFields, $index + 1, null, true);
37-
$paymentMethodFormFieds = [
38-
'issuers_dropdown_shown' => [
39-
'title' => __('Show iDEAL banks dropdown', 'mollie-payments-for-woocommerce'),
40-
'type' => 'checkbox',
41-
'description' => sprintf(
42-
__(
43-
'If you disable this, a dropdown with various iDEAL banks will not be shown in the WooCommerce checkout, so users will select a iDEAL bank on the Mollie payment page after checkout.',
44-
'mollie-payments-for-woocommerce'
45-
),
46-
$this->getConfig()['defaultTitle']
47-
),
48-
'default' => self::DEFAULT_ISSUERS_DROPDOWN,
49-
],
50-
'issuers_empty_option' => [
51-
'title' => __('Issuers empty option', 'mollie-payments-for-woocommerce'),
52-
'type' => 'text',
53-
'description' => sprintf(
54-
__(
55-
"This text will be displayed as the first option in the iDEAL issuers drop down, if nothing is entered, 'Select your bank' will be shown. Only if the above 'Show iDEAL banks dropdown' is enabled.",
56-
'mollie-payments-for-woocommerce'
57-
),
58-
$this->getConfig()['defaultTitle']
59-
),
60-
'default' => __('Select your bank', 'mollie-payments-for-woocommerce'),
61-
],
62-
];
63-
$before = array_merge($before, $paymentMethodFormFieds);
64-
$formFields = array_merge($before, $after);
65-
return $formFields;
32+
return $generalFormFields;
6633
}
6734
}

src/PaymentMethods/PaymentFieldsStrategies/IdealFieldsStrategy.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Shared/Data.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,20 @@ public function getMethodIssuers($apiKey, $testMode = false, $methodId = null)
464464
public function getMethodWithIssuersById($methodId, $apiKey)
465465
{
466466
$method = $this->getCachedMethodById($methodId);
467-
if ($method) {
467+
if ($method === false) {
468+
$method = [];
469+
}
470+
if (!empty($method['issuers'])) {
468471
return $method;
469472
}
470473
if (!$apiKey) {
471474
return false;
472475
}
473-
return $this->api_helper->getApiClient($apiKey)->methods->get(sprintf('%s', $methodId), [ "include" => "issuers" ]);
476+
$methodWithIssuers = $this->api_helper->getApiClient($apiKey)->methods->get(sprintf('%s', $methodId), [ "include" => "issuers" ]);
477+
if (!empty($methodWithIssuers->issuers)) {
478+
$method['issuers'] = $methodWithIssuers->issuers;
479+
}
480+
return $method;
474481
}
475482

476483
/**
@@ -695,7 +702,6 @@ public function getAllAvailablePaymentMethods($useCache = true)
695702
$locale = $this->getPaymentLocale();
696703
$filters_key = [];
697704
$filters_key['locale'] = $locale;
698-
$filters_key['include'] = 'issuers';
699705
$transient_id = $this->getTransientId(md5(http_build_query($filters_key)));
700706
try {
701707
if ($useCache) {

src/Shared/SharedDataDictionary.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ class SharedDataDictionary
7171
'mollie-plugin-version',
7272
'mollie-new-install',
7373
'mollie_wc_is_phone_required_flag',
74+
'_transient_mollie-wc-ideal_issuers_live',
75+
'_transient_mollie-wc-ideal_issuers_test',
76+
'_transient_timeout_mollie-wc-ideal_issuers_live',
77+
'_transient_timeout_mollie-wc-ideal_issuers_test',
78+
'_transient_timeout_mollie-wc-kbc_issuers_live',
79+
'_transient_timeout_mollie-wc-kbc_issuers_test',
80+
'_transient_mollie-wc-kbc_issuers_live',
81+
'_transient_mollie-wc-kbc_issuers_test',
82+
'_transient_timeout_mollie-wc-giftcard_issuers_test',
83+
'_transient_mollie-wc-giftcard_issuers_test',
84+
'_transient_timeout_mollie-wc-giftcard_issuers_live',
85+
'_transient_mollie-wc-giftcard_issuers_live',
7486
];
7587
public const DB_VERSION_PARAM_NAME = 'mollie-db-version';
7688
public const PLUGIN_VERSION_PARAM_NAME = 'mollie-plugin-version';

0 commit comments

Comments
 (0)