Skip to content

PayGreen/sylius-paygreen-plugin

Repository files navigation

paygreen logo

sylius logo

Sylius payment module with Paygreen

Installation

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/
    

Configuration

Gateway configuration

Connect your Paygreen account with your public key and your private key.

To activate the in site payment interface, the In Site module must be activated via your PayGreen back office. Moreover, you must be in HTTPS.

In the .env file, you have to configure the PAYGREEN_API_SERVER (PRODUCTION or SANDBOX) depending on your customer account.

PAYGREEN_API_SERVER=PRODUCTION

Cookbook

Contribution

Installation:

$ 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