Skip to content

Commit 2359247

Browse files
authored
Merge pull request #914 from mollie/release/7.5.5
Release/7.5.5-beta
2 parents 7111a67 + 215b868 commit 2359247

File tree

7 files changed

+39
-20
lines changed

7 files changed

+39
-20
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-beta.1
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/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)