payplug / sylius-payplug-plugin
PayPlug payment plugin for Sylius applications.
Installs: 2 839
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 10
Forks: 10
Open Issues: 1
Type:sylius-plugin
Requires
- php: ^7.3
- giggsey/libphonenumber-for-php: ^8.12
- payplug/payplug-php: ^3.1
- sylius/refund-plugin: ^1.0.0-RC.5
- sylius/sylius: ^1.8.0
- symfony/contracts: ^1.1|^2.0
Requires (Dev)
- behat/behat: ^3.4
- behat/mink: ^1.7@dev
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.2
- behat/mink-selenium2-driver: ^1.3
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.0
- friends-of-behat/variadic-extension: ^1.1
- lakion/mink-debug-extension: ^1.2.3
- phpmd/phpmd: ^2.8
- phpspec/phpspec: ^6.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.1
- phpstan/phpstan-doctrine: ^0.12.1
- phpstan/phpstan-strict-rules: ^0.12.1
- phpstan/phpstan-webmozart-assert: ^0.12.1
- phpunit/phpunit: ^6.5
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^3.1
- symfony/browser-kit: ^3.4||^4.3
- symfony/debug-bundle: ^3.4||^4.3
- symfony/dotenv: ^3.4||^4.3
- symfony/intl: ^3.4||^4.3
- symfony/lock: ^3.4||^4.3
- symfony/web-profiler-bundle: ^3.4||^4.3
- symfony/web-server-bundle: ^3.4||^4.3
This package is auto-updated.
Last update: 2021-04-13 16:27:03 UTC
README
PayPlug payment plugin for Sylius
This plugin allows you to integrate PayPlug payment with Sylius platform app including payment features and refunding orders.
Requirements
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.
⚠️ To generate "Credit memos" when refunding, your server need to have the WKHTMLTOPDF binary ⚠️
More info in refund-plugin documentation.
❗️Known issues about refund-plugin❗️
- #234 - [UI/UX] Refund float price : Decimals seperated by comma are taken into account.
Installation
-
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
config/packages/framework.yaml
: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
-
Import custom form row theme in your
config/packages/twig.yaml
file:twig: ... form_themes: [ 'form/form_gateway_config_row.html.twig' ]
-
Copy custom form row theme template
mkdir -p templates/form/ cp -R vendor/payplug/sylius-payplug-plugin/src/Resources/views/form/* templates/form/
-
Copy and apply migrations
Update
config/packages/doctrine_migrations.yaml
by adding following configdoctrine_migrations: migrations_paths: ... 'DoctrineMigrations': "%kernel.project_dir%/src/Migrations"
Copy migrations from
vendor/payplug/sylius-payplug-plugin/src/Migrations/
to your migrations directory (e.g.src/Migrations
) and apply them to your databasecp -R vendor/payplug/sylius-payplug-plugin/src/Migrations/* src/Migrations bin/console doctrine:migrations:migrate
-
Copy templates that are overridden by Sylius into
templates/bundles/SyliusAdminBundle
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
config/services.yaml
parameters: sylius_refund.supported_gateways: - payplug
-
Process translations
php bin/console translation:update en PayPlugSyliusPayPlugPlugin --dump-messages php bin/console translation:update fr PayPlugSyliusPayPlugPlugin --dump-messages
-
Clear cache:
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".
Logs
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 [Payum]
or [PayPlug]
:
monolog: handlers: ... payum: level: debug type: stream path: "%kernel.logs_dir%/%kernel.environment%.log"
Customization
Available services you can decorate and forms you can extend
Run the below command to see what Symfony services are shared with this plugin:
$ bin/console debug:container payplug_sylius_payplug_plugin
Testing
$ 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
License
This library is under the MIT license.