Skip to content

Commit

Permalink
Merge branch 'refs/heads/release/7.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jul 10, 2024
2 parents d5d6190 + 9f79a2d commit 2756123
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 41 deletions.
6 changes: 1 addition & 5 deletions inc/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,7 @@ 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, '.', '');
}

Expand Down
4 changes: 2 additions & 2 deletions mollie-payments-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.5
* Version: 7.6.0
* Author: Mollie
* Author URI: https://www.mollie.com
* Requires at least: 5.0
Expand All @@ -12,7 +12,7 @@
* Domain Path: /languages
* License: GPLv2 or later
* WC requires at least: 3.9
* WC tested up to: 8.9
* WC tested up to: 9.0
* Requires PHP: 7.2
* Requires Plugins: woocommerce
*/
Expand Down
1 change: 1 addition & 0 deletions public/images/trustly.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 86 additions & 25 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, syde, l.vangunst, ndij
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
Stable tag: 7.5.5
Requires PHP: 7.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -12,73 +12,108 @@ Accept all major payment methods in WooCommerce today. Credit cards, iDEAL and m

== Description ==

https://www.youtube.com/watch?v=yslqbm2FPFg
https://www.youtube.com/watch?v=33sQNKelKW4

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.
Quickly integrate all major payment methods in WooCommerce, wherever you need them. Mollie Payments for WooCommerce adds the critical success factor: an easy-to-install, easy-to-use, customizable payments gateway that is as flexible as WooCommerce itself.

> Next level payments, for WooCommerce
> **Effortless payments for your customers, designed for growth**

No need to spend weeks on paperwork or security compliance procedures. No more lost conversions because you don’t support a shoppers favorite payment method or because they don’t feel safe. We made payments intuitive and safe for merchants and their customers.
No need to spend weeks on paperwork or security compliance procedures. Enjoy enhanced conversions as we support shopper's favorite payment methods and ensure their utmost safety. We made payments intuitive and safe for merchants and their customers.

= PAYMENT METHODS =
= Payment methods =

Credit cards:
Credit & Debit 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)
* Bancomat Pay (Italy)
* Blik (Poland)
* Przelewy24 (Poland)
* Giropay (Germany)
* EPS (Austria)
* Przelewy24 (Poland)
* SOFORT banking (EU)
* 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)
* Klarna Pay now (Netherlands, Belgium, Germany, Austria, Finland)
* Klarna One (UK)
* Vouchers (Netherlands, Belgium)
* TWINT (Switzerland)

International payment methods:

* Apple Pay (International)
* PayPal (International)
* Paysafecard (International)

Pay after delivery payment methods:

* Klarna Pay later (Netherlands, Germany, Austria, Finland)
* Klarna Pay later (Netherlands, Belgium, Germany, Austria, Finland)
* Klarna Slice it (Germany, Austria, Finland)
* Billie - Pay by Invoice for Businesses
* iDEAL in3 - Pay in 3 installments, 0% interest


= Get started with Mollie =

