paygreen/sylius-paygreen-plugin

Paygreen plugin for Sylius.

Installs: 4 218

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 4

Forks: 2

Open Issues: 0

Type:sylius-plugin

1.2.2 2022-07-18 15:31 UTC

This package is auto-updated.

Last update: 2024-11-18 20:40:42 UTC


README

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