Paygreen plugin for Sylius.

1.1.4 2021-12-23 14:51 UTC

This package is auto-updated.

Last update: 2021-12-23 15:25:09 UTC


paygreen logo

sylius logo

Sylius payment module with Paygreen


Require the plugin :

composer require paygreen/sylius-paygreen-plugin
  1. Your ProductVariant entity needs to implement de MealVoucherAwareInterface and use the MealVoucherAwareTrait.
  2. Your Order entity needs to implement de MealVoucherableInterface and use the MealVoucherableTrait.
  3. You need to run a diff of your doctrine's migrations: bin/console doctrine:migrations:diff. Don't forget to run it! (bin/console doctrine:migrations:migrate)
  4. Copy the template (we update the Product and ProductVariant forms):
    mkdir -p templates/bundles/SyliusAdminBundle
    cp -Rv vendor/paygreen/sylius-paygreen-plugin/src/Resources/views/SyliusAdminBundle/ templates/bundles/


Gateway configuration

The module configuration is located in the Payment method section of the admin panel.

Connect your Paygreen account to the module with your public key and your private key.

You will have to select Bank card or Meal Voucher according to your needs.

In the .env file, you have to configure the PAYGREEN_URL_API (production or sandbox) depending on your customer account.





$ composer install
$ (cd tests/Application && yarn install)
$ (cd tests/Application && yarn build)
$ (cd tests/Application && APP_ENV=test bin/console assets:install public)

$ (cd tests/Application && APP_ENV=test bin/console doctrine:database:create)
$ (cd tests/Application && APP_ENV=test bin/console doctrine:schema:create)
$ (cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load)

To be able to setup a plugin's database, remember to configure you database credentials in tests/Application/.env and tests/Application/.env.test.

Start local server

$ (cd tests/Application && APP_ENV=test php -S localhost:8080 -t public)

Running plugin tests

  • PHPSpec

    $ composer phpspec
  • Behat

    $ composer behat
  • All tests (phpspec & behat)

    $ composer test