1. [Create a Mollie account](https://my.mollie.com/dashboard/signup)
2. Install **Mollie Payments for WooCommerce** on your WordPress website
3. Activate Mollie in your WooCommerce webshop and enter your Mollie API key
4. In your Mollie Dashboard, go to Settings > Website profiles and select the payment methods you want to offer
5. Go to your WordPress Admin Panel. Open WooCommerce > Settings > Payments to check if your preferred methods are enabled

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 [email protected] if you have any questions or comments about this plugin.
Once your Mollie account has been approved, you can start accepting payments.

> Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period.
> **Our pricing is always per transaction. No startup fees, no monthly fees, and no gateway fees. No hidden fees, period.**

= FEATURES =
= 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+)
* Support for full and partial payment refunds
* 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
* [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, French, Italian, Spanish
* Event log for debugging purposes
* WordPress Multisite support
* WPML support
* Works well with multilingual plugins like WPML/Polylang

Contact [email protected] if you have any questions or comments about this plugin.

= Join the Mollie Community =

Become part of Mollie's growing community and gain access to our comprehensive support network, including a [Discord Developer Community](https://discord.gg/y2rbjqszbs) to stay connected and informed.

> **Your success is our mission. With Mollie, simplify your payments and focus on growing your business.**

[Sign up today](https://my.mollie.com/dashboard/signup) and start enhancing your WooCommerce store with Mollie's advanced payment solutions.

= More about Mollie =

Since 2004, Mollie has been on a mission to help businesses drive growth through simplified payments and financial services.

Initially observing banks offering businesses outdated technology and complex processes, Mollie decided to innovate. Striving to improve conditions by acting fairly and being a true partner to customers on their journey to success has always been a priority.

Over the years, Mollie has expanded significantly, yet the core mission remains unchanged: to address and solve customer problems to facilitate their growth.

Mollie champions the belief that simplicity leads to the best solutions and designs products to serve everyone: from solopreneurs and startups to global enterprises. This approach ensures every customer has access to the necessary tools for success.

Today, Mollie powers growth for over 130,000 businesses with effortless online payments, money management tools, and flexible funding, continuously enhancing payment and financial services for a broad spectrum of clients including global brands, SMEs, marketplaces, SaaS platforms, and more.

== Frequently Asked Questions ==

Expand Down Expand Up @@ -114,8 +149,8 @@ You can either download and use the incomplete translations or help us get the t
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" 
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.

Expand Down Expand Up @@ -183,8 +218,34 @@ Please contact [email protected] if you need help installing the Mollie WooCommerc

Automatic updates should work like a charm; as always though, ensure you backup your site just in case.


== Changelog ==

= 7.5.5 - 18-06-2024 =

* Feature Flag - Enable Bancomat Pay & Alma feature flag by default (official launch 2024-07-01)
* Task - update wordpress.org plugin page
* Fix - Change from iDeal 1.0 to iDeal 2.0
* Fix - update apple-developer-merchantid-domain-association certificate
* Fix - Description not shown on block checkout
* Fix - All Gift Card issuers displayed despite only some being active
* Fix - Several Undefined array key warnings malform JSON requests on Block Checkout
* Fix - Surcharge string to ‘excl. VAT’

= 7.5.4 - 03-06-2024 =

* Feature Flag - Initiative - Alma for WooCommerce Integration - under flag add_filter('inpsyde.feature-flags.mollie-woocommerce.alma_enabled', false);
* Feature - Add WooCommerce as required plugin in header
* Fix - Display error for Apple Pay Validation Error in Woocommerce
* Fix - TypeError when WooCommerce Analytics is disabled
* Fix - In3 - payment successful with date in the future
* Fix - Ensure Smooth Order Processing Despite Rounding Differences
* FIx - Rebrand from Inpsyde to Syde

= 7.5.3 - 22-05-2024 =

* Fix - Updated in3 checkout process: Phone and birthdate are now optional, but if provided, validated values will be sent to expedite checkout.

= 7.5.2 - 22-04-2024 =

* Feature - Support for new payment method Bancomat Pay (beta)
Expand Down
5 changes: 5 additions & 0 deletions src/MerchantCapture/Capture/Action/CapturePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class CapturePayment extends AbstractPaymentCaptureAction
public function __invoke()
{
try {
$payment = $this->order->get_payment_method();
if (strpos($payment, 'mollie') === false) {
return;
}

$paymentId = $this->order->get_meta('_mollie_payment_id');

if (!$paymentId) {
Expand Down
4 changes: 2 additions & 2 deletions src/Payment/MollieObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ protected function setOrderPaidAndProcessed(WC_Order $order)
protected function isOrderPaymentStartedByOtherGateway(WC_Order $order)
{
// Get the current payment method id for the order
$payment_method_id = $order->get_meta('_payment_method', true);
$payment_method_id = $order->get_payment_method();
// If the current payment method id for the order is not Mollie, return true
return strpos($payment_method_id, 'mollie') === false;
}
Expand Down Expand Up @@ -1079,7 +1079,7 @@ protected function getFormatedPhoneNumber(string $phone)
$phone = transformPhoneToNLFormat($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)) {
if (is_string($phone) && preg_match('/^\+[1-9]\d{10,13}$|^[1-9]\d{9,13}$/', $phone)) {
return $phone;
}
return null;
Expand Down
36 changes: 36 additions & 0 deletions src/Payment/OrderLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,48 @@ public function order_lines($order, $voucherDefaultCategory)
$this->process_shipping();
$this->process_fees();
$this->process_gift_cards();
$this->process_missmatch();

return [
'lines' => $this->get_order_lines(),
];
}

private function process_missmatch()
{
$orderTotal = (float) $this->order->get_total();
$orderTotalRounded = round($orderTotal, 2);
$linesTotal = array_sum(array_map(function ($line) {
return $line['totalAmount']['value'];
}, $this->order_lines));
$orderTotalDiff = $orderTotalRounded - $linesTotal;
if (abs($orderTotalDiff) > 0) {
$missmatch = [
'type' => 'surcharge',
'name' => __('Rounding difference', 'mollie-payments-for-woocommerce'),
'quantity' => 1,
'vatRate' => 0,
'unitPrice' => [
'currency' => $this->currency,
'value' => $this->dataHelper->formatCurrencyValue($orderTotalDiff, $this->currency),
],
'totalAmount' => [
'currency' => $this->currency,
'value' => $this->dataHelper->formatCurrencyValue($orderTotalDiff, $this->currency),
],
'vatAmount' => [
'currency' => $this->currency,
'value' => $this->dataHelper->formatCurrencyValue(0, $this->currency),
],
'metadata' => [
'order_item_id' => 'rounding_diff',
],
];

$this->order_lines[] = $missmatch;
}
}

/**
* Get order lines formatted for Mollie Orders API.
*
Expand Down
20 changes: 19 additions & 1 deletion src/PaymentMethods/Giropay.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@ protected function getConfig(): array

public function getFormFields($generalFormFields): array
{
return $generalFormFields;
$notice = [
'notice' => [
'title' =>
sprintf(
__(
'%1$s Paydirekt, the owner of Giropay, has decided to deprecate Giropay. On Monday, 24 June 2024, Mollie was informed that Giropay would cease onboarding new merchants and processing new payments after 30 June 2024. No action is needed from your side. Mollie will automatically remove Giropay as a payment option from your Checkout by 30 June.
Subscription renewals and refunds will continue to be processed as usual beyond June 30. More details can be found in the %2$s Giropay Deprecation FAQ. %3$s',
'mollie-payments-for-woocommerce'
),
'<p>',
'<a href="https://help.mollie.com/hc/en-us/articles/19745480480786-Giropay-Depreciation-FAQ" target="_blank">',
'</a></p>'
),
'type' => 'title',
'class' => 'notice notice-warning',
'css' => 'padding:20px;',
],
];
return array_merge($notice, $generalFormFields);
}
}
32 changes: 32 additions & 0 deletions src/PaymentMethods/Trustly.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Mollie\WooCommerce\PaymentMethods;

class Trustly extends AbstractPaymentMethod implements PaymentMethodI
{
protected function getConfig(): array
{
return [
'id' => 'trustly',
'defaultTitle' => __('Trustly', 'mollie-payments-for-woocommerce'),
'settingsDescription' => '',
'defaultDescription' => '',
'paymentFields' => false,
'instructions' => true,
'supports' => [
'products',
'refunds',
],
'filtersOnBuild' => false,
'confirmationDelayed' => true,
'SEPA' => false,
];
}

public function getFormFields($generalFormFields): array
{
return $generalFormFields;
}
}
1 change: 1 addition & 0 deletions src/Shared/SharedDataDictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class SharedDataDictionary
'Mollie_WC_Gateway_Twint',
'Mollie_WC_Gateway_Bancomatpay',
'Mollie_WC_Gateway_Alma',
'Mollie_WC_Gateway_Trustly',
];

public const MOLLIE_OPTIONS_NAMES = [
Expand Down
Loading

0 comments on commit 2756123

Please sign in to comment.