From a7fc42fe177f3aae484de7ba8c04a97840422678 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 26 Apr 2024 10:39:06 +0200 Subject: [PATCH 01/19] Add requires header PIWOO-146 --- mollie-payments-for-woocommerce.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index e87005d1..9284b678 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.5.2 + * Version: 7.5.3-beta * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 @@ -14,6 +14,7 @@ * WC requires at least: 3.9 * WC tested up to: 8.7 * Requires PHP: 7.2 + * Requires Plugins: woocommerce */ declare(strict_types=1); From a951d165130eae53469017ca17b01ac28cedfc20 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 26 Apr 2024 10:41:01 +0200 Subject: [PATCH 02/19] Create release 7.5.3 --- mollie-payments-for-woocommerce.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index e87005d1..e8ad12e8 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.5.2 + * Version: 7.5.3-beta * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 From f2223df88541886551fb9b16291c2714774dd4aa Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 26 Apr 2024 10:53:57 +0200 Subject: [PATCH 03/19] Add alma payment method --- src/PaymentMethods/Alma.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/PaymentMethods/Alma.php diff --git a/src/PaymentMethods/Alma.php b/src/PaymentMethods/Alma.php new file mode 100644 index 00000000..87a9839b --- /dev/null +++ b/src/PaymentMethods/Alma.php @@ -0,0 +1,32 @@ + 'alma', + 'defaultTitle' => __('Alma', 'mollie-payments-for-woocommerce'), + 'settingsDescription' => '', + 'defaultDescription' => '', + 'paymentFields' => false, + 'instructions' => false, + 'supports' => [ + 'products', + 'refunds', + ], + 'filtersOnBuild' => false, + 'confirmationDelayed' => false, + 'SEPA' => false, + ]; + } + + public function getFormFields($generalFormFields): array + { + return $generalFormFields; + } +} From 4f0c07140179b91b7eff3ae6a50dec8a7d658111 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 29 Apr 2024 10:47:51 +0200 Subject: [PATCH 04/19] Add validate error on in3 future birthdate --- resources/js/blocks/molliePaymentMethod.js | 9 ++- src/Gateway/GatewayModule.php | 94 +++++++++++++++++++++- src/PaymentMethods/In3.php | 2 +- 3 files changed, 101 insertions(+), 4 deletions(-) diff --git a/resources/js/blocks/molliePaymentMethod.js b/resources/js/blocks/molliePaymentMethod.js index 3eeb5bc0..30a9d3f2 100644 --- a/resources/js/blocks/molliePaymentMethod.js +++ b/resources/js/blocks/molliePaymentMethod.js @@ -174,11 +174,16 @@ const MollieComponent = (props) => { } } let isPhoneEmpty = (billing.billingData.phone === '' && shippingData.shippingAddress.phone === '') && inputPhone === ''; - let isBirthdateEmpty = inputBirthdate === '' + let isBirthdateValid = inputBirthdate === '' + let today = new Date(); + let birthdate = new Date(inputBirthdate); + if (birthdate > today) { + isBirthdateValid = false + } const unsubscribeProcessing = onCheckoutValidation( () => { - if (activePaymentMethod === 'mollie_wc_gateway_in3' && (isPhoneEmpty || isBirthdateEmpty)) { + if (activePaymentMethod === 'mollie_wc_gateway_in3' && (isPhoneEmpty || isBirthdateValid)) { return { errorMessage: item.errorMessage, }; diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index ad652069..ba00c453 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -8,6 +8,7 @@ use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; use Automattic\WooCommerce\StoreApi\Exceptions\RouteException; +use DateTime; use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ExecutableModule; use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ModuleClassNameIdTrait; use Mollie\WooCommerce\Vendor\Inpsyde\Modularity\Module\ServiceModule; @@ -276,6 +277,7 @@ static function () { 11 ); add_action('woocommerce_rest_checkout_process_payment_with_context', [$this, 'addPhoneWhenRest'], 11); + add_action('woocommerce_rest_checkout_process_payment_with_context', [$this, 'addBirthdateWhenRest'], 11); } // Set order to paid and processed when eventually completed without Mollie @@ -659,7 +661,7 @@ public function in3FieldsMandatory($fields, $errors) $phoneLabel = __('Phone', 'mollie-payments-for-woocommerce'); $birthDateLabel = __('Birthdate', 'mollie-payments-for-woocommerce'); $fields = $this->addPaymentMethodMandatoryFieldsPhoneVerification($fields, $gatewayName, $phoneField, $phoneLabel, $errors); - return $this->addPaymentMethodMandatoryFields($fields, $gatewayName, $birthdateField, $birthDateLabel, $errors); + return $this->addPaymentMethodMandatoryFieldsBirthVerification($fields, $gatewayName, $birthdateField, $birthDateLabel, $errors); } /** @@ -675,6 +677,25 @@ public function in3FieldsMandatoryPayForOrder($order) $birthdateValue = filter_input(INPUT_POST, self::FIELD_IN3_BIRTHDATE, FILTER_SANITIZE_SPECIAL_CHARS) ?? false; $birthDateLabel = __('Birthdate', 'mollie-payments-for-woocommerce'); + if (!$birthdateValue) { + wc_add_notice( + sprintf( + __('%s is a required field.', 'woocommerce'), + "$birthDateLabel" + ), + 'error' + ); + } + $birthdateValue = $birthdateValue && $this->isBirthValid($birthdateValue) ? $birthdateValue : false; + if (!$birthdateValue) { + wc_add_notice( + sprintf( + __('%s is not a valid birthdate value.', 'woocommerce'), + "$birthDateLabel" + ), + 'error' + ); + } if (!$birthdateValue) { wc_add_notice( @@ -803,6 +824,46 @@ public function addPaymentMethodMandatoryFieldsPhoneVerification( return $fields; } + public function addPaymentMethodMandatoryFieldsBirthVerification( + $fields, + string $gatewayName, + string $field, + string $fieldLabel, + $errors + ) { + if ($fields['payment_method'] !== $gatewayName) { + return $fields; + } + if (isset($fields['billing_birthdate']) && $this->isBirthValid($fields['billing_birthdate'])) { + return $fields; + } + $fieldPosted = filter_input(INPUT_POST, $field, FILTER_SANITIZE_SPECIAL_CHARS) ?? false; + if (!$fieldPosted) { + $errors->add( + 'validation', + sprintf( + __('%s is a required field.', 'woocommerce'), + "$fieldLabel" + ) + ); + return $fields; + } + + if (!$this->isBirthValid($fieldPosted)) { + $errors->add( + 'validation', + sprintf( + __('%s is not a valid birthdate value.', 'woocommerce'), + "$fieldLabel" + ) + ); + return $fields; + } else { + $fields['billing_birthdate'] = $fieldPosted; + } + return $fields; + } + public function switchFields($data) { if (isset($data['payment_method']) && $data['payment_method'] === 'mollie_wc_gateway_in3') { @@ -825,6 +886,16 @@ private function isPhoneValid($billing_phone) return preg_match('/^\+[1-9]\d{10,13}$/', $billing_phone); } + private function isBirthValid($billing_birthdate) + { + $today = new DateTime(); + $birthdate = DateTime::createFromFormat('Y-m-d', $billing_birthdate); + if ($birthdate >= $today) { + return false; + } + return true; + } + public function addPhoneWhenRest($arrayContext) { $context = $arrayContext; @@ -849,4 +920,25 @@ public function addPhoneWhenRest($arrayContext) } } } + + public function addBirthdateWhenRest($arrayContext) + { + $context = $arrayContext; + $birthMandatoryGateways = ['mollie_wc_gateway_in3']; + $paymentMethod = $context->payment_data['payment_method']; + if (in_array($paymentMethod, $birthMandatoryGateways)) { + $billingBirthdate = $context->payment_data['billing_birthdate']; + if ($billingBirthdate && $this->isBirthValid($billingBirthdate)) { + $context->order->update_meta_data('billing_birthdate', $billingBirthdate); + $context->order->save(); + } else { + $message = __('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce'); + throw new RouteException( + 'woocommerce_rest_checkout_process_payment_error', + $message, + 402 + ); + } + } + } } diff --git a/src/PaymentMethods/In3.php b/src/PaymentMethods/In3.php index be4b7ec3..1bd847fb 100644 --- a/src/PaymentMethods/In3.php +++ b/src/PaymentMethods/In3.php @@ -23,7 +23,7 @@ public function getConfig(): array 'confirmationDelayed' => false, 'orderMandatory' => true, 'errorMessage' => __( - 'Required field is empty. Phone and birthdate fields are required.', + 'Required field is empty or invalid. Phone and birthdate fields are required.', 'mollie-payments-for-woocommerce' ), 'phonePlaceholder' => __('Please enter your phone here. +00..', 'mollie-payments-for-woocommerce'), From a6a9a1ae9ad5c55e05871b85fe0b8ea89f61ecee Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 29 Apr 2024 12:07:55 +0200 Subject: [PATCH 05/19] Change apple validation error string PIWOO-227 --- src/Buttons/ApplePayButton/ApplePayDirectHandler.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index 1d8b6326..0ac3a409 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -53,14 +53,12 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) } if (!$this->merchantValidated()) { - /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ + /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ $message = sprintf( - esc_html__( - '%1$sApple Pay Validation Error%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work', - 'mollie-payments-for-woocommerce' - ), - '', - '', + esc_html__( + 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', + 'mollie-payments-for-woocommerce' + ), '', '' ); From 02ffdac097c813c3f9545596eaf9a15a3464354d Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 29 Apr 2024 12:14:20 +0200 Subject: [PATCH 06/19] Fix phpcs PIWOO-227 --- src/Buttons/ApplePayButton/ApplePayDirectHandler.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index 0ac3a409..59a6a86b 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -55,10 +55,10 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) if (!$this->merchantValidated()) { /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ $message = sprintf( - esc_html__( - 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', - 'mollie-payments-for-woocommerce' - ), + esc_html__( + 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', + 'mollie-payments-for-woocommerce' + ), '', '' ); From a233c6bf2a86b51a20a56e065c327d2a06bd54ca Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 6 May 2024 16:36:28 +0200 Subject: [PATCH 07/19] Open link in new window --- src/Buttons/ApplePayButton/ApplePayDirectHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index 59a6a86b..bf80e8bb 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -59,7 +59,7 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', 'mollie-payments-for-woocommerce' ), - '', + '', '' ); From e9459174f626bc328c1bb9622a40c4aa5560455b Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 6 May 2024 16:52:55 +0200 Subject: [PATCH 08/19] Update to Syde and remove unneeded added also readme.txt from svn --- changelog.txt | 430 ----------------- composer.json | 4 +- deploy.sh | 150 ------ package.json | 6 +- playwright.config.js | 77 --- readme.txt | 1069 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 1074 insertions(+), 662 deletions(-) delete mode 100644 changelog.txt delete mode 100755 deploy.sh delete mode 100644 playwright.config.js create mode 100644 readme.txt diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index ab62879e..00000000 --- a/changelog.txt +++ /dev/null @@ -1,430 +0,0 @@ -== Changelog == - -= 5.4.2 - 09-12-2019 = - -* Fix - Mollie crash when WooCommerce plugin is not active -* Fix - Checkout form does not submit the order at first click on Place Order button when payment method is not one which support Mollie Components -* Fix - Minor styles issues for Mollie Components - -= 5.4.1 - 05-12-2019 = - -* Fix - Mollie Components request multiple times the merchant profile ID via API - -= 5.4.0 - 04-12-2019 = - -* Fix - Apple Pay Gateway is removed from available gateways during WooCommerce Api calls -* Fix - Giftcard Gateway does not show the right payment icon in checkout page -* Add - Support for Mollie Components - -= 5.3.2 - 04-11-2019 = - -* Fix - WooCommerce Session is not available before a specific action has been preformed causing null pointer exceptions in backend - -= 5.3.1 - 04-11-2019 = - -* Fix - Apple Pay payment method appear temporary in checkout page even if the device does not support Apple Pay -* Fix - Refunding per line items is not possible when the refund amount field is disabled in WooCommerce order edit page -* Fix - Compatibility with PHP 7.4 - -= 5.3.0 - 21-08-2019 = - -* Add - Introduce MyBank payment method -* Fix - Active Payment Object may be NULL causing WSOD after order is placed in Mollie -* Fix - ApplePay logo does not have the right resolution - -= 5.2.1 - 24-07-2019 = - -* Fix - Payment wall won't load because third party code may register gateways in form of a class instance instead of a string - -= 5.2.0 - 23-07-2019 = - -* Fix - Missing browser language detect in payment settings -* Add - Apple Pay payment method - -= 5.1.8 - 24-05-2019 = - -* Fix - Re-add "_orderlines_process_items_after_processing_item" hook -* Fix - Fix issue where renewal order status was not respecting settings -* Fix - Fix PHP Notice: Undefined property: Mollie_WC_Payment_Payment::$id, closes #289 -* Fix - Switch version check from woocommerce_db_version to woocommerce_version as the latter is re-added to database a lot faster when it's missing then the former. Might solve issues where Mollie plugin is disabled when WooCommerce updates. - -= 5.1.7 - 28-04-2019 = - -* Fix - Remove Bitcoin as payment gateway, no longer supported by Mollie, contact info@mollie.com for details -* Fix - Add extra check for URL's with parameters and correct them is structure is incorrect -* Fix - getMethodIssuers: improve caching of issuers (iDEAL, KBC/CBC) -* Fix - During payment always check if a product exists, if it doesn't create a Mollie Payment instead of Mollie Order - -= 5.1.6 - 10-04-2019 = - -* New - Add support for Przelewy24 (Poland) - -= 5.1.5 - 22-03-2019 = - -* Fix - Refunds: Fix condition for extended (order line) refunds -* Fix - WPML compatibility: Use get_home_url() to solve issues where people have different URLs for admin/site - -= 5.1.4 - 21-03-2019 = - -* Fix - Fix caching issues for methods check -* Fix - Only run isValidForUse (and resulting API calls) in the WooCommerce settings - -= 5.1.3 - 21-03-2019 = - -* Fix - Revert: Check that cached methods are stored as array, otherwise retrieve from API, fixes 'Cannot use object' error - -= 5.1.2 - 20-03-2019 = - -* Fix - Convert de_DE_formal to de_DE -* Fix - Check that cached methods are stored as array, otherwise retrieve from API, fixes 'Cannot use object' error - -= 5.1.1 - 19-03-2019 = - -* New - Added two new actions when processing items for Orders API, mollie-payments-for-woocommerce_orderlines_process_items_before_getting_product_id and mollie-payments-for-woocommerce_orderlines_process_items_after_processing_item -* Fix - Fixed bug where expired orders weren't updated in WooCommerce because of check for payment ID instead of order ID -* Fix - Use get_home_url() to solve issues where people have different URLs for admin/site (also influences Polylang) -* Fix - Extended refund processing: make sure people can't do a partial order line amount refund during an order line refund -* Fix - Permanent fix for PHP 7.3 with sporadic caching issues of methods - -= 5.1.0 - 19-02-2019 = - -* New - Enable 'refunds' for Klarna and SEPA Direct Debit payments -* New - Support refunds per order line for payments via the Orders API (used to be only amount refunds) -* New - Updated "Tested up to" to WordPress 5.1 -* New - Automatically updating Mollie Orders from WooCommerce to "Ship and Capture" and "Cancel" now supports all payments via Orders API, not just Klarna payments -* New - Add support for refunding full Mollie Orders when refunding the full WooCommerce order (Orders API) -* New - Update order lines processing to use Order instead of Cart data (for Orders API and Klarna) -* New - Orders API/Klarna: also send WooCommerce order item id to Mollie as metadata, to allow for individual order line refunding -* New - Pro-actively check for required PHP JSON extension -* New - Added filter so merchants can manipulate the payment object metadata, default filter id mollie-payments-for-woocommerce_payment_object_metadata, also see https://www.mollie/WooCommerce/wiki/Helpful-snippets#add-custom-information-to-mollie-payment-object-metadata -* New - Add billing country to payment methods cache in checkout, for when customers change their country in checkout -* New - Allow developers to hook into the subscription renewal payment before it's processed with mollie-payments-for-woocommerce_before_renewal_payment_created -* New - Set Payment screen language setting to wp_locale by default - -* Fix - Temporary fix for PHP 7.3 with sporadic caching issues of methods, better fix is now being tested -* Fix - Check if WooCommerce Subscriptions Failed Recurring Payment Retry System is in-use, if it is, don't update subscription status -* Fix - Polylang: another fix for edge-case with URL parameter, please test and provide feedback is you use Polylang! -* Fix - Too many customers redirected to "Pay now" after payment, add isAuthorized to status check in getReturnRedirectUrlForOrder() -* Fix - Add extra warning to order note for orders that are completed at Mollie (not WooCommerce) -* Fix - Improve onWebhookFailed for WooCommerce Subscriptions so failed payments at Mollie are failed orders at WooCommerce - -= 5.0.7 - 04-12-2018 = - -* Fix - Bancontact payments don't return a name as part of IBAN details (in Mollie API), so in that case use the WooCommerce name -* Fix - WooCommerce 2.6 and older: use get_country instead of get_billing_country -* Fix - Remove calls to delete payment mode, renewal payments can't use a different mode anyway, mandates aren't shared between modes -* Fix - Subscription renewal payments: if subscription does not contain the payment mode, try getting it from the parent order -* Fix - For shipping details use !empty() instead of isset -* Fix - Further improve restore_mollie_customer_id so it catches more edge-cases (and rename to restore_mollie_customer_id_and_mandate) -* Fix - Remove delete meta calls for meta that wasn't used anywhere (_mollie_card_4_digits) - -= 5.0.6 - 23-11-2018 = - -* Fix - Set subscription to On-Hold if renewal order gets a charge-back, add action hooks after refunds and chargebacks -* Fix - Update translation function call - -= 5.0.5 - 22-11-2018 = - -* Fix - WooCommerce Subscriptions: improve support for options "Accept Manual Renewals" and "Turn off Automatic Payments" -* Fix - Update Refunds and Chargebacks processing to support Orders and Payments API -* Fix - Remove option to set a description for payments, the new Orders API does not support this -* Fix - Update is_available to use billing country, and add filter Mollie_WC_Plugin::PLUGIN_ID . '_is_available_billing_country_for_payment_gateways' -* Fix - Add new hook after renewal payment is created: mollie-payments-for-woocommerce_after_renewal_payment_created -* Fix - Improve warnings in WooCommerce > Settings > Payments so they are less confusing to users (and really dismissable) -* Fix - Simplify log messages in shipAndCaptureOrderAtMollie, cancelOrderAtMollie - -= 5.0.4 - 08-11-2018 = - -* Fix - Get test mode higher in scheduled_subscription_payment() process -* Fix - Add automated option to restore a customer ID from Mollie API -* Fix - Store sequenceType in the correct position for payments - - -= 5.0.3 - 01-11-2018 = - -* Fix - Improvements to refunds: better log messages, show errors to shop-manager -* Fix - Remove option to set a description for payments, the new Orders API does not support this -* Fix - Update WooCommerce status constants in our plugin (cancelled and refunded) -* Fix - Make sure customer ID is stored by getting the payment object with all payments embedded -* Fix - Get and use correct _mollie_payment_id in setActiveMolliePaymentForOrders and setActiveMolliePaymentForSubscriptions -* Fix - Move adding of sequenceType into payment object -* Fix - Update Webship Giftcard logo to webshopgiftcard.svg - -* Fix - Klarna/Orders API: Also send Address Line 2 to Mollie Orders API -* Fix - Klarna/Orders API: In billing and shipping address check that fields aren't just a space -* Fix - Klarna/Orders API: Decode HTML entities in product names before sending them to Mollie -* Fix - Klarna/Orders API: Don't fall back to Payments API if payment method is Klarna -* Fix - Klarna/Orders API: Only add shipping address if all required fields are present -* Fix - Klarna/Orders API: Always store Mollie order ID as _mollie_order_id -* Fix - Klarna/Orders API: Add fallback to getActiveMolliePayment and try to get payment ID from Mollie order if possible - -= 5.0.2 - 11-10-2018 = - -IMPORTANT -This version requires PHP 5.6 or higher. If you are using an older PHP version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). - -* New - Now supports [Klarna Pay later](https://www.mollie.com/en/payments/klarna-pay-later) and [Klara Slice it](https://www.mollie.com/en/payments/klarna-slice-it), [read more](https://www.mollie.com/en/news/post/mollie-partners-with-klarna-for-maximum-payment-flexibility) -* New - Implemented support for the new Orders API -* New - Tested with and updated for WooCommerce 3.5 beta compatibility -* New - EPS, GiroPay: implemented support for SEPA first payments (recurring payments) - -* Fix - Fixed for "Uncaught Error: Call to a member function isOpen() on null" -* Fix - Fixed issue with Guzzle and PhpScoper - -* Fix - WooCommerce emails: make sure "Payment completed by..." message is only shown once per email -* Fix - WooCommerce Subscriptions: add support for "Accept Manual Renewals". This enables Bank Transfer and PayPal in checkout for subscription products. -* Fix - Mollie payment gateways weren't always shows when cart was empty. -* Fix - Fix for "Link expired" message after refresh methods in WooCommerce settings -* Fix - Stricter check for valid API key when individual gateways are loaded -* Fix - Added new action hook in Mollie_WC_Gateway_Abstract::getReturnRedirectUrlForOrder() -* Fix - Improve log messages for orderNeedsPayment check, old messages where confusing to merchants -* Fix - Update VVV giftcard logo filename - -= 4.0.2 - 07-08-2018 = - -* Fix - Reverted to older version of Mollie API PHP client, as it caused more issues than it fixed. This means conflicts with other plugins that use Guzzle are still possible. Use Mollie Payments For WooCommerce 3.0.6 if you also use plugins Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact until we can provide a solution. If you experience issues, please contact us. [Please review this article.](https://github.com/mollie/WooCommerce/wiki/Composer-Guzzle-conflicts) - -= 4.0.1 - 06-08-2018 = - -IMPORTANT -Version 4.0 requires PHP 5.6 or higher. If you are using an older PHP version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). - -* New - [Multicurrency support for WooCommerce added](https://www.mollie.com/en/features/multicurrency/) -* New - [New payment methods EPS and GiroPay added](https://www.mollie.com/en/news/post/introducing-two-new-payment-methods-eps-and-giropay) -* New - Updated payment method logo's (better quality SVG's) -* New - Updated Mollie API PHP to 2.0.10 - -* New - Add support for failed regular payments (already had support for failed renewal payments) -* New - In WooCommerce order edit view, add direct link to payment in Mollie Dashboard -* New - Add notice to use bank transfer via Mollie, not default BACS gateway -* New - Add support for new refunds and chargebacks processing (that are initiated in Mollie Dashboard) - -* Fix - Guzzle conflicts with other plugins solved (Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact) -* Fix - "cURL error 60" fixed by including valid cacert.pem file -* Fix - Make sure getting the shop currency is also possible on WooCommerce 2.6 or older -* Fix - Fix "Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in " by adding try/catch blocks for serialize() for the rare cases where __sleep() isn't found in PHP -* Fix - Check that a locale (language code) is supported by Mollie before trying to create a payment -* Fix - "Couldn't create * payment", when other plugins (like WPML) use another locale format then the Mollie API (ISO 15897) -* Fix - "Couldn't create * payment", temporarily disable sending the address details to Mollie for fraud detection, payments not allowed if one of the fields is missing -* Fix - "Call to undefined function get_current_screen()" that can happen on some screens - -= 3.0.6 - 21/06/2018 = - -IMPORTANT -Starting with version 4.0, this plugin will require PHP 5.6. If you are using an older version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). We expect to launch version 4.0 in June 2018. - -* Fix - Remove a remove_action() call that blocked the plugin from running on PHP versions below PHP 5.6 -* Fix - Added more log messages to onWebhookPaid - -= 3.0.5 - 18/06/2018 = - -IMPORTANT -Starting with version 4.0, this plugin will require PHP 5.6. If you are using an older version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). We expect to launch version 4.0 in June 2018. - -* Add warning that version 4.0 will require PHP 5.6 -* Update 'Required PHP' tag to PHP 5.6 -* Removes fatal error for thank you page without valid order (Issue #212 by NielsdeBlaauw) - -= 3.0.4 - 24/05/2018 = - -* Fix - Limit order status update for cancelled and expired payments if another non-Mollie payment gateway also started payment processing (and is active) for that order, prevents expired and cancelled Mollie payments from cancelling the order -* Fix - Webhook URL's with double slashes, caused by some multilanguage plugins (Polylang etc) -* Fix - Add extra condition to make sure customers with paid payments are redirected to correct URL after payment -* Fix - Incorrect return page after payment for some orders, fix was to get payment without cache at least once on return URL (in case Webhook Url is still processing) - -= 3.0.3 - 14/05/2018 = - -* Note - If you use Polylang or another multilanguage plugin, read this [FAQ item](https://github.com/mollie/WooCommerce/wiki/Common-issues#issues-with-polylang-or-other-multilanguage-plugins)! -* Fix - Polylang: Received all versions of Polylang from Frederic, made sure our integration works with all combinations - -* Fix - Order confirmation/Thank you page ([issue #206](https://github.com/mollie/WooCommerce/issues/206)): - * Show pending payment message for open and pending payments, not just open - * Show payment instructions and pending payment message in WooCommerce notice style, so shop-customers notice it better - * Make sure pending payment message is also shown for creditcard, PayPal and Sofort payments -* Fix - Redirect to checkout payment URL (retry payment) more often, also for failed payments - -= 3.0.2 - 07/05/2018 = - -* New - Add extra log message "Start process_payment for order ..." -* Fix - Fix "Uncaught Error: Call to undefined function wcs_order_contains_renewal()" when users don't have WooCommerce Subscriptions installed -* Fix - Improve condition(s) for disableMollieOnPaymentMethodChange, make sure not to disable payment methods on checkout (because of is_account_page() false positives, bug in WooCommerce) -* Fix - Improve is_available() check for minimum/maximum amounts, better check renewal payment amounts - -= 3.0.1 - 17/04/2018 = - -* [Fix/Revert, see issue 173](https://github.com/mollie/WooCommerce/issues/173) - Improve support for Polylang option "Hide URL language information for default language" in webhook and return URLs - -= 3.0.0 - 17/04/2018 = - -* New - WooCommerce Subscriptions: add support for 'subscription_payment_method_change', shop-customers can change payment method if renewal payment fails (SEPA incasso, credit card) -* New - WooCommerce Subscriptions: disable Mollie payment methods on shop-customer's my account page for "Payment method change", keep it enabled for "Pay now" link in emails -* New - WooCommerce Subscriptions: improve handling and update messages and notices for Subscription switch to better explain what's happening -* New - WooCommerce Subscriptions: set renewal orders and subscriptions to 'On-Hold' if renewal payment fails - -* Fix - Fallback for getUserMollieCustomerId, get Mollie Customer ID from recent subscription if it's empty in WordPress user meta -* Fix - Improve support for Polylang option "Hide URL language information for default language" in webhook and return URLs -* Fix - Only check if customer ID is valid on current API key if there is a customer ID (not empty)(and improve log messages) -* Fix - Make sure payment instructions (Bank Transfer) are styled the same as WooCommerce content (Order received, payment pending) -* Fix - Don't update/process/expire Mollie payments on WooCommerce orders that have been paid with other payment gateways -* Fix - Updated text strings for Bancontact/Mister Cash to just Bancontact -* Fix - Use the exact same translation as WooCommerce for order statuses -* Fix - Resolve error (fatal error get_payment_method()) that occurred when users made certain custom changes to the WooCommerce template files -* Fix - Add order note and log message when customer returns to the site but payment is open/pending -* Fix - Improved order note for charged back renewal payments - -= 2.9.0 - 13/02/2018 = - -* New - Added support for new payment method: [ING Home'Pay](https://www.mollie.com/en/payments/ing-homepay) -* New - Updated Mollie API PHP to 1.9.6 (ING Home'Pay support) - -* Fix - Check that Mollie customerID is known on current API key, solves issues for admins that switched from test to live -* Fix - Charged back payments now update the order status to On Hold and add an order note in WooCommerce, stock is not updated -* Fix - For 'Payment screen language' set default to 'Detect using browser language' as it is usually more accurate -* Fix - For subscriptions also compare recurring total amount to payment method maximums, not only the order/cart total -* Fix - Improve WPML compatibility by removing duplicate trailing slash in WooCommerce API request URL - -= 2.8.2 - 15/01/2018 = - -* Fix - Fixed a PHP error by setting an argument default for onOrderReceivedTitle(), because post ID not set in all WordPress versions - -= 2.8.1 - 15/01/2018 = - -* New - iDEAL, KBC, Gift cards: Option to hide issuers/bank list in WooCommerce -* New - Allow subscription switching (downgrade) when amount to pay is €0 and there is a valid mandate for the user - -* Fix - A new customerID was created for every new order where a payment method that supported recurring payments was selected -* Fix - When plugin 2.8.0 was used with WooCommerce 2.6 or older, a fatal error would be shown on the return page (because of use of new WooCommerce 3.0 method) -* Fix - Some cancelled payments for cancelled orders where redirected to "Retry payment" instead of "Order received" page, see Github issue #166 - -= 2.8.0 - 09/01/2018 = - -* New - Updated required WooCommerce version to 2.2.0 -* New - Tested with WooCommerce 3.3 beta, no issues found -* New - Better message on "Order Received" page for open/pending payments -* New - Allow users to set the order status for orders where a payment was cancelled -* New - Added support for Polylang Pro (polylang-pro) to getSiteUrlWithLanguage() -* New - Updated credit card icon in WooCommerce checkout to show icons for MasterCard, Visa, AMEX, CartaSi, Cartes Bancaires -* New - Better way to check if WooCommerce is activated and has correct version (so plugin doesn't de-activate on WooCommerce updates) -* New - Redact customer IBAN in notification-mails -* New - Update how "Select your bank" is shown in the dropdown for iDEAL and KBC/CBC (and show a default) - -* Fix - Fix error by making sure order is not removed/exists (in checkPendingPaymentOrdersExpiration) -* Fix - Make sure payments cancelled at Mollie are also cancelled in WooCommerce, so customers can select a new payment method -* Fix - KBC/CBC: Make sure KBC/CBC is listed as "Automatic Recurring Payment" gateway in WooCommerce -* Fix - Fix (no title) showing in settings for SEPA Direct Debit for some new installs -* Fix - Fix wrong date formatting shown for bank transfer instructions, thank you profoX! -* Fix - Typo in SEPA Direct Debit description, thank you Yame-! -* Fix - It's possible to set the initial status of bank transfer to pending instead of on-hold, but in that case the payment instructions would not be shown on the Order Received page (missing in condition) -* Fix - Make sure webhook processing for Paid doesn't run on status PaidOut -* Fix - Improve orderNeedsPayment so there are less false-positives if users use 3PD plugins to change the order status too early -* Fix - Add WC_Subscriptions_Manager::activate_subscriptions_for_order to make sure subscriptions are always activated when payment is paid, independent of order status - -= 2.7.0 - 07/09/2017 = - -* New - Support for gift cards! See: https://www.mollie.com/en/blog/post/mollie-launches-gift-cards/ -* New - Also show issuers (banks) for KBC payment method - -* Fix - Add better support for WooCommerce Deposits (by Webtomizer) -* Fix - Subscriptions would be set to 'On Hold' during SEPA Direct Debit payments, those subscriptions are now set to 'Active' -* Fix - Multiple issues that occurred when users had multiple (unpaid) payments per order -* Fix - Remove SEPA Direct Debit (only used for Mollie recurring) as visible gateway in checkout and settings -* Fix - Tested with WordPress 4.9 Alpha and WooCommerce 3.1 -* Fix - Remove existing language files from plugin so they can be managed via https://translate.wordpress.org/projects/wp-plugins/mollie-payments-for-woocommerce -* Fix - Use better customer name when name is sent to Mollie (use full name and last name if available) -* Fix - Don't update orders to cancelled status for expired payments if there are still pending payments for same order -* Fix - Show correct return page to customer when they have placed multiple payments for single order -* Fix - For subscription renewal orders, update payment method (from iDEAL, Belfius etc) to SEPA Direct Debit when needed -* Fix - Add message that SEPA Direct Debit is required when using WooCommerce Subscriptions with iDEAL - -* Dev - Stop checking change of payment methods with isValidPaymentMethod -* Dev - Add support for new WooCommerce version check -* Dev - In setActiveMolliePayment use update_post_meta so payment is always updated to latest -* Dev - In unsetActiveMolliePayment, a payment calling that function should only be able to unset itself -* Dev - Improve log messages (WooCommerce > System status > Logs > mollie-payments-for-woocommerce) -* Dev - Security improvement: sanitize getting ID's via POST and use $_POST instead of $_REQUEST -* Dev - Only show "Check Subscription Status" tool if WooCommerce Subscriptions is installed -* Dev - Fix PHP warnings about unserialize() by using serialize() before storing object as transient -* Dev - Move load_plugin_textdomain to own function and load on plugins_loaded action - -= 2.6.0 - 07/06/2017 = -* Add support for WooCommerce 3.0 (backwards compatible with older versions of WooCommerce) -* The expiry date that's shown for payments via Bank transfer is now in the correct (translated) format -* Fix redundant "DESCRIBE *__mollie_pending_payment" error (on new installs) -* WooCommerce Subscriptions: - * Important: added Subscription Status tool to fix broken subscriptions, see [instructions](https://github.com/mollie/WooCommerce/wiki/Mollie-Subscriptions-Status) - * SEPA recurring payments, take initial order status from settings, default On-Hold (instead of Completed) - * Fix issue where valid subscriptions are set to 'on-hold' and 'manual renewal' only 15 days after renewal payment is created (now only do that after 21 days) - * Improve "Subscription switching" support to also allow amount changes - * Fix typo in recurring payment order notes - -= 2.5.5 - 31/03/2017 = -* Allow the option name to have maximum 191 characters for newer WooPress installations. - -= 2.5.4 - 07/03/2017 = -* Added an option to disable storing the customer details at Mollie - -= 2.5.3 - 01/03/2017 = -* Bugfix for crashing WooPress when using PHP version 5.3 or lower - -= 2.5.2 - 28/02/2017 = -* The plugin is now compatible with WooCommerce Subscriptions for recurring payments -* Removed 'test mode enabled' description, which causes problems when using WPML -* Empty the cart when the order is finished, rather than when the payment is created - -= 2.4.1 - 10/10/2016 = -* Fix 2.4.0 release (https://wordpress.org/support/topic/error-500-after-updating) - -= 2.4.0 - 10/10/2016 = -* Add KBC/CBC Payment Button method. -* Add option to the iDEAL gateway to set the text for the empty option in the issuers drop down. Go to the iDEAL gateway settings to change this value. -* Update Mollie API client to v1.7.1. - -= 2.3.1 - 14/09/2016 = -* Turn on 'mail payment instructions' for Bank Transfer by default -* Fix bug to support Polylang plugin - -= 2.3.0 - 27/07/2016 = -* Update payment method icons. -* Send the refund description to Mollie. The refund description will be visible for your customer on their bank statement. -* Add new filters `mollie-payments-for-woocommerce_order_status_cancelled` and `mollie-payments-for-woocommerce_order_status_expired` to be able -to overwrite the order status for cancelled and expired Mollie payments. You can find all available filters on https://github.com/mollie/WooCommerce/tree/master/development. -* Update Mollie API client to v1.6.5. - -= 2.2.1 - 18/04/2016 = -* Add option for the Bank Transfer gateway to skip redirecting your users to the Mollie payment screen. Instead directly redirect to the WooCommerce order -received page where payment instruction will be displayed. You can turn on this option on the Mollie Bank Transfer setting page: -WooCommerce -> Settings -> Payments -> Mollie - Bank Transfer. - -= 2.2.0 - 29/03/2016 = -* Add integration with Mollie Customers API. -* Use shorter transient prefix. -* Update Mollie API client to v1.4.1. - -= 2.1.1 - 27/01/2016 = -* Add better support for translation plugins Polylang and mLanguage. -* Fixed small issue for PHP 5.2 users. - -= 2.1.0 - 01/12/2015 = -* For payment methods where the payment status will be delivered after a couple of days you can set the initial order status. Choose between `on-hold` or `pending`. -* Get the correct current locale (with support for [WPML](https://wpml.org)). -* Cache payment methods and issuers by locale. -* Cancel order when payment is expired. -* Reduce order when initial order status is `on-hold`. Restore order stock when payment fails. -* Hide payment gateway when cart exceeds method min / max amount. Method min / max amount is returned by Mollie API. -* Add filter to change the return URL. - -= 2.0.1 - 02/10/2015 = -* Add support for SEPA Direct Debit. -* Add message for Belfius, Bancontact and paysafecard when the payment is paid successfully. - -= 2.0.0 - 17/08/2015 = -* Complete rewrite of our WooCommerce plugin to better follow WordPress and WooCommerce standards and add better support for other plugins. - -== Upgrade Notice == - -= 2.5.2 = -Our plugin is now compatible with WooCommerce Subscriptions for recurring payments. - -= 2.0.0 = -* The 2.x version of the plugin uses a different plugin name. You can still run version 1.x of our plugin if you want to temporary -keep support for payments created using version 1.x. Hide the old payment gateways by disabling the old 'Mollie Payment Module' payment gateway in WooCommerce -> Settings -> Payments. diff --git a/composer.json b/composer.json index b1558fb3..0c859593 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ "email": "info@mollie.com" }, { - "name": "Inpsyde Gmbh", - "email": "hello@inpsyde.com" + "name": "Syde Gmbh", + "email": "hello@syde.com", } ], "require": { diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index aa98a6cd..00000000 --- a/deploy.sh +++ /dev/null @@ -1,150 +0,0 @@ -#! /bin/bash -# Original by https://github.com/GaryJones/wordpress-plugin-git-flow-svn-deploy -set -e - -echo -echo "Deploy mollie-payments-for-woocommerce WordPress Plugin" -echo - -# Set up some default values. Feel free to change these in your own script -CURRENTDIR=`pwd` -PLUGINSLUG="mollie-payments-for-woocommerce" -PLUGINDIR="$CURRENTDIR/$PLUGINSLUG" -SVNPATH="/tmp/$PLUGINSLUG" -SVNURL="http://plugins.svn.wordpress.org/$PLUGINSLUG" -MAINFILE="$PLUGINSLUG.php" - -default_svnuser="mollie" - -# Get some user input -# Can't use the -i flag for read, since that doesn't work for bash 3 - -printf "Your WordPress repo SVN username ($default_svnuser): " -read -e input -SVNUSER="${input:-$default_svnuser}" # Populate with default if empty -echo - -echo "That's all of the data collected." -echo -echo "Slug: $PLUGINSLUG" -echo "Temp checkout path: $SVNPATH" -echo "Remote SVN repo: $SVNURL" -echo "SVN username: $SVNUSER" -echo "Plugin directory: $PLUGINDIR" -echo "Main file: $MAINFILE" -echo - -printf "OK to proceed (Y|n)? " -read -e input -PROCEED="${input:-y}" -echo - -# Allow user cancellation -if [ "$PROCEED" != "y" -a "$PROCEED" != "Y" ]; then echo "Aborting..."; exit 1; fi - -# git config -GITPATH="$PLUGINDIR/" # this file should be in the base of your git repository - -# Let's begin... -echo ".........................................." -echo -echo "Preparing to deploy WordPress plugin" -echo -echo ".........................................." -echo - -# Check version in readme.txt is the same as plugin file after translating both to unix line breaks to work around grep's failure to identify mac line breaks -PLUGINVERSION=`grep "Version:" $PLUGINDIR/$MAINFILE | awk -F' ' '{print $NF}' | tr -d '\r'` -echo "$MAINFILE version: $PLUGINVERSION" -READMEVERSION=`grep "^Stable tag:" $PLUGINDIR/readme.txt | awk -F' ' '{print $NF}' | tr -d '\r'` -echo "readme.txt version: $READMEVERSION" - -if [ "$READMEVERSION" = "trunk" ]; then - echo "Version in readme.txt & $MAINFILE don't match, but Stable tag is trunk. Let's proceed..." -elif [ "$PLUGINVERSION" != "$READMEVERSION" ]; then - echo "Version in readme.txt & $MAINFILE don't match. Exiting...." - exit 1; -elif [ "$PLUGINVERSION" = "$READMEVERSION" ]; then - echo "Versions match in readme.txt and $MAINFILE. Let's proceed..." -fi - -if git show-ref --tags --quiet --verify -- "refs/tags/$PLUGINVERSION" - then - echo "Version $PLUGINVERSION already exists as git tag. Exiting...."; - exit 1; - else - echo "Git version does not exist. Let's proceed..." -fi - -default_commitmsg="Release $PLUGINVERSION, see readme.txt for changelog." - -printf "Enter a commit message for this new version ($default_commitmsg): " -read -e input -COMMITMSG="${input:-$default_commitmsg}" # Populate with default if empty -git commit -am "$COMMITMSG" - -echo "Tagging new version in git" -git tag -a "$PLUGINVERSION" -m "Tagging version $PLUGINVERSION" - -echo "Pushing git master to origin, with tags" -git push origin master -git push origin master --tags - -echo -echo "Clear $SVNPATH" -rm -fr $SVNPATH/ - -echo -echo "Creating local copy of SVN repo trunk ..." -svn checkout $SVNURL $SVNPATH --depth immediates -svn update --quiet $SVNPATH/trunk --set-depth infinity - -echo "Ignoring GitHub specific files" -svn propset svn:ignore "README.md -Thumbs.db -.git -.gitignore" "$SVNPATH/trunk/" - -echo "Copying plugin files to the trunk of SVN" -rsync $PLUGINSLUG/* -ri --del -m --exclude ".*" $SVNPATH/trunk/ | grep sT - -# Support for the /assets folder on the .org repo. -echo "Moving assets" -# Make the directory if it doesn't already exist -mkdir -p $SVNPATH/public/ -rsync $CURRENTDIR/public/* -ri --del -m --exclude ".*" $SVNPATH/public/ | grep sT -svn add --force $SVNPATH/public/ - -echo "Changing directory to SVN and committing to trunk" -cd $SVNPATH/trunk/ -# Delete all files that should not now be added. -svn status | grep -v "^.[ \t]*\..*" | grep "^\!" | awk '{print $2"@"}' | xargs svn del -# Add all new files that are not set to be ignored -svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2"@"}' | xargs svn add -svn commit --username=$SVNUSER -m "Preparing for $PLUGINVERSION release" - -echo "Updating WordPress plugin repo assets and committing" -cd $SVNPATH/public/ -# Delete all new files that are not set to be ignored -svn status | grep -v "^.[ \t]*\..*" | grep "^\!" | awk '{print $2"@"}' | xargs svn del -# Add all new files that are not set to be ignored -svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2"@"}' | xargs svn add -svn update --accept mine-full $SVNPATH/public/* -svn commit --username=$SVNUSER -m "Updating assets for $PLUGINVERSION release" - -echo "Creating new SVN tag and committing it" -cd $SVNPATH -svn update --quiet $SVNPATH/tags/$PLUGINVERSION -svn copy --quiet trunk/ tags/$PLUGINVERSION/ -# Remove assets and trunk directories from tag directory -# svn delete --force --quiet $SVNPATH/tags/$PLUGINVERSION/assets -# svn delete --force --quiet $SVNPATH/tags/$PLUGINVERSION/trunk -cd $SVNPATH/tags/$PLUGINVERSION -svn commit --username=$SVNUSER -m "Tagging version $PLUGINVERSION" - -echo "Removing temporary directory $SVNPATH" -cd $SVNPATH -cd .. -rm -fr $SVNPATH/ - -echo "*** FINISHED ***" diff --git a/package.json b/package.json index 0e9376c6..d5429a33 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,9 @@ ], "authors": [ { - "name": "Inpsyde GmbH", - "homepage": "https://inpsyde.com/", - "email": "hallo@inpsyde.com", + "name": "Syde GmbH", + "homepage": "https://syde.com/", + "email": "hello@syde.com", "role": "Company" }, { diff --git a/playwright.config.js b/playwright.config.js deleted file mode 100644 index 09cf9b09..00000000 --- a/playwright.config.js +++ /dev/null @@ -1,77 +0,0 @@ -// @ts-check -const {defineConfig, devices} = require('@playwright/test'); - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -require('dotenv').config(); -const testRailOptions = { - // Whether to add with all annotations; default is false - embedAnnotationsAsProperties: true, - // Where to put the report. - outputFile: './test-results/junit-report.xml' -}; -/** - * @see https://playwright.dev/docs/test-configuration - */ -module.exports = defineConfig({ - testDir: './tests/e2e', - /* Run tests in files in parallel */ - fullyParallel: false, - timeout: 320000, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: [ - ['list'], - ['junit', testRailOptions] - ], - globalSetup: './tests/e2e/globalSetup.js', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - baseURL: process.env.BASEURL, - storageState: './storageState.json', - extraHTTPHeaders: {'ngrok-skip-browser-warning': '123'}, - actionTimeout: 120000, - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'plugins-page', - testDir: './tests/e2e/Plugins page', - use: { - ...devices['Desktop Chrome'], - testIdAttribute: 'data-slug' - } - }, - { - name: 'woo-payments-tab', - testDir: './tests/e2e/WooCommerce Payments tab', - use: { - ...devices['Desktop Chrome'] - } - }, - { - name: 'transaction-scenarios', - testDir: './tests/e2e/Transaction Scenarios', - use: { - ...devices['Desktop Chrome'] - } - }, - { - name: 'mollie-settings-tab', - testDir: './tests/e2e/Mollie Settings tab', - use: { - ...devices['Desktop Chrome'] - } - }, - { - name: 'error-handling', - testDir: './tests/e2e/Error Handling', - use: { - ...devices['Desktop Chrome'] - } - }, - ], -}); - diff --git a/readme.txt b/readme.txt new file mode 100644 index 00000000..8ea0bcf7 --- /dev/null +++ b/readme.txt @@ -0,0 +1,1069 @@ +=== Mollie Payments for WooCommerce === +Contributors: daanvm, danielhuesken, davdebcom, dinamiko, inpsyde, l.vangunst, ndijkstra, robin-mollie, wido, carmen222, inpsyde-maticluznar +Tags: mollie, payments, payment gateway, woocommerce, credit card, apple pay, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions +Requires at least: 3.8 +Tested up to: 6.5 +Stable tag: 7.5.2 +Requires PHP: 7.2 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +Accept all major payment methods in WooCommerce today. Credit cards, iDEAL and more! Fast, safe and intuitive. + +== Description == + +https://www.youtube.com/watch?v=yslqbm2FPFg + +Quickly integrate all major payment methods in WooCommerce, wherever you need them. Simply drop them ready-made into your WooCommerce webshop with this powerful plugin by Mollie. Mollie is dedicated to making payments better for WooCommerce. + +> Next level payments, for WooCommerce + +No need to spend weeks on paperwork or security compliance procedures. No more lost conversions because you don’t support a shopper’s favorite payment method or because they don’t feel safe. We made payments intuitive and safe for merchants and their customers. + += PAYMENT METHODS = + +Credit cards: + +* VISA (International) +* MasterCard (International) +* American Express (International) +* Cartes Bancaires (France) +* CartaSi (Italy) + +Debit cards: + +* V Pay (International) +* Maestro (International) + +European and local payment methods: + +* iDEAL (Netherlands) +* Bancontact (Belgium) +* ING Home'Pay (Belgium) +* Giropay (Germany) +* EPS (Austria) +* Przelewy24 (Poland) +* SOFORT banking (EU) +* Belfius (Belgium) +* KBC/CBC payment button (Belgium) +* SEPA - Credit Transfer (EU) +* SEPA - Direct Debit (EU) +* Gift cards (Netherlands) +* Eco-, gift- and meal vouchers (Belgium) + +International payment methods: + +* PayPal (International) +* Paysafecard (International) + +Pay after delivery payment methods: + +* Klarna Pay later (Netherlands, Germany, Austria, Finland) +* Klarna Slice it (Germany, Austria, Finland) + +Please go to the [signup page](https://www.mollie.com/signup) to create a new Mollie account and start receiving payments in a couple of minutes. Contact info@mollie.com if you have any questions or comments about this plugin. + +> Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period. + += FEATURES = + +* Support for all available Mollie payment methods +* Compatible with WooCommerce Subscriptions for recurring payments (Apple Pay, credit card, iDEAL, and more via SEPA Direct Debit) +* Transparent pricing. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period. +* Edit the order, title and description of every payment method in WooCommerce checkout +* Support for full and partial payment refunds (WooCommerce 2.2+) +* Configurable pay outs: daily, weekly, monthly - whatever you prefer +* [Powerful dashboard](https://www.mollie.com/en/features/dashboard) on mollie.com to easily keep track of your payments. +* Fast in-house support. You will always be helped by someone who knows our products intimately. +* Multiple translations: English, Dutch, German and French +* Event log for debugging purposes +* WordPress Multisite support +* WPML support + +== Frequently Asked Questions == + += I can't install the plugin, the plugin is displayed incorrectly = + +Please temporarily enable the [WordPress Debug Mode](https://codex.wordpress.org/Debugging_in_WordPress). Edit your `wp-config.php` and set the constants `WP_DEBUG` and `WP_DEBUG_LOG` to `true` and try +it again. When the plugin triggers an error, WordPress will log the error to the log file `/wp-content/debug.log`. Please check this file for errors. When done, don't forget to turn off +the WordPress debug mode by setting the two constants `WP_DEBUG` and `WP_DEBUG_LOG` back to `false`. + += I get a white screen when opening ... = + +Most of the time a white screen means a PHP error. Because PHP won't show error messages on default for security reasons, the page is white. Please turn on the WordPress Debug Mode to turn on PHP error messages (see previous answer). + += The Mollie payment gateways aren't displayed in my checkout = + +* Please go to WooCommerce -> Settings -> Payments in your WordPress admin and scroll down to the Mollie settings section. +* Check which payment gateways are disabled. +* Go to the specific payment gateway settings page to find out why the payment gateway is disabled. + += The order status is not getting updated after successfully completing the payment = + +* Please check the Mollie log file located in `/wp-content/uploads/wc-logs/` or `/wp-content/plugin/woocommerce/logs` for debug info. Please search for the correct order number and check if Mollie has called the shop Webhook to report the payment status. +* Do you have maintenance mode enabled? Please make sure to whitelist the 'wc-api' endpoint otherwise Mollie can't report the payment status to your website. +* Please check your Mollie dashboard to check if there are failed webhook reports. Mollie tried to report the payment status to your website but something went wrong. +* Contact info@mollie.com with your Mollie partner ID and the order number. We can investigate the specific payment and check whether Mollie successfully reported the payment state to your webshop. + += Payment gateways and mails aren't always translated = + +This plugin uses [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/mollie-payments-for-woocommerce) for translations. WordPress will automatically add those translations to your website if they hit 100% completion at least once. If you are not seeing the Mollie plugin as translated on your website, the plugin is probably not translated (completely) into your language (you can view the status on the above URL). + +You can either download and use the incomplete translations or help us get the translation to 100% by translating it. + +To download translations manually: +1. Go to [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/mollie-payments-for-woocommerce/) +2. Click on the percentage in the "Stable" column for your language. +3. Scroll down to "Export".  +4. Choose "All current" and "MO - Machine Object"  +5. Upload this file to plugins/languages/mollie-payments-for-woocommerce/. +6. Repeat this for all your translations. + +If you want to help translate the plugin, read the instructions in the [Translate strings instructions](https://make.wordpress.org/polyglots/handbook/tools/glotpress-translate-wordpress-org/#translating-strings). + += Can I add payment fees to payment methods? = + +Yes, you can with a separate plugin. At the moment we have tested and can recommend [Payment Gateway Based Fees and Discounts for WooCommerce](https://wordpress.org/plugins/checkout-fees-for-woocommerce/). Other plugins might also work. For more specific information, also see [helpful snippets](https://github.com/mollie/WooCommerce/wiki/Helpful-snippets#add-payment-fee-to-payment-methods). + += Can I set up payment methods to show based on customers country? = + +Yes, you can with a separate plugin. At the moment we have tested and can recommend [WooCommerce - Country Based Payments](https://wordpress.org/plugins/woocommerce-country-based-payments/). Other plugins might also work. + += Why do orders with payment method BankTransfer and Direct Debit get the status 'on-hold'? = + +These payment methods take longer than a few hours to complete. The order status is set to 'on-hold' to prevent the WooCommerce setting 'Hold stock (minutes)' (https://docs.woothemes.com/document/configuring-woocommerce-settings/#inventory-options) will +cancel the order. The order stock is also reduced to reserve stock for these orders. The stock is restored if the payment fails or is cancelled. You can change the initial order status for these payment methods on their setting page. + += I have a different question about this plugin = + +Please contact info@mollie.com with your Mollie partner ID, please describe your problem as detailed as possible. Include screenshots where appropriate. +Where possible, also include the Mollie log file. You can find the Mollie log files in `/wp-content/uploads/wc-logs/` or `/wp-content/plugin/woocommerce/logs`. + +== Screenshots == + +1. The global Mollie settings are used by all the payment gateways. Please insert your Mollie API key to start. +2. Change the title and description for every payment gateway. Some gateways have special options. +3. The available payment gateways in the checkout. +4. The order received page will display the payment status and customer details if available. +5. The order received page for the gateway bank transfer will display payment instructions. +6. Some payment methods support refunds. The 'Refund' button will be available when the payment method supports refunds. +7. Within Mollie Dashboard, intuitive design meets clever engineering, allowing you to get more work done, in less time. +8. Also in Mollie Dashboard, get your administration done quick. You’ll have a detailed overview of your current balance. +9. Statistics with a double graph gives gives you extensive insights and data on how your business is performing. +10. Mollie Checkout turns a standard payment form into a professional experience that drives conversions. + +== Installation == + += Minimum Requirements = + +* PHP version 7.2 or greater +* PHP extensions enabled: cURL, JSON +* WordPress 3.8 or greater +* WooCommerce 3.9 or greater +* Mollie account + += Automatic installation = + +1. Install the plugin via Plugins -> New plugin. Search for 'Mollie Payments for WooCommerce'. +2. Activate the 'Mollie Payments for WooCommerce' plugin through the 'Plugins' menu in WordPress +3. Set your Mollie API key at WooCommerce -> Settings -> Mollie Settings (or use the *Mollie Settings* link in the Plugins overview) +4. You're done, the active payment methods should be visible in the checkout of your webshop. + += Manual installation = + +1. Unpack the download package +2. Upload the directory 'mollie-payments-for-woocommerce' to the `/wp-content/plugins/` directory +3. Activate the 'Mollie Payments for WooCommerce' plugin through the 'Plugins' menu in WordPress +4. Set your Mollie API key at WooCommerce -> Settings -> Mollie Settings (or use the *Mollie Settings* link in the Plugins overview) +5. You're done, the active payment methods should be visible in the checkout of your webshop. + +Please contact info@mollie.com if you need help installing the Mollie WooCommerce plugin. Please provide your Mollie partner ID and website URL. + += Updating = + +Automatic updates should work like a charm; as always though, ensure you backup your site just in case. + +== Changelog == + += 7.5.2 - 22-04-2024 = + +* Feature - Support for new payment method Bancomat Pay (beta) +* Tweak - Reorder gateway settings +* Fix - Gift Card issuer dropdown replaced by icon HTML when only one giftcard enabled +* Fix - TypeError merchant capture feature +* Fix - Type error on Pay for Order page when in3 is active on PHP 8+ +* Fix - Typo in variable/method names +* Fix - Refresh methods not enabling methods enabled in Mollie +* Fix - Variable names in strings deprecated in PHP 8.2 (author @vHeemstra) +* Fix - WC 7.4.1 appends billingEmail to Orders API call due to mismatched filter in Banktransfer.php +* Fix - Apple Pay button payment is not possible as a guest user when debugging is active + += 7.5.1 - 12-02-2024 = + +* Fix - Merchant capture error. Feature flag disabled by default + += 7.5.0 - 05-02-2024 = + +* Feature - Add TWINT payment method +* Feature - Add BLIK payment method +* Feature - Enable merchant capture feature flag by default +* Feature - Enable Klarna one feature flag by default +* Fix - Birth date not showing for in3 on pay for order page +* Fix - Subscription signup payment not possible when using authorizations +* Fix - Transaction ID field not filled for authorized/captured WooCommerce orders +* Fix - PHP Fatal error: Undefined method isCompleted +* Fix - Align merchant capture wording with Mollie + += 7.4.1 - 06-11-2023 = + +* Fix - Send the bank transfer information in the order confirmation email +* Fix - Plugin keeps retrying fraudulent orders +* Fix - Order is not canceled after exact expiry date set in gateway settings +* Fix - No error messages displayed on pay for order page +* Fix - Improve “Initial payment status” setting description for expired orders +* Fix - Update GitHub wiki after Mollie docs release +* Fix - Update plugin strings regarding documentation and support links +* Fix - Save & display bank transfer payment details in WooCommerce order +* Fix - Complete WooCommerce order when order is shipped at Mollie +* Fix - Check for WC\_Subscriptions class instead of plugin file + += 7.4.0 - 20-09-2023 = + +* Feature - Pass Paypal "Additional" address information as Address_2 +* Feature - The payment method API image will now display when the "Use API dynamic title and gateway logo" option is enabled. +* Feature - Introduced a new filter to programmatically control the visibility of the API title for each payment method: apply_filters('mollie_wc_gateway_use_api_title', $value, $paymentMethodId) +* Feature - Added a filter to programmatically control the visibility of the API icon for every payment method: apply_filters('mollie_wc_gateway_use_api_icon', $value, $paymentMethodId) +* Fix - Mollie is showing for WooCommerce version under 3.9.0 +* Fix - Compatibility with latest WC Blocks \(>9.3.0\) to detect "incompatible gateways" +* Fix - Apple Pay button payments remain in open status at Mollie +* Fix - New block theme 22 and 23 have issues with the look and feel on Mollie components +* Fix - Site is broken on bulk edit when Mollie is activated +* Fix - Fatal error after on 7.3.8 and 7.3.9 with roots/sage +* Fix - WooCommerce - Bank Transfer - Expiration time feature bug +* Fix - Apple Pay gateway not displayed on order pay page + += 7.3.12 - 21-08-2023 = + +* Fix - Security fix + += 7.3.11 - 10-08-2023 = + +* Feature flag - adding support to new upcoming payment method +* Fix - script loading when disabled in Mollie dashboard + += 7.3.10 - 24-07-2023 = + +* Fix - Updating payment method after fail in a subscription will not update the mandate +* Fix - Surcharge fee not updating on pay for order page and block checkout +* Fix - Use gateway title from API when the one saved is the previous version default one +* Fix - Missing information for In3 and Billie transactions in blocks and classic checkout +* Fix - Mollie components not initialising on block checkout after changing payment method +* Fix - Paysafecard not shown in block checkout +* Fix - Transaction with components leading to insert card details again +* Fix - Billie gateway hidden when third-party plugins are active +* Fix - Surcharge fee taxes not updated in tax total +* Fix - Biling/shipping country not included in orders from block checkout + += 7.3.9 - 31-05-2023 = + +* Fix - Psr/container compatibility issue + += 7.3.8 - 31-05-2023 = + +* Fix - Inform customer and merchant about Mollie outage +* Fix - Bank Transfer gateway hidden when "Activate expiry time setting" is enabled +* Fix - Surcharge description string not updated when the language changes after saving +* Fix - Show more information on recurring failed payments +* Fix - Send birthdate and phone number with In3 payments shortcode checkout +* Fix - Update credit card title. Allow users to take title from API + += 7.3.7 - 12-04-2023 = + +* HotFix - Warning after update 7.3.6 instanceof PaymentMethodI failed + += 7.3.6 - 12-04-2023 = + +* Feature - Implemented new payment method +* Feature - Render hook filter for Apple Pay and PayPal buttons +* Fix - PayPal payment overwrites billing information with PayPal account details +* Fix - Error when creating product category +* Fix - Some type check errors +* Fix - WC 7.2.2 update causes Fatal error: Cannot redeclare as_unschedule_action() +* Fix - Gift card warning when on Checkout page +* Fix - Block scripts loaded on any page when block features are enabled +* Fix - ApplePay Button validation issues +* Fix - PayPal button showing on out of stock product + += 7.3.5 - 24-01-2023 = + +* Fix - PayPal payment overwrites billing information with PayPal account details +* Fix - Compatibility with WordPress 6.1.0 +* Fix - Compatibility with WC High-Performance Order Storage +* Fix - Compatibility issues with PHP 8.1 deprecated FILTER_SANITIZE_STRING +* Fix - Issue when WooCommerce Blocks plugin was not present to load Block features +* Fix - Surcharge description in new paragraph +* Fix - Custom order meta data filter not working as expected +* Fix - Custom fields in payment translations +* Fix - Voucher showing on order-pay page when no category is set up +* Fix - Product stock restored twice on cancelled orders when Germanized plugin is active +* Fix - Surcharge settings in SEPA should not appear +* Fix - Call to undefined method WC_Gateway_Paypal::handlePaidOrderWebhook() +* Fix - Message "Test mode is active" is showing when test mode is disabled before refreshing the page +* Fix - PayPal button displayed on cart page when product amount is lower then the minimum amount required to display the button +* Fix - Crash when new method Billie is enabled at Mollie + += 7.3.4 - 09-11-2022 = + +* Fix - Site crash with WooCommerce 3.0 active +* Fix - Fatal error when payment surcharge limit exceeded +* Fix - Critical error when API connection not available +* Fix - Redundant log entry +* Fix - Conflict with "Extra Checkout Options" plugin +* Fix - PHP Warning for undefined array key +* Fix - Consider order status before setting it to "Canceled" status upon Mollie expiry webhook +* Fix - Broken translation strings +* Fix - Undefined index in voucher category +* Fix - Description printed in wrong field in settings + += 7.3.3 - 21-09-2022 = + +* Fix - Subscription renewal charged twice +* Fix - Credit card components not loading on update + += 7.3.2 - 14-09-2022 = + +* Fix - Warning stops transaction when debugging on production + += 7.3.1 - 13-09-2022 = + +* Fix - When refunding from Mollie profile order notes and status not updated +* Fix - Error on checkout block, surcharge added for all payment methods +* Fix - PayPal button display issues +* Fix - Logs created when logging is disabled +* Fix - Bank Transfer disappears on order pay page +* Fix - Surcharge value not including VAT +* Fix - UTM parameters missing in mollie.com links +* Fix - Voucher category does not reflect on variations +* Fix - Issuers dropdown not loading +* Fix - Querying gateway settings on every page load +* Fix - Inconsistency in expiry date terms +* Fix - Filter should allow SDD enabled without WooCommerce Subscriptions active +* Fix - Change link to API key profile in mollie.com +* Fix - Translations errors +* Fix - Conflict with SSH SFTP Updater Support +* Fix - Error when customer attempts payment with non-Mollie method after expiration + += 7.3.0 - 02-08-2022 = + +* Feature - Activate Mollie Components by default for new installations +* Fix - Order note not translated +* Fix - Gateway surcharge not applying tax +* Fix - pending SEPA subscription renewal orders remain in "Pending payment" instead of being set to "On-Hold" +* Fix - PHP warnings when using not Mollie gateway +* Fix - Order API not processing transactions due to taxes mismatch +* Fix - Inconsistent order numbers sometimes printing "Bestelling {bestelnummer}" +* Fix - Link to new my.mollie.com url +* Fix - Update In3 description + += 7.2.0 - 21-06-2022 = + +* Feature - New payment method: In3 +* Feature - Add order line information to debug logs +* Feature - Valuta symbol before amount +* Feature - Add new translations +* Fix - Check Payment API setting before showing Voucher, Klarna, In3 (Order API mandatory) +* Fix - Remove title if empty setting on block checkout +* Fix - Typo in Mollie settings +* Fix - SEPA notice shows incorrectly when no settings saved +* Fix - Order API not selected when no settings saved + += 7.1.0 - 26-04-2022 = + +* Feature - Implement uninstall method +* Feature - Add setting to remove Mollie's options and scheduled actions from db +* Feature - Improve Payment API description (@vHeemstra) +* Feature - Improve API request +* Feature - Add gateway title for en_GB translation +* Fix - Showing gateway default description when empty description was saved in settings +* Fix - Surcharge added over limit wrongly when WooCommerce Blocks are active +* Fix - Fatal error when visiting invalid return URL +* Fix - Error on refunding subscriptions created with Payments API +* Fix - Fallback to shop country when customer country is not known +* Fix - Invalid argument supplied to foreach error +* Fix - Display SEPA bank transfer details in merchant email notifications +* Fix - Error on update page with translations +* Fix - Empty space under credit card in checkout when components are not enabled +* Fix - Error on notes and logs with canceled, expired and failed orders +* Fix - Incorrect surcharge fee applied when WooCommerce blocks are active +* Fix - Fatal error when saving empty surcharge fields + += 7.0.4 - 23-03-2022 = + +* Fix - Conflict with Paytium plugin +* Fix - Fallback from orders API to payments API not working +* Fix - Container access for third-party developers + += 7.0.3 - 15-03-2022 = + +* Fix - Update Mollie SDK and add http client +* Fix - Loop API calls causing overload +* Fix - API key error during status change +* Fix - Transaction failing due to tax line mismatch +* Fix - Conflict with invoices plugin +* Fix - List in settings the gateways enabled at Mollie's profile +* Fix - Voucher loads incorrectly on blocks when updating country +* Fix - Update iDeal logo +* Fix - Missing ISK currency with 0 decimal places + += 7.0.2 - 15-02-2022 = + +* Fix - Rollback code to version 6.7.0 + += 7.0.1 - 14-02-2022 = + +* Fix - Fatal error when WC Blocks and third-party payment gateway active after 7.0.0 update +* Fix - Error undefined property actionscheduler_actions +* Fix - Missing payment method title when paying via checkout block +* Fix - Refund functionality missing in v.7.0.0 + += 7.0.0 - 09-02-2022 = + +* Feature - WooCommerce Blocks integration +* Feature - Merchant change subscription payment method +* Feature - Recharge Subscriptions integration +* Feature - Improve handling components errors +* Fix - Add missing translations +* Fix - Fallback to shop country when billing country is empty +* Fix - Surcharge fatal error when settings not yet saved +* Fix - Correct notice when not capturing due is a payment +* Fix - Punycode only on domain url +* Fix - Update Apple Pay certificate key + += 6.7.0 - 11-11-2021 = + +* Feature - New payment method - Klarna Pay Now +* Feature - Apple Pay Subscriptions integration +* Fix - Update Mollie Component Labels +* Fix - Incorrect logo for SOFORT payment method +* Fix - Tax calculation inaccurate for bundled products with mixed tax products +* Fix - Catch error in Object class +* Fix - Change NL translation for Klarna Slice It gateway +* Fix - Show missing selector icons for credit card + += 6.6.0 - 14-09-2021 = + +* Feature - Surcharge fee UI/UX improvements +* Fix - Select the correct payment when two subscription have the same payment method +* Fix - Remove obsolete MisterCash payment method +* Fix - Apple Pay button not updated on variable products +* Fix - PayPal button unresponsive on cart page +* Fix - Added missing translations +* Fix - Scheduled actions triggered with disabled feature +* Fix - Removed obsolete “restore subscriptions” tool +* Fix - Typo on PayPal settings + += 6.5.2 - 13-07-2021 = + +* Fix - Unneeded metadata causing error + += 6.5.1 - 12-07-2021 = + +* Fix - Subscription renewal failing +* Fix - Action scheduler amount of entries + += 6.5.0 - 05-07-2021 = + +* Feature - Add expiry date for orders +* Feature - Hide API keys in settings +* Feature - Improve Klarna notice about enabling default fields +* Feature - New Wiki entry: Gateways hide when surcharge fee is applied +* Feature - PayPal button improvements +* Feature - Primary key on pending_payment table +* Feature - PHP and WordPress upgrade +* Feature - Default translations for Klarna payment methods. (by @Timollie) +* Fix - Select the first payment when two subscriptions have the same payment method +* Fix - Credit card icon missing mollie-gateway-icon class +* Fix - Payments transaction ID link leads to orders dashboard in Mollie +* Fix - Manual cancelation of order returns to pending payment +* Fix - Broken compatibility with WooFunnels plugin +* Fix - Enqueue of style script on non-checkout pages +* Fix - IngHomePay class showing in the composer class-map + += 6.4.0 - 19-05-2021 = + +* Feature - PayPal Button for digital goods +* Fix - Repair subscription method triggering on parent order +* Fix - Surcharge breaking PDF invoices +* Fix - Mollie Components fail when coupon code is applied on checkout +* Fix - Test mode notice links to old settings page +* Fix - nl_NL(formal) wrong translation string + += 6.3.0 - 29-04-2021 = + +* Feature - Allow choosing between Payment/Order API +* Feature - Payment surcharge feature +* Feature - Custom icons for every gateway +* Feature - Notice about increasing minimum PHP and WP version +* Fix - Fix missing metadata in subscriptions +* Fix - Polylang interaction breaks redirect URL +* Fix - Partial refund with quantity 0 errors + += 6.2.2 - 15-04-2021 = + +* Fix - Missing metadata on subscriptions results in failing recurring payments + += 6.2.1 - 01-04-2021 = + +* Fix - Transaction ID missing + += 6.2.0 - 22-03-2021 = + +* Feature - No longer support for WooCommerce version below 3.0 +* Feature - New library to check the environment constraints +* Feature - New translations +* Feature - Add support for WooCommerce Gift Cards +* Feature - Apple Pay added new selector settings +* Feature - Add new language NL formal +* Feature - Add rewrite rule to serve Apple Pay validation file +* Fix - Remove Ing HomePay gateway +* Fix - Use pre-scoped Mollie SDK to fix conflict with Guzzle +* Fix - Setting links pointing to new address +* Fix - PHP notice on missing Apple Pay token +* Fix - Do not translate description of payment (by @timollie) +* Fix - After partial refund state changes, should remain the same instead +* Fix - PHP8 error notice on activation +* Fix - Gateway icons not aligned with Flatsome theme +* Fix - Issuers dropdown not showing by default +* Fix - Using the wrong mandate when multiple payment methods exist for the customer + += 6.1.0 - 26-01-2021 = + +* Feature - New documentation on settings +* Feature - Bulk-edit functionality for Voucher categories +* Fix - Order updated issue with Polylang +* Fix - Hide Issuers dropdown list on setting option +* Fix - Send domain only even when installation is in subfolder for Apple Pay validation + += 6.0 - 16-12-2020 = + +* Feature - New setting to display payment methods based on country +* Feature - Notice customers that support for WooCommerce under v3 is dropped +* Feature - Create mandate for recurring subscriptions +* Feature - New settings UI +* Fix - Guzzle library conflicts with other plugins +* Fix - API keys error with Mollie Components +* Fix - Voucher works with variation products +* Fix - Notice on missing voucher option (by @Timollie) +* Fix - Performance issues related to icons + += 5.11.0 - 11-11-2020 = + +* Fix - Google analytics duplicated tracking events +* Fix - Prevent third party plugins from changing billingCountry field +* Fix - Mollie Components string "secure payments..." not translated +* Fix - Credit card icons not displaying correctly + += 5.10.0 - 03-11-2020 = + +* Feature - New Voucher gateway +* Feature - Custom expiry date for Bank transfer payments +* Feature - Notice informing that test mode is enabled +* Fix - Error when refunding unshipped Klarna order +* Fix - Selecting item variations when ApplePay is enabled +* Fix - Remove autoload function from global namespace +* Fix - Transactions are included in shipping process +* Fix - Undefined index for ApplePay token +* Fix - Remove file_get_content() + += 5.9.0 - 16-09-2020 = + +* Feature - Cancel order on payment expiration + += 5.8.3 - 09-09-2020 = + +* Fix - Apple Pay button is disabled if Apple Pay gateways is disabled +* Fix - Breaks Urls of translations plugins +* Fix - Translations update endless loop + += 5.8.2 - 19-08-2020 = + +* Fix - Use own plugin translation files +* Fix - Show information in order notes for gift card payments +* Fix - Components does not work with Deutsch Sie language +* Fix - Respect maximal field length for address fields +* Fix - Log info when credit card fails +* Fix - Errors: [] operator not supported for strings +* Fix - Load icons when interacting with add blockers +* Fix - Error with wc_string_to_bool() function + += 5.8.1 - 08-07-2020 = + +* Feature - Add Apple Pay direct button feature in product and cart pages + += 5.7.2 - 01-07-2020 = + +* Fix - Missing MasterCard icon selector + += 5.7.1 - 01-07-2020 = + +* Feature - Show selected credit card icons on checkout +* Feature - Log information about API call data +* Fix - Translate the string "Secure payments provided by" +* Fix - Refund amount >1000€ (by @NielsdeBlaauw) + += 5.6.1 - 27-05-2020 = + +* Feature - Translations of Plugin FR/DE/NL/EN/ES +* Fix - Update order status on payment refund +* Fix - 404 response during redirection on checkout when Polylang plugin is active +* Fix - Crash on calling a WC 3.0 method, fallback method for BC +* Fix - Remove custom due date for bank transfer payment +* Fix - Performance issues on transient functions +* Fix - Action `*_customer_return_payment_success` backwards compatibility broken +* Fix - Apple Pay is available after a failed payment on not compatible devices +* Fix - Deprecated: idn_to_ascii() (by @sandeshjangam) + + += 5.5.1 - 12-03-2020 = + +* Fix - Fatal error caused by debug() function +* Fix - Critical uncaught error when idn_to_ascii() function is disabled + += 5.5.0 - 11-03-2020 = + +* Add - Use key instead of id to retrieve order onMollieReturn event webhooks +* Tweak - Page load performance improvements +* Tweak - Improve payment methods icons delivery mechanism by rely on cloud and fallback to static images +* Fix - Null pointer exception in case getActiveMolliePayment returns null +* Fix - WooCommerce order status can be modified via Mollie webhook without taking into account possible changes in WooCommerce +* Fix - 404 response during redirection on checkout when Polylang plugin is active +* Fix - Handle domain with non-ASCII characters + += 5.4.2 - 09-12-2019 = + +* Fix - Mollie crash when WooCommerce plugin is not active +* Fix - Checkout form does not submit the order at first click on Place Order button when payment method is not one which support Mollie Components +* Fix - Minor styles issues for Mollie Components + += 5.4.1 - 05-12-2019 = + +* Fix - Mollie Components request multiple times the merchant profile ID via API + += 5.4.0 - 04-12-2019 = + +* Fix - Apple Pay Gateway is removed from available gateways during WooCommerce Api calls +* Fix - Giftcard Gateway does not show the right payment icon in checkout page +* Add - Support for Mollie Components + += 5.3.2 - 04-11-2019 = + +* Fix - WooCommerce Session is not available before a specific action has been preformed causing null pointer exceptions in backend + += 5.3.1 - 04-11-2019 = + +* Fix - Apple Pay payment method appear temporary in checkout page even if the device does not support Apple Pay +* Fix - Refunding per line items is not possible when the refund amount field is disabled in WooCommerce order edit page +* Fix - Compatibility with PHP 7.4 + += 5.3.0 - 21-08-2019 = + +* Add - Introduce MyBank payment method +* Fix - Active Payment Object may be NULL causing WSOD after order is placed in Mollie +* Fix - ApplePay logo does not have the right resolution + += 5.2.1 - 24-07-2019 = + +* Fix - Payment wall won't load because third party code may register gateways in form of a class instance instead of a string + += 5.2.0 - 23-07-2019 = + +* Fix - Missing browser language detect in payment settings +* Add - Apple Pay payment method + += 5.1.8 - 24-05-2019 = + +* Fix - Re-add "_orderlines_process_items_after_processing_item" hook +* Fix - Fix issue where renewal order status was not respecting settings +* Fix - Fix PHP Notice: Undefined property: Mollie_WC_Payment_Payment::$id, closes #289 +* Fix - Switch version check from woocommerce_db_version to woocommerce_version as the latter is re-added to database a lot faster when it's missing then the former. Might solve issues where Mollie plugin is disabled when WooCommerce updates. + += 5.1.7 - 28-04-2019 = + +* Fix - Remove Bitcoin as payment gateway, no longer supported by Mollie, contact info@mollie.com for details +* Fix - Add extra check for URL's with parameters and correct them is structure is incorrect +* Fix - getMethodIssuers: improve caching of issuers (iDEAL, KBC/CBC) +* Fix - During payment always check if a product exists, if it doesn't create a Mollie Payment instead of Mollie Order + += 5.1.6 - 10-04-2019 = + +* New - Add support for Przelewy24 (Poland) + += 5.1.5 - 22-03-2019 = + +* Fix - Refunds: Fix condition for extended (order line) refunds +* Fix - WPML compatibility: Use get_home_url() to solve issues where people have different URLs for admin/site + += 5.1.4 - 21-03-2019 = + +* Fix - Fix caching issues for methods check +* Fix - Only run isValidForUse (and resulting API calls) in the WooCommerce settings + += 5.1.3 - 21-03-2019 = + +* Fix - Revert: Check that cached methods are stored as array, otherwise retrieve from API, fixes 'Cannot use object' error + += 5.1.2 - 20-03-2019 = + +* Fix - Convert de_DE_formal to de_DE +* Fix - Check that cached methods are stored as array, otherwise retrieve from API, fixes 'Cannot use object' error + += 5.1.1 - 19-03-2019 = + +* New - Added two new actions when processing items for Orders API, mollie-payments-for-woocommerce_orderlines_process_items_before_getting_product_id and mollie-payments-for-woocommerce_orderlines_process_items_after_processing_item +* Fix - Fixed bug where expired orders weren't updated in WooCommerce because of check for payment ID instead of order ID +* Fix - Use get_home_url() to solve issues where people have different URLs for admin/site (also influences Polylang) +* Fix - Extended refund processing: make sure people can't do a partial order line amount refund during an order line refund +* Fix - Permanent fix for PHP 7.3 with sporadic caching issues of methods + += 5.1.0 - 19-02-2019 = + +* New - Enable 'refunds' for Klarna and SEPA Direct Debit payments +* New - Support refunds per order line for payments via the Orders API (used to be only amount refunds) +* New - Updated "Tested up to" to WordPress 5.1 +* New - Automatically updating Mollie Orders from WooCommerce to "Ship and Capture" and "Cancel" now supports all payments via Orders API, not just Klarna payments +* New - Add support for refunding full Mollie Orders when refunding the full WooCommerce order (Orders API) +* New - Update order lines processing to use Order instead of Cart data (for Orders API and Klarna) +* New - Orders API/Klarna: also send WooCommerce order item id to Mollie as metadata, to allow for individual order line refunding +* New - Pro-actively check for required PHP JSON extension +* New - Added filter so merchants can manipulate the payment object metadata, default filter id mollie-payments-for-woocommerce_payment_object_metadata, also see https://www.mollie/WooCommerce/wiki/Helpful-snippets#add-custom-information-to-mollie-payment-object-metadata +* New - Add billing country to payment methods cache in checkout, for when customers change their country in checkout +* New - Allow developers to hook into the subscription renewal payment before it's processed with mollie-payments-for-woocommerce_before_renewal_payment_created +* New - Set Payment screen language setting to wp_locale by default + +* Fix - Temporary fix for PHP 7.3 with sporadic caching issues of methods, better fix is now being tested +* Fix - Check if WooCommerce Subscriptions Failed Recurring Payment Retry System is in-use, if it is, don't update subscription status +* Fix - Polylang: another fix for edge-case with URL parameter, please test and provide feedback is you use Polylang! +* Fix - Too many customers redirected to "Pay now" after payment, add isAuthorized to status check in getReturnRedirectUrlForOrder() +* Fix - Add extra warning to order note for orders that are completed at Mollie (not WooCommerce) +* Fix - Improve onWebhookFailed for WooCommerce Subscriptions so failed payments at Mollie are failed orders at WooCommerce + += 5.0.7 - 04-12-2018 = + +* Fix - Bancontact payments don't return a name as part of IBAN details (in Mollie API), so in that case use the WooCommerce name +* Fix - WooCommerce 2.6 and older: use get_country instead of get_billing_country +* Fix - Remove calls to delete payment mode, renewal payments can't use a different mode anyway, mandates aren't shared between modes +* Fix - Subscription renewal payments: if subscription does not contain the payment mode, try getting it from the parent order +* Fix - For shipping details use !empty() instead of isset +* Fix - Further improve restore_mollie_customer_id so it catches more edge-cases (and rename to restore_mollie_customer_id_and_mandate) +* Fix - Remove delete meta calls for meta that wasn't used anywhere (_mollie_card_4_digits) + += 5.0.6 - 23-11-2018 = + +* Fix - Set subscription to On-Hold if renewal order gets a charge-back, add action hooks after refunds and chargebacks +* Fix - Update translation function call + += 5.0.5 - 22-11-2018 = + +* Fix - WooCommerce Subscriptions: improve support for options "Accept Manual Renewals" and "Turn off Automatic Payments" +* Fix - Update Refunds and Chargebacks processing to support Orders and Payments API +* Fix - Remove option to set a description for payments, the new Orders API does not support this +* Fix - Update is_available to use billing country, and add filter Mollie_WC_Plugin::PLUGIN_ID . '_is_available_billing_country_for_payment_gateways' +* Fix - Add new hook after renewal payment is created: mollie-payments-for-woocommerce_after_renewal_payment_created +* Fix - Improve warnings in WooCommerce > Settings > Payments so they are less confusing to users (and really dismissable) +* Fix - Simplify log messages in shipAndCaptureOrderAtMollie, cancelOrderAtMollie + += 5.0.4 - 08-11-2018 = + +* Fix - Get test mode higher in scheduled_subscription_payment() process +* Fix - Add automated option to restore a customer ID from Mollie API +* Fix - Store sequenceType in the correct position for payments + + += 5.0.3 - 01-11-2018 = + +* Fix - Improvements to refunds: better log messages, show errors to shop-manager +* Fix - Remove option to set a description for payments, the new Orders API does not support this +* Fix - Update WooCommerce status constants in our plugin (cancelled and refunded) +* Fix - Make sure customer ID is stored by getting the payment object with all payments embedded +* Fix - Get and use correct _mollie_payment_id in setActiveMolliePaymentForOrders and setActiveMolliePaymentForSubscriptions +* Fix - Move adding of sequenceType into payment object +* Fix - Update Webship Giftcard logo to webshopgiftcard.svg + +* Fix - Klarna/Orders API: Also send Address Line 2 to Mollie Orders API +* Fix - Klarna/Orders API: In billing and shipping address check that fields aren't just a space +* Fix - Klarna/Orders API: Decode HTML entities in product names before sending them to Mollie +* Fix - Klarna/Orders API: Don't fall back to Payments API if payment method is Klarna +* Fix - Klarna/Orders API: Only add shipping address if all required fields are present +* Fix - Klarna/Orders API: Always store Mollie order ID as _mollie_order_id +* Fix - Klarna/Orders API: Add fallback to getActiveMolliePayment and try to get payment ID from Mollie order if possible + += 5.0.2 - 11-10-2018 = + +IMPORTANT +This version requires PHP 5.6 or higher. If you are using an older PHP version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). + +* New - Now supports [Klarna Pay later](https://www.mollie.com/en/payments/klarna-pay-later) and [Klara Slice it](https://www.mollie.com/en/payments/klarna-slice-it), [read more](https://www.mollie.com/en/news/post/mollie-partners-with-klarna-for-maximum-payment-flexibility) +* New - Implemented support for the new Orders API +* New - Tested with and updated for WooCommerce 3.5 beta compatibility +* New - EPS, GiroPay: implemented support for SEPA first payments (recurring payments) + +* Fix - Fixed for "Uncaught Error: Call to a member function isOpen() on null" +* Fix - Fixed issue with Guzzle and PhpScoper + +* Fix - WooCommerce emails: make sure "Payment completed by..." message is only shown once per email +* Fix - WooCommerce Subscriptions: add support for "Accept Manual Renewals". This enables Bank Transfer and PayPal in checkout for subscription products. +* Fix - Mollie payment gateways weren't always shows when cart was empty. +* Fix - Fix for "Link expired" message after refresh methods in WooCommerce settings +* Fix - Stricter check for valid API key when individual gateways are loaded +* Fix - Added new action hook in Mollie_WC_Gateway_Abstract::getReturnRedirectUrlForOrder() +* Fix - Improve log messages for orderNeedsPayment check, old messages where confusing to merchants +* Fix - Update VVV giftcard logo filename + += 4.0.2 - 07-08-2018 = + +* Fix - Reverted to older version of Mollie API PHP client, as it caused more issues than it fixed. This means conflicts with other plugins that use Guzzle are still possible. Use Mollie Payments For WooCommerce 3.0.6 if you also use plugins Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact until we can provide a solution. If you experience issues, please contact us. [Please review this article.](https://github.com/mollie/WooCommerce/wiki/Composer-Guzzle-conflicts) + += 4.0.1 - 06-08-2018 = + +IMPORTANT +Version 4.0 requires PHP 5.6 or higher. If you are using an older PHP version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). + +* New - [Multicurrency support for WooCommerce added](https://www.mollie.com/en/features/multicurrency/) +* New - [New payment methods EPS and GiroPay added](https://www.mollie.com/en/news/post/introducing-two-new-payment-methods-eps-and-giropay) +* New - Updated payment method logo's (better quality SVG's) +* New - Updated Mollie API PHP to 2.0.10 + +* New - Add support for failed regular payments (already had support for failed renewal payments) +* New - In WooCommerce order edit view, add direct link to payment in Mollie Dashboard +* New - Add notice to use bank transfer via Mollie, not default BACS gateway +* New - Add support for new refunds and chargebacks processing (that are initiated in Mollie Dashboard) + +* Fix - Guzzle conflicts with other plugins solved (Klarna, Simple Locator, Cardinity, LeadPages, ConstantContact) +* Fix - "cURL error 60" fixed by including valid cacert.pem file +* Fix - Make sure getting the shop currency is also possible on WooCommerce 2.6 or older +* Fix - Fix "Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in " by adding try/catch blocks for serialize() for the rare cases where __sleep() isn't found in PHP +* Fix - Check that a locale (language code) is supported by Mollie before trying to create a payment +* Fix - "Couldn't create * payment", when other plugins (like WPML) use another locale format then the Mollie API (ISO 15897) +* Fix - "Couldn't create * payment", temporarily disable sending the address details to Mollie for fraud detection, payments not allowed if one of the fields is missing +* Fix - "Call to undefined function get_current_screen()" that can happen on some screens + += 3.0.6 - 21/06/2018 = + +IMPORTANT +Starting with version 4.0, this plugin will require PHP 5.6. If you are using an older version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). We expect to launch version 4.0 in June 2018. + +* Fix - Remove a remove_action() call that blocked the plugin from running on PHP versions below PHP 5.6 +* Fix - Added more log messages to onWebhookPaid + += 3.0.5 - 18/06/2018 = + +IMPORTANT +Starting with version 4.0, this plugin will require PHP 5.6. If you are using an older version, please read this article: [PHP & Mollie API v2](https://github.com/mollie/WooCommerce/wiki/PHP-&-Mollie-API-v2). We expect to launch version 4.0 in June 2018. + +* Add warning that version 4.0 will require PHP 5.6 +* Update 'Required PHP' tag to PHP 5.6 +* Removes fatal error for thank you page without valid order (Issue #212 by NielsdeBlaauw) + += 3.0.4 - 24/05/2018 = + +* Fix - Limit order status update for cancelled and expired payments if another non-Mollie payment gateway also started payment processing (and is active) for that order, prevents expired and cancelled Mollie payments from cancelling the order +* Fix - Webhook URL's with double slashes, caused by some multilanguage plugins (Polylang etc) +* Fix - Add extra condition to make sure customers with paid payments are redirected to correct URL after payment +* Fix - Incorrect return page after payment for some orders, fix was to get payment without cache at least once on return URL (in case Webhook Url is still processing) + += 3.0.3 - 14/05/2018 = + +* Note - If you use Polylang or another multilanguage plugin, read this [FAQ item](https://github.com/mollie/WooCommerce/wiki/Common-issues#issues-with-polylang-or-other-multilanguage-plugins)! +* Fix - Polylang: Received all versions of Polylang from Frederic, made sure our integration works with all combinations + +* Fix - Order confirmation/Thank you page ([issue #206](https://github.com/mollie/WooCommerce/issues/206)): + * Show pending payment message for open and pending payments, not just open + * Show payment instructions and pending payment message in WooCommerce notice style, so shop-customers notice it better + * Make sure pending payment message is also shown for creditcard, PayPal and Sofort payments +* Fix - Redirect to checkout payment URL (retry payment) more often, also for failed payments + += 3.0.2 - 07/05/2018 = + +* New - Add extra log message "Start process_payment for order ..." +* Fix - Fix "Uncaught Error: Call to undefined function wcs_order_contains_renewal()" when users don't have WooCommerce Subscriptions installed +* Fix - Improve condition(s) for disableMollieOnPaymentMethodChange, make sure not to disable payment methods on checkout (because of is_account_page() false positives, bug in WooCommerce) +* Fix - Improve is_available() check for minimum/maximum amounts, better check renewal payment amounts + += 3.0.1 - 17/04/2018 = + +* [Fix/Revert, see issue 173](https://github.com/mollie/WooCommerce/issues/173) - Improve support for Polylang option "Hide URL language information for default language" in webhook and return URLs + += 3.0.0 - 17/04/2018 = + +* New - WooCommerce Subscriptions: add support for 'subscription_payment_method_change', shop-customers can change payment method if renewal payment fails (SEPA incasso, credit card) +* New - WooCommerce Subscriptions: disable Mollie payment methods on shop-customer's my account page for "Payment method change", keep it enabled for "Pay now" link in emails +* New - WooCommerce Subscriptions: improve handling and update messages and notices for Subscription switch to better explain what's happening +* New - WooCommerce Subscriptions: set renewal orders and subscriptions to 'On-Hold' if renewal payment fails + +* Fix - Fallback for getUserMollieCustomerId, get Mollie Customer ID from recent subscription if it's empty in WordPress user meta +* Fix - Improve support for Polylang option "Hide URL language information for default language" in webhook and return URLs +* Fix - Only check if customer ID is valid on current API key if there is a customer ID (not empty)(and improve log messages) +* Fix - Make sure payment instructions (Bank Transfer) are styled the same as WooCommerce content (Order received, payment pending) +* Fix - Don't update/process/expire Mollie payments on WooCommerce orders that have been paid with other payment gateways +* Fix - Updated text strings for Bancontact/Mister Cash to just Bancontact +* Fix - Use the exact same translation as WooCommerce for order statuses +* Fix - Resolve error (fatal error get_payment_method()) that occurred when users made certain custom changes to the WooCommerce template files +* Fix - Add order note and log message when customer returns to the site but payment is open/pending +* Fix - Improved order note for charged back renewal payments + += 2.9.0 - 13/02/2018 = + +* New - Added support for new payment method: [ING Home'Pay](https://www.mollie.com/en/payments/ing-homepay) +* New - Updated Mollie API PHP to 1.9.6 (ING Home'Pay support) + +* Fix - Check that Mollie customerID is known on current API key, solves issues for admins that switched from test to live +* Fix - Charged back payments now update the order status to On Hold and add an order note in WooCommerce, stock is not updated +* Fix - For 'Payment screen language' set default to 'Detect using browser language' as it is usually more accurate +* Fix - For subscriptions also compare recurring total amount to payment method maximums, not only the order/cart total +* Fix - Improve WPML compatibility by removing duplicate trailing slash in WooCommerce API request URL + += 2.8.2 - 15/01/2018 = + +* Fix - Fixed a PHP error by setting an argument default for onOrderReceivedTitle(), because post ID not set in all WordPress versions + += 2.8.1 - 15/01/2018 = + +* New - iDEAL, KBC, Gift cards: Option to hide issuers/bank list in WooCommerce +* New - Allow subscription switching (downgrade) when amount to pay is €0 and there is a valid mandate for the user + +* Fix - A new customerID was created for every new order where a payment method that supported recurring payments was selected +* Fix - When plugin 2.8.0 was used with WooCommerce 2.6 or older, a fatal error would be shown on the return page (because of use of new WooCommerce 3.0 method) +* Fix - Some cancelled payments for cancelled orders where redirected to "Retry payment" instead of "Order received" page, see Github issue #166 + += 2.8.0 - 09/01/2018 = + +* New - Updated required WooCommerce version to 2.2.0 +* New - Tested with WooCommerce 3.3 beta, no issues found +* New - Better message on "Order Received" page for open/pending payments +* New - Allow users to set the order status for orders where a payment was cancelled +* New - Added support for Polylang Pro (polylang-pro) to getSiteUrlWithLanguage() +* New - Updated credit card icon in WooCommerce checkout to show icons for MasterCard, Visa, AMEX, CartaSi, Cartes Bancaires +* New - Better way to check if WooCommerce is activated and has correct version (so plugin doesn't de-activate on WooCommerce updates) +* New - Redact customer IBAN in notification-mails +* New - Update how "Select your bank" is shown in the dropdown for iDEAL and KBC/CBC (and show a default) + +* Fix - Fix error by making sure order is not removed/exists (in checkPendingPaymentOrdersExpiration) +* Fix - Make sure payments cancelled at Mollie are also cancelled in WooCommerce, so customers can select a new payment method +* Fix - KBC/CBC: Make sure KBC/CBC is listed as "Automatic Recurring Payment" gateway in WooCommerce +* Fix - Fix (no title) showing in settings for SEPA Direct Debit for some new installs +* Fix - Fix wrong date formatting shown for bank transfer instructions, thank you profoX! +* Fix - Typo in SEPA Direct Debit description, thank you Yame-! +* Fix - It's possible to set the initial status of bank transfer to pending instead of on-hold, but in that case the payment instructions would not be shown on the Order Received page (missing in condition) +* Fix - Make sure webhook processing for Paid doesn't run on status PaidOut +* Fix - Improve orderNeedsPayment so there are less false-positives if users use 3PD plugins to change the order status too early +* Fix - Add WC_Subscriptions_Manager::activate_subscriptions_for_order to make sure subscriptions are always activated when payment is paid, independent of order status + += 2.7.0 - 07/09/2017 = + +* New - Support for gift cards! See: https://www.mollie.com/en/blog/post/mollie-launches-gift-cards/ +* New - Also show issuers (banks) for KBC payment method + +* Fix - Add better support for WooCommerce Deposits (by Webtomizer) +* Fix - Subscriptions would be set to 'On Hold' during SEPA Direct Debit payments, those subscriptions are now set to 'Active' +* Fix - Multiple issues that occurred when users had multiple (unpaid) payments per order +* Fix - Remove SEPA Direct Debit (only used for Mollie recurring) as visible gateway in checkout and settings +* Fix - Tested with WordPress 4.9 Alpha and WooCommerce 3.1 +* Fix - Remove existing language files from plugin so they can be managed via https://translate.wordpress.org/projects/wp-plugins/mollie-payments-for-woocommerce +* Fix - Use better customer name when name is sent to Mollie (use full name and last name if available) +* Fix - Don't update orders to cancelled status for expired payments if there are still pending payments for same order +* Fix - Show correct return page to customer when they have placed multiple payments for single order +* Fix - For subscription renewal orders, update payment method (from iDEAL, Belfius etc) to SEPA Direct Debit when needed +* Fix - Add message that SEPA Direct Debit is required when using WooCommerce Subscriptions with iDEAL + +* Dev - Stop checking change of payment methods with isValidPaymentMethod +* Dev - Add support for new WooCommerce version check +* Dev - In setActiveMolliePayment use update_post_meta so payment is always updated to latest +* Dev - In unsetActiveMolliePayment, a payment calling that function should only be able to unset itself +* Dev - Improve log messages (WooCommerce > System status > Logs > mollie-payments-for-woocommerce) +* Dev - Security improvement: sanitize getting ID's via POST and use $_POST instead of $_REQUEST +* Dev - Only show "Check Subscription Status" tool if WooCommerce Subscriptions is installed +* Dev - Fix PHP warnings about unserialize() by using serialize() before storing object as transient +* Dev - Move load_plugin_textdomain to own function and load on plugins_loaded action + += 2.6.0 - 07/06/2017 = +* Add support for WooCommerce 3.0 (backwards compatible with older versions of WooCommerce) +* The expiry date that's shown for payments via Bank transfer is now in the correct (translated) format +* Fix redundant "DESCRIBE *__mollie_pending_payment" error (on new installs) +* WooCommerce Subscriptions: + * Important: added Subscription Status tool to fix broken subscriptions, see [instructions](https://github.com/mollie/WooCommerce/wiki/Mollie-Subscriptions-Status) + * SEPA recurring payments, take initial order status from settings, default On-Hold (instead of Completed) + * Fix issue where valid subscriptions are set to 'on-hold' and 'manual renewal' only 15 days after renewal payment is created (now only do that after 21 days) + * Improve "Subscription switching" support to also allow amount changes + * Fix typo in recurring payment order notes + += 2.5.5 - 31/03/2017 = +* Allow the option name to have maximum 191 characters for newer WooPress installations. + += 2.5.4 - 07/03/2017 = +* Added an option to disable storing the customer details at Mollie + += 2.5.3 - 01/03/2017 = +* Bugfix for crashing WooPress when using PHP version 5.3 or lower + += 2.5.2 - 28/02/2017 = +* The plugin is now compatible with WooCommerce Subscriptions for recurring payments +* Removed 'test mode enabled' description, which causes problems when using WPML +* Empty the cart when the order is finished, rather than when the payment is created + += 2.4.1 - 10/10/2016 = +* Fix 2.4.0 release (https://wordpress.org/support/topic/error-500-after-updating) + += 2.4.0 - 10/10/2016 = +* Add KBC/CBC Payment Button method. +* Add option to the iDEAL gateway to set the text for the empty option in the issuers drop down. Go to the iDEAL gateway settings to change this value. +* Update Mollie API client to v1.7.1. + += 2.3.1 - 14/09/2016 = +* Turn on 'mail payment instructions' for Bank Transfer by default +* Fix bug to support Polylang plugin + += 2.3.0 - 27/07/2016 = +* Update payment method icons. +* Send the refund description to Mollie. The refund description will be visible for your customer on their bank statement. +* Add new filters `mollie-payments-for-woocommerce_order_status_cancelled` and `mollie-payments-for-woocommerce_order_status_expired` to be able +to overwrite the order status for cancelled and expired Mollie payments. You can find all available filters on https://github.com/mollie/WooCommerce/tree/master/development. +* Update Mollie API client to v1.6.5. + += 2.2.1 - 18/04/2016 = +* Add option for the Bank Transfer gateway to skip redirecting your users to the Mollie payment screen. Instead directly redirect to the WooCommerce order +received page where payment instruction will be displayed. You can turn on this option on the Mollie Bank Transfer setting page: +WooCommerce -> Settings -> Payments -> Mollie - Bank Transfer. + += 2.2.0 - 29/03/2016 = +* Add integration with Mollie Customers API. +* Use shorter transient prefix. +* Update Mollie API client to v1.4.1. + += 2.1.1 - 27/01/2016 = +* Add better support for translation plugins Polylang and mLanguage. +* Fixed small issue for PHP 5.2 users. + += 2.1.0 - 01/12/2015 = +* For payment methods where the payment status will be delivered after a couple of days you can set the initial order status. Choose between `on-hold` or `pending`. +* Get the correct current locale (with support for [WPML](https://wpml.org)). +* Cache payment methods and issuers by locale. +* Cancel order when payment is expired. +* Reduce order when initial order status is `on-hold`. Restore order stock when payment fails. +* Hide payment gateway when cart exceeds method min / max amount. Method min / max amount is returned by Mollie API. +* Add filter to change the return URL. + += 2.0.1 - 02/10/2015 = +* Add support for SEPA Direct Debit. +* Add message for Belfius, Bancontact and paysafecard when the payment is paid successfully. + += 2.0.0 - 17/08/2015 = +* Complete rewrite of our WooCommerce plugin to better follow WordPress and WooCommerce standards and add better support for other plugins. + +== Upgrade Notice == + += 2.5.2 = +Our plugin is now compatible with WooCommerce Subscriptions for recurring payments. + += 2.0.0 = +* The 2.x version of the plugin uses a different plugin name. You can still run version 1.x of our plugin if you want to temporary +keep support for payments created using version 1.x. Hide the old payment gateways by disabling the old 'Mollie Payment Module' payment gateway in WooCommerce -> Settings -> Payments. From e490014155efeebc891b02b2b050c6a2fb032c4b Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 6 May 2024 16:54:19 +0200 Subject: [PATCH 09/19] Update to Syde in readme.txt --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 8ea0bcf7..72dbcc5d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === Mollie Payments for WooCommerce === -Contributors: daanvm, danielhuesken, davdebcom, dinamiko, inpsyde, l.vangunst, ndijkstra, robin-mollie, wido, carmen222, inpsyde-maticluznar +Contributors: daanvm, danielhuesken, davdebcom, dinamiko, syde, l.vangunst, ndijkstra, robin-mollie, wido, carmen222, inpsyde-maticluznar Tags: mollie, payments, payment gateway, woocommerce, credit card, apple pay, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions Requires at least: 3.8 Tested up to: 6.5 From 085fafe28d68885bfd829af1828ffbe9bf7fc0a2 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Tue, 7 May 2024 14:06:14 +0200 Subject: [PATCH 10/19] Avoid rounding issues with trick maths --- inc/utils.php | 6 +++++- src/Payment/OrderLines.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/utils.php b/inc/utils.php index 984e54f3..b0786802 100644 --- a/inc/utils.php +++ b/inc/utils.php @@ -186,7 +186,11 @@ function mollieWooCommerceFormatCurrencyValue($value, $currency) if (in_array($currency, $currenciesWithNoDecimals)) { return number_format($value, 0, '.', ''); } - + // trying to avoid floating point issues + $value= $value * 1000; + $value= (int) $value / 1000; //drop the last decimal after the third + $value = round($value, 3); + $value = round($value, 2, PHP_ROUND_HALF_DOWN); //round down, as seems woo like it :) return number_format($value, 2, '.', ''); } diff --git a/src/Payment/OrderLines.php b/src/Payment/OrderLines.php index 440bda15..de67b7c5 100644 --- a/src/Payment/OrderLines.php +++ b/src/Payment/OrderLines.php @@ -560,7 +560,7 @@ private function get_shipping_vat_rate() { $shipping_vat_rate = 0; if (WC()->cart->shipping_tax_total > 0) { - $shipping_vat_rate = round(WC()->cart->shipping_tax_total / WC()->cart->shipping_total, 2) * 100; + $shipping_vat_rate = round(WC()->cart->shipping_tax_total / WC()->cart->shipping_total, 4) * 100; } return $shipping_vat_rate; From fe60952ad4f3cbf3507877e699700934bf2a1f6a Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 8 May 2024 10:37:00 +0200 Subject: [PATCH 11/19] Add Alma payment method with new payment API fields Moved the address fields to the parent object Now we can declare new fields dinamically as long as they follow create+$fieldName --- public/images/alma.svg | 11 ++ src/Payment/MollieObject.php | 223 +++++++++++++++++++++++++++- src/Payment/MollieOrder.php | 219 +-------------------------- src/Payment/MolliePayment.php | 18 +++ src/PaymentMethods/Alma.php | 4 + src/Shared/SharedDataDictionary.php | 1 + 6 files changed, 256 insertions(+), 220 deletions(-) create mode 100644 public/images/alma.svg diff --git a/public/images/alma.svg b/public/images/alma.svg new file mode 100644 index 00000000..9133d203 --- /dev/null +++ b/public/images/alma.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/Payment/MollieObject.php b/src/Payment/MollieObject.php index 9a69a834..7f2b465d 100644 --- a/src/Payment/MollieObject.php +++ b/src/Payment/MollieObject.php @@ -11,13 +11,16 @@ use Mollie\WooCommerce\PaymentMethods\Voucher; use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\Settings\Settings; -use Psr\Log\LogLevel; use WC_Order; use WC_Payment_Gateway; use Psr\Log\LoggerInterface as Logger; - +use stdClass; class MollieObject { + public const MAXIMAL_LENGHT_ADDRESS = 100; + public const MAXIMAL_LENGHT_POSTALCODE = 20; + public const MAXIMAL_LENGHT_CITY = 200; + public const MAXIMAL_LENGHT_REGION = 200; protected $data; /** * @var string[] @@ -983,4 +986,220 @@ protected function replaceTagsDescription($order, $description) } return $description; } + + /** + * @param $order + * @return stdClass + */ + protected function createBillingAddress($order) + { + // Setup billing and shipping objects + $billingAddress = new stdClass(); + + // Get user details + $billingAddress->givenName = (ctype_space( + $order->get_billing_first_name() + )) ? null : $order->get_billing_first_name(); + $billingAddress->familyName = (ctype_space( + $order->get_billing_last_name() + )) ? null : $order->get_billing_last_name(); + $billingAddress->email = (ctype_space($order->get_billing_email())) + ? null : $order->get_billing_email(); + // Create billingAddress object + $billingAddress->streetAndNumber = (ctype_space( + $order->get_billing_address_1() + )) + ? null + : $this->maximalFieldLengths( + $order->get_billing_address_1(), + self::MAXIMAL_LENGHT_ADDRESS + ); + $billingAddress->streetAdditional = (ctype_space( + $order->get_billing_address_2() + )) + ? null + : $this->maximalFieldLengths( + $order->get_billing_address_2(), + self::MAXIMAL_LENGHT_ADDRESS + ); + $billingAddress->postalCode = (ctype_space( + $order->get_billing_postcode() + )) + ? null + : $this->maximalFieldLengths( + $order->get_billing_postcode(), + self::MAXIMAL_LENGHT_POSTALCODE + ); + $billingAddress->city = (ctype_space($order->get_billing_city())) + ? null + : $this->maximalFieldLengths( + $order->get_billing_city(), + self::MAXIMAL_LENGHT_CITY + ); + $billingAddress->region = (ctype_space($order->get_billing_state())) + ? null + : $this->maximalFieldLengths( + $order->get_billing_state(), + self::MAXIMAL_LENGHT_REGION + ); + $billingAddress->country = (ctype_space($order->get_billing_country())) + ? null + : $this->maximalFieldLengths( + $order->get_billing_country(), + self::MAXIMAL_LENGHT_REGION + ); + $billingAddress->organizationName = $this->billingCompanyField($order); + $phone = $this->getPhoneNumber($order); + $billingAddress->phone = (ctype_space($phone)) + ? null + : $this->getFormatedPhoneNumber($phone); + return $billingAddress; + } + + protected function getPhoneNumber($order) + { + + $phone = !empty($order->get_billing_phone()) ? $order->get_billing_phone() : $order->get_shipping_phone(); + if (empty($phone)) { + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $phone = wc_clean(wp_unslash($_POST['billing_phone'] ?? '')); + } + return $phone; + } + + protected function getFormatedPhoneNumber(string $phone) + { + //remove whitespaces and all non numerical characters except + + $phone = preg_replace('/[^0-9+]+/', '', $phone); + + //check that $phone is in E164 format + if ($phone !== null && preg_match('/^\+[1-9]\d{1,14}$/', $phone)) { + return $phone; + } + return null; + } + + /** + * @param $order + * @return string|null + */ + public function billingCompanyField($order): ?string + { + if (!trim($order->get_billing_company())) { + return $this->checkBillieCompanyField($order); + } + return $this->maximalFieldLengths( + $order->get_billing_company(), + self::MAXIMAL_LENGHT_ADDRESS + ); + } + + private function checkBillieCompanyField($order) + { + $gateway = wc_get_payment_gateway_by_order($order); + if (!$gateway || !$gateway->id) { + return null; + } + $isBillieMethodId = $gateway->id === 'mollie_wc_gateway_billie'; + if ($isBillieMethodId) { + //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $fieldPosted = wc_clean(wp_unslash($_POST["billing_company"] ?? '')); + if ($fieldPosted === '' || !is_string($fieldPosted)) { + return null; + } + return $this->maximalFieldLengths( + $fieldPosted, + self::MAXIMAL_LENGHT_ADDRESS + ); + } + return null; + } + + /** + * @param $order + * @return stdClass + */ + protected function createShippingAddress($order) + { + $shippingAddress = new stdClass(); + // Get user details + $shippingAddress->givenName = (ctype_space( + $order->get_shipping_first_name() + )) ? null : $order->get_shipping_first_name(); + $shippingAddress->familyName = (ctype_space( + $order->get_shipping_last_name() + )) ? null : $order->get_shipping_last_name(); + $shippingAddress->email = (ctype_space($order->get_billing_email())) + ? null + : $order->get_billing_email(); // WooCommerce doesn't have a shipping email + + + // Create shippingAddress object + $shippingAddress->streetAndNumber = (ctype_space( + $order->get_shipping_address_1() + )) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_address_1(), + self::MAXIMAL_LENGHT_ADDRESS + ); + $shippingAddress->streetAdditional = (ctype_space( + $order->get_shipping_address_2() + )) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_address_2(), + self::MAXIMAL_LENGHT_ADDRESS + ); + $shippingAddress->postalCode = (ctype_space( + $order->get_shipping_postcode() + )) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_postcode(), + self::MAXIMAL_LENGHT_POSTALCODE + ); + $shippingAddress->city = (ctype_space($order->get_shipping_city())) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_city(), + self::MAXIMAL_LENGHT_CITY + ); + $shippingAddress->region = (ctype_space($order->get_shipping_state())) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_state(), + self::MAXIMAL_LENGHT_REGION + ); + $shippingAddress->country = (ctype_space( + $order->get_shipping_country() + )) + ? null + : $this->maximalFieldLengths( + $order->get_shipping_country(), + self::MAXIMAL_LENGHT_REGION + ); + return $shippingAddress; + } + + /** + * Method that shortens the field to a certain length + * + * @param string $field + * @param int $maximalLength + * + * @return null|string + */ + protected function maximalFieldLengths($field, $maximalLength) + { + if (!is_string($field)) { + return null; + } + if (is_int($maximalLength) && strlen($field) > $maximalLength) { + $field = substr($field, 0, $maximalLength); + $field = !$field ? null : $field; + } + + return $field; + } } diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 4a3e0feb..cea1a09a 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -4,7 +4,6 @@ namespace Mollie\WooCommerce\Payment; -use DateTime; use Exception; use Mollie\Api\Exceptions\ApiException; use Mollie\Api\Resources\Payment; @@ -15,7 +14,6 @@ use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\Shared\SharedDataDictionary; use Psr\Log\LogLevel; -use stdClass; use WC_Order; use WP_Error; @@ -23,10 +21,7 @@ class MollieOrder extends MollieObject { public const ACTION_AFTER_REFUND_AMOUNT_CREATED = 'mollie-payments-for-woocommerce' . '_refund_amount_created'; public const ACTION_AFTER_REFUND_ORDER_CREATED = 'mollie-payments-for-woocommerce' . '_refund_order_created'; - public const MAXIMAL_LENGHT_ADDRESS = 100; - public const MAXIMAL_LENGHT_POSTALCODE = 20; - public const MAXIMAL_LENGHT_CITY = 200; - public const MAXIMAL_LENGHT_REGION = 200; + protected static $paymentId; protected static $customerId; @@ -831,26 +826,7 @@ public function updatePaymentDataWithOrderData($order, $orderId) } } - /** - * Method that shortens the field to a certain length - * - * @param string $field - * @param int $maximalLength - * - * @return null|string - */ - protected function maximalFieldLengths($field, $maximalLength) - { - if (!is_string($field)) { - return null; - } - if (is_int($maximalLength) && strlen($field) > $maximalLength) { - $field = substr($field, 0, $maximalLength); - $field = !$field ? null : $field; - } - return $field; - } /** * @param WC_Order $order @@ -889,153 +865,6 @@ protected function maybeUpdateStatus( ); } - /** - * @param $order - * @return stdClass - */ - protected function createBillingAddress($order) - { - // Setup billing and shipping objects - $billingAddress = new stdClass(); - - // Get user details - $billingAddress->givenName = (ctype_space( - $order->get_billing_first_name() - )) ? null : $order->get_billing_first_name(); - $billingAddress->familyName = (ctype_space( - $order->get_billing_last_name() - )) ? null : $order->get_billing_last_name(); - $billingAddress->email = (ctype_space($order->get_billing_email())) - ? null : $order->get_billing_email(); - // Create billingAddress object - $billingAddress->streetAndNumber = (ctype_space( - $order->get_billing_address_1() - )) - ? null - : $this->maximalFieldLengths( - $order->get_billing_address_1(), - self::MAXIMAL_LENGHT_ADDRESS - ); - $billingAddress->streetAdditional = (ctype_space( - $order->get_billing_address_2() - )) - ? null - : $this->maximalFieldLengths( - $order->get_billing_address_2(), - self::MAXIMAL_LENGHT_ADDRESS - ); - $billingAddress->postalCode = (ctype_space( - $order->get_billing_postcode() - )) - ? null - : $this->maximalFieldLengths( - $order->get_billing_postcode(), - self::MAXIMAL_LENGHT_POSTALCODE - ); - $billingAddress->city = (ctype_space($order->get_billing_city())) - ? null - : $this->maximalFieldLengths( - $order->get_billing_city(), - self::MAXIMAL_LENGHT_CITY - ); - $billingAddress->region = (ctype_space($order->get_billing_state())) - ? null - : $this->maximalFieldLengths( - $order->get_billing_state(), - self::MAXIMAL_LENGHT_REGION - ); - $billingAddress->country = (ctype_space($order->get_billing_country())) - ? null - : $this->maximalFieldLengths( - $order->get_billing_country(), - self::MAXIMAL_LENGHT_REGION - ); - $billingAddress->organizationName = $this->billingCompanyField($order); - $phone = $this->getPhoneNumber($order); - $billingAddress->phone = (ctype_space($phone)) - ? null - : $this->getFormatedPhoneNumber($phone); - return $billingAddress; - } - - protected function getPhoneNumber($order) - { - - $phone = !empty($order->get_billing_phone()) ? $order->get_billing_phone() : $order->get_shipping_phone(); - if (empty($phone)) { - //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $phone = wc_clean(wp_unslash($_POST['billing_phone'] ?? '')); - } - return $phone; - } - - /** - * @param $order - * @return stdClass - */ - protected function createShippingAddress($order) - { - $shippingAddress = new stdClass(); - // Get user details - $shippingAddress->givenName = (ctype_space( - $order->get_shipping_first_name() - )) ? null : $order->get_shipping_first_name(); - $shippingAddress->familyName = (ctype_space( - $order->get_shipping_last_name() - )) ? null : $order->get_shipping_last_name(); - $shippingAddress->email = (ctype_space($order->get_billing_email())) - ? null - : $order->get_billing_email(); // WooCommerce doesn't have a shipping email - - - // Create shippingAddress object - $shippingAddress->streetAndNumber = (ctype_space( - $order->get_shipping_address_1() - )) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_address_1(), - self::MAXIMAL_LENGHT_ADDRESS - ); - $shippingAddress->streetAdditional = (ctype_space( - $order->get_shipping_address_2() - )) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_address_2(), - self::MAXIMAL_LENGHT_ADDRESS - ); - $shippingAddress->postalCode = (ctype_space( - $order->get_shipping_postcode() - )) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_postcode(), - self::MAXIMAL_LENGHT_POSTALCODE - ); - $shippingAddress->city = (ctype_space($order->get_shipping_city())) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_city(), - self::MAXIMAL_LENGHT_CITY - ); - $shippingAddress->region = (ctype_space($order->get_shipping_state())) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_state(), - self::MAXIMAL_LENGHT_REGION - ); - $shippingAddress->country = (ctype_space( - $order->get_shipping_country() - )) - ? null - : $this->maximalFieldLengths( - $order->get_shipping_country(), - self::MAXIMAL_LENGHT_REGION - ); - return $shippingAddress; - } - /** * @param $paymentObject * @param $item @@ -1167,42 +996,6 @@ protected function processOrderItemsRefund( unset($items[$item->get_id()]); } - /** - * @param $order - * @return string|null - */ - public function billingCompanyField($order): ?string - { - if (!trim($order->get_billing_company())) { - return $this->checkBillieCompanyField($order); - } - return $this->maximalFieldLengths( - $order->get_billing_company(), - self::MAXIMAL_LENGHT_ADDRESS - ); - } - - private function checkBillieCompanyField($order) - { - $gateway = wc_get_payment_gateway_by_order($order); - if (!$gateway || !$gateway->id) { - return null; - } - $isBillieMethodId = $gateway->id === 'mollie_wc_gateway_billie'; - if ($isBillieMethodId) { - //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $fieldPosted = wc_clean(wp_unslash($_POST["billing_company"] ?? '')); - if ($fieldPosted === '' || !is_string($fieldPosted)) { - return null; - } - return $this->maximalFieldLengths( - $fieldPosted, - self::MAXIMAL_LENGHT_ADDRESS - ); - } - return null; - } - protected function getCustomerBirthdate($order) { $gateway = wc_get_payment_gateway_by_order($order); @@ -1222,15 +1015,5 @@ protected function getCustomerBirthdate($order) return null; } - protected function getFormatedPhoneNumber(string $phone) - { - //remove whitespaces and all non numerical characters except + - $phone = preg_replace('/[^0-9+]+/', '', $phone); - //check that $phone is in E164 format - if ($phone !== null && preg_match('/^\+[1-9]\d{1,14}$/', $phone)) { - return $phone; - } - return null; - } } diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index 82636f65..0d319e54 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -123,6 +123,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego $encodedApplePayToken = json_encode($applePayToken); $paymentRequestData['applePayPaymentToken'] = $encodedApplePayToken; } + $paymentRequestData = $this->addCustomRequestFields($order, $paymentRequestData, $gateway); return $paymentRequestData; } @@ -530,4 +531,21 @@ protected function maybeUpdateStatus( } $gateway->paymentService()->updateOrderStatus($order, $newOrderStatus); } + + protected function addCustomRequestFields($order, array $paymentRequestData, MolliePaymentGateway $gateway) + { + if ($gateway->paymentMethod()->hasProperty('paymentAPIfields')) { + $paymentAPIfields = $gateway->paymentMethod()->getProperty('paymentAPIfields'); + foreach ($paymentAPIfields as $field) { + if (!method_exists($this, 'create' . ucfirst($field))) { + continue; + } + $value = $this->{'create' . ucfirst($field)}($order); + if ($value) { + $paymentRequestData[$field] = $value; + } + } + } + return $paymentRequestData; + } } diff --git a/src/PaymentMethods/Alma.php b/src/PaymentMethods/Alma.php index 87a9839b..57ac08fa 100644 --- a/src/PaymentMethods/Alma.php +++ b/src/PaymentMethods/Alma.php @@ -22,6 +22,10 @@ protected function getConfig(): array 'filtersOnBuild' => false, 'confirmationDelayed' => false, 'SEPA' => false, + 'paymentAPIfields' => [ + 'billingAddress', + 'shippingAddress', + ], ]; } diff --git a/src/Shared/SharedDataDictionary.php b/src/Shared/SharedDataDictionary.php index 7845ff63..d4f0c156 100644 --- a/src/Shared/SharedDataDictionary.php +++ b/src/Shared/SharedDataDictionary.php @@ -34,6 +34,7 @@ class SharedDataDictionary 'Mollie_WC_Gateway_Blik', 'Mollie_WC_Gateway_Twint', 'Mollie_WC_Gateway_Bancomatpay', + 'Mollie_WC_Gateway_Alma', ]; public const MOLLIE_OPTIONS_NAMES = [ From c09c59544dbeacd2149330d3e411b1d7efb8eb91 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 8 May 2024 10:44:19 +0200 Subject: [PATCH 12/19] Fix CS --- src/Payment/MollieObject.php | 1 + src/Payment/MollieOrder.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Payment/MollieObject.php b/src/Payment/MollieObject.php index 7f2b465d..ba03f6e1 100644 --- a/src/Payment/MollieObject.php +++ b/src/Payment/MollieObject.php @@ -15,6 +15,7 @@ use WC_Payment_Gateway; use Psr\Log\LoggerInterface as Logger; use stdClass; + class MollieObject { public const MAXIMAL_LENGHT_ADDRESS = 100; diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index cea1a09a..804e91b6 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -1014,6 +1014,4 @@ protected function getCustomerBirthdate($order) } return null; } - - } From 9cd676c2b848a20789ac0525ca948de951543109 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 8 May 2024 10:50:29 +0200 Subject: [PATCH 13/19] Remove typo --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0c859593..0fbd7da9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ }, { "name": "Syde Gmbh", - "email": "hello@syde.com", + "email": "hello@syde.com" } ], "require": { From e155875aec875afa8085d9160a301bce6c05a318 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Wed, 8 May 2024 10:53:52 +0200 Subject: [PATCH 14/19] Fix CS --- inc/utils.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/utils.php b/inc/utils.php index b0786802..6a183ffd 100644 --- a/inc/utils.php +++ b/inc/utils.php @@ -187,8 +187,8 @@ function mollieWooCommerceFormatCurrencyValue($value, $currency) return number_format($value, 0, '.', ''); } // trying to avoid floating point issues - $value= $value * 1000; - $value= (int) $value / 1000; //drop the last decimal after the third + $value = $value * 1000; + $value = (int) $value / 1000; //drop the last decimal after the third $value = round($value, 3); $value = round($value, 2, PHP_ROUND_HALF_DOWN); //round down, as seems woo like it :) return number_format($value, 2, '.', ''); From 240347778b0c0dfb60508771685d718c26317494 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 27 May 2024 12:35:52 +0200 Subject: [PATCH 15/19] Update version to 7.5.4-beta merge 7.5.3 into this one --- mollie-payments-for-woocommerce.php | 2 +- src/Payment/MollieObject.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index 94787c65..526a9f49 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.5.3 + * Version: 7.5.4-beta * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 diff --git a/src/Payment/MollieObject.php b/src/Payment/MollieObject.php index ba03f6e1..84f70d42 100644 --- a/src/Payment/MollieObject.php +++ b/src/Payment/MollieObject.php @@ -1072,9 +1072,14 @@ protected function getFormatedPhoneNumber(string $phone) { //remove whitespaces and all non numerical characters except + $phone = preg_replace('/[^0-9+]+/', '', $phone); + if (!is_string($phone)) { + return null; + } + //check if phone starts with 06 and replace with +316 + $phone = transformPhoneToNLFormat($phone); - //check that $phone is in E164 format - if ($phone !== null && preg_match('/^\+[1-9]\d{1,14}$/', $phone)) { + //check that $phone is in E164 format or can be changed by api + if (preg_match('/^\+[1-9]\d{10,13}$|^[1-9]\d{9,13}$/', $phone)) { return $phone; } return null; From 9458e37eb0cf50b00535bfa0f16ef12c256329d3 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 3 Jun 2024 08:48:07 +0200 Subject: [PATCH 16/19] Cast surcharge values to float --- src/Gateway/Surcharge.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gateway/Surcharge.php b/src/Gateway/Surcharge.php index 8bb077a0..55ba4ac7 100644 --- a/src/Gateway/Surcharge.php +++ b/src/Gateway/Surcharge.php @@ -171,7 +171,7 @@ protected function calculate_percentage(WC_Cart $cart, array $gatewaySettings) if (empty($gatewaySettings[Surcharge::PERCENTAGE])) { return 0.0; } - $percentageFee = $gatewaySettings[Surcharge::PERCENTAGE]; + $percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE]; $subtotal = $cart->get_subtotal() + $cart->get_shipping_total() - $cart->get_discount_total(); $taxes = $cart->get_subtotal_tax() + $cart->get_shipping_tax() - $cart->get_discount_tax(); $total = $subtotal + $taxes; @@ -190,7 +190,7 @@ protected function calculate_percentage_order(WC_Order $order, array $gatewaySet if (empty($gatewaySettings[Surcharge::PERCENTAGE])) { return 0.0; } - $percentageFee = $gatewaySettings[Surcharge::PERCENTAGE]; + $percentageFee = (float) $gatewaySettings[Surcharge::PERCENTAGE]; $total = $order->get_total(); $fee = $total * ($percentageFee / 100); @@ -340,4 +340,6 @@ protected function maybeAddTaxString(string $feeText): string } return $feeText; } + + } From 233e41b9690354571a419ead1c89f4c664777369 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 3 Jun 2024 08:50:31 +0200 Subject: [PATCH 17/19] Update version and tested wc version --- mollie-payments-for-woocommerce.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index 526a9f49..98207929 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.5.4-beta + * Version: 7.5.4 * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 @@ -12,7 +12,7 @@ * Domain Path: /languages * License: GPLv2 or later * WC requires at least: 3.9 - * WC tested up to: 8.7 + * WC tested up to: 8.9 * Requires PHP: 7.2 * Requires Plugins: woocommerce */ From cbf8d82f99eac4c714322e295fba50e47354082e Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 3 Jun 2024 09:02:57 +0200 Subject: [PATCH 18/19] Fix cs --- src/Gateway/Surcharge.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Gateway/Surcharge.php b/src/Gateway/Surcharge.php index 55ba4ac7..9d6d82d1 100644 --- a/src/Gateway/Surcharge.php +++ b/src/Gateway/Surcharge.php @@ -340,6 +340,4 @@ protected function maybeAddTaxString(string $feeText): string } return $feeText; } - - } From 7e2bcb0e2e2e746808f111efc9aa68b478526dc3 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 3 Jun 2024 11:26:56 +0200 Subject: [PATCH 19/19] Put alma method under flag default hidden --- src/Gateway/GatewayModule.php | 6 ++++++ src/PaymentMethods/Constants.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 889769de..1e9602df 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -118,6 +118,12 @@ public function services(): array return $method['id'] !== Constants::BANCOMATPAY; }); } + $almaFlag = apply_filters('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', false); + if (!$almaFlag) { + return array_filter($availablePaymentMethods, static function ($method) { + return $method['id'] !== Constants::ALMA; + }); + } return $availablePaymentMethods; }, 'gateway.isSDDGatewayEnabled' => static function (ContainerInterface $container): bool { diff --git a/src/PaymentMethods/Constants.php b/src/PaymentMethods/Constants.php index 6f62e6b2..d8597c60 100644 --- a/src/PaymentMethods/Constants.php +++ b/src/PaymentMethods/Constants.php @@ -12,4 +12,6 @@ class Constants public const BANKTRANSFER = 'banktransfer'; public const BANCOMATPAY = 'bancomatpay'; + + public const ALMA = 'alma'; }