PayPlug payment plugin for Sylius applications.
This plugin allows you to integrate PayPlug payment with Sylius platform app including payment features and refunding orders.
In the channel settings, the base currency must be set to EUR because the payment gateway only works in this currency.
In local environment, the plugin will not work properly because you will not be notified of the status of payments from the payment gateway.
You need to make some adjustments in order to make our plugin worked normally due to a dependency to refund-plugin. Please follow those requirements:
- To generate "Credit memos" when refunding, your server need to have the WKHTMLTOPDF binary as explain in refund-pluging documentation # Pre-requirements
- To use proper traits and interfaces, apply changes as explain in refund-plugin documentation # Installation - Step 4
If you don't use symfony/messenger component yet, it is required to configure one of the message buses as a default bus in file
framework: messenger: default_bus: sylius_refund_plugin.command_bus
As this plugin has a dependency to sylius/refund-plugin which does not yet have a stable release, configure your project to accept release candidate version.
composer config minimum-stability rc composer config prefer-stable true
Require the payplug/sylius-payplug-plugin :
composer config extra.symfony.allow-contrib true composer require payplug/sylius-payplug-plugin
Apply migrations to your database:
Copy templates that are overridden by Sylius into
mkdir -p templates/bundles/SyliusAdminBundle/ cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
Add PayPlug to refundable payment method for Sylius Refund Plugin in
parameters: sylius_refund.supported_gateways: - payplug - payplug_oney
Add PayPlug routes in
sylius_payplug: resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/routing.yaml"
php bin/console translation:update en PayPlugSyliusPayPlugPlugin --dump-messages php bin/console translation:update fr PayPlugSyliusPayPlugPlugin --dump-messages
php bin/console cache:clear
🎉 You are now ready to add Payplug Payment method.
In your back-office, go to
Configuration > Payment methods, then click on
Create and choose "PayPlug".
If you want to follow the logs in the production environment, you need to add the configuration in
config/packages/prod/monolog.yaml, logs should be in
var/log/prod.log which can be searched after the phrase
monolog: handlers: ... payum: level: debug type: stream path: "%kernel.logs_dir%/%kernel.environment%.log"
Run the below command to see what Symfony services are shared with this plugin:
$ bin/console debug:container payplug_sylius_payplug_plugin
This plugin override some sylius templates. If you plan override them also, you should retrieve them in your application.
Copy Sylius templates overridden in plugin to your templates directory (e.g templates/bundles/)
mkdir -p templates/bundles/SyliusAdminBundle/ mkdir -p templates/bundles/SyliusShopBundle/ cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/SyliusShopBundle/* templates/bundles/SyliusShopBundle/ ``` ## Testing ```bash $ composer install $ cd tests/Application $ yarn install $ yarn build $ bin/console assets:install public -e test $ bin/console doctrine:database:create -e test $ bin/console doctrine:schema:create -e test $ bin/console server:run 127.0.0.1:8080 -d public -e test $ open http://localhost:8080 $ bin/behat $ bin/phpspec run
This library is under the MIT license.
For better Oney integration, you can check the Oney enhancement documentation.