sylius / mollie-plugin
Mollie payment plugin for Sylius applications.
Fund package maintenance!
sylius
Installs: 1 029
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 10
Forks: 8
Open Issues: 4
Type:sylius-plugin
Requires
- php: ^8.2
- mollie/mollie-api-php: ^2.73
- sylius/sylius: ^2.0.8
- willdurand/js-translation-bundle: ^7.0
Requires (Dev)
- behat/behat: ^3.7
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- lchrusciel/api-test-case: ^5.2
- matthiasnoback/symfony-dependency-injection-test: ^5.1
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-doctrine: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- phpstan/phpstan-symfony: ^1.0
- phpstan/phpstan-webmozart-assert: ^1.0
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- sylius-labs/coding-standard: ^4.0
- sylius/test-application: ^2.0.0@alpha
- symfony/browser-kit: ^6.4 || ^7.1
- symfony/debug-bundle: ^6.4 || ^7.1
- symfony/dotenv: ^6.4 || ^7.1
- symfony/flex: ^2.0
- symfony/intl: ^6.4 || ^7.1
- symfony/web-profiler-bundle: ^6.4 || ^7.1
- symfony/webpack-encore-bundle: ^2.2
- winzou/state-machine: ^0.4
- winzou/state-machine-bundle: ^0.6
Suggests
- sylius/refund-plugin: To allow refunding payments in the Mollie payment method.
This package is auto-updated.
Last update: 2025-06-07 02:34:52 UTC
README
Mollie Payments Plugin
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.
Table of Contents
Overview
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.
Installation
Beware!
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!
1. Require Mollie plugin with composer:
composer require sylius/mollie-plugin:^3.0 --no-scripts -W
2. Add the Mollie rector set:
# <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
3. Update your database
bin/console doctrine:migrations:migrate
4. Install frontend assets:
bin/console assets:install
Install additional dependencies:
yarn add bazinga-translator intl-messageformat lodash.get shepherd.js@11.0
Build assets:
yarn encore dev # for development yarn encore production # for production
5. Clear cache:
php bin/console cache:clear
Optional and troubleshooting
-
[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
⚠️ SyliusRefundPlugin Troubleshooting
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
Sylius API
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
Usage
During configuration, first save the keys to the database and then click "Load methods".
Security issues
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 security@sylius.com
Community
For online communication, we invite you to chat with us & other users on Sylius Slack.