This plugin provides seamless Mollie integration for Sylius stores.
Accept payments through over 20 different methods with Mollie – trusted by over 70,000 businesses in Europe.
Mollie is one of the most advanced and developer-friendly payment gateways in Europe. This plugin integrates Mollie into Sylius and is officially certified by Mollie.
Our mission is to create a greater playing field for everyone. By offering convenient, safe world-wide payment solutions we remove barriers so you could focus on growing your business.
Mollie provides a powerful API allowing webshop and app developers to implement over 20 payment methods with ease. Their services are fast, reliable, and constantly innovating the European payments landscape.
This installation instruction assumes that you're using Symfony Flex and Rector. If you don't, take a look at the legacy installation instruction. However, we strongly encourage you to use them, it's much quicker!
composer require sylius/mollie-plugin:^3.0 --no-scripts -W
# <project_root>/rector.php
...
+ use Sylius\SyliusRector\Set\SyliusMollie;
return static function (RectorConfig $rectorConfig): void {
...
+ $rectorConfig->sets([SyliusMollie::MOLLIE_PLUGIN_30]);
};
and run it:
vendor/bin/rector
bin/console doctrine:migrations:migrate
bin/console assets:install
Install additional dependencies:
yarn add bazinga-translator intl-messageformat lodash.get [email protected]
Build assets:
yarn encore dev # for development
yarn encore production # for production
php bin/console cache:clear
-
[Optional] To allow refunding orders add the RefundPlugin:
composer require sylius/refund-plugin:^2.0.2 --no-scripts -W
And follow its installation instructions.
-
[Optional] Load fixtures:
bin/console sylius:fixtures:load
-
[Optional] Add the payment link cronjob:
* * * * * /usr/bin/php /path/to/bin/console mollie:send-payment-link
-
[Optional] If you want to use ApplePay, you need to add the domain validation file file to your server at:
public/.well-known/apple-developer-merchantid-domain-association
If you encounter an error related to duplicate transitions in the sylius_refund_refund_payment
state machine (e.g. multiple "complete"
transitions from "new"
state),
you should remove the following file from your project:
config/packages/sylius_refund.yaml
You should remove it if your project does not use Symfony Workflow
In order to create Mollie payment with Sylius API, the following steps must be followed:
- send the following request to the Sylius API in order to retrieve Mollie payment method configuration: /api/v2/shop/orders/{tokenValue}/payments/{paymentId}/configuration
- tokenValue represents order token which is saved in the sylius_order DB table
- response from this endpoint should be in the following format:
{
"method": "ideal",
"issuer": "ideal_ABNANL2A",
"cardToken": null,
"amount": {"value":"18.75","currency":"EUR"},
"customerId": null,
"description": "000000157",
"redirectUrl": "{redirect_url}",
"webhookUrl": "{webhook_url}",
"metadata": {"order_id":170,"customer_id":22,"molliePaymentMethods":"ideal","cartToken":null,"saveCardInfo":null,"useSavedCards":null,"selected_issuer":"ideal_ABNANL2A","methodType":"Payments API","refund_token":"{token}"},
"locale": "en_US"
}
-
create the payment on Mollie, using Mollie API. Response from the above-mentioned step should be put in the request body. Request should be sent to the POST: https://api.mollie.com/v2/payments. Bearer token should be sent in the request authorization header. Token can be copied from the Mollie admin configuration page.
-
after payment has been created, API response will contain checkout field. User should enter this url in the browser.
{
"checkout":
{
"href": "https://www.mollie.com/checkout/test-mode?method=ideal&token=6.voklib",
"type": "text/html"
}}
- open checkout url in the browser and complete the payment
During configuration, first save the keys to the database and then click "Load methods".
If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
Instead, all security issues must be sent to [email protected]
For online communication, we invite you to chat with us & other users on Sylius Slack.