Sylius payment module with Paygreen
Require the plugin :
composer require paygreen/sylius-paygreen-plugin
- Your
ProductVariant
entity needs to implement deMealVoucherAwareInterface
and use theMealVoucherAwareTrait
. - Your
Order
entity needs to implement deMealVoucherableInterface
and use theMealVoucherableTrait
. - 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
) - 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/
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
- How to display the amount payable in meal voucher in cart?
- How to display if the product is payable in meal voucher or not?
- How to make delivery payable via meal voucher?
- How to hide the meal ticket payment if it is not available for this cart?
- How to customize "insite" display mode template?
$ 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
.
$ (cd tests/Application && APP_ENV=test php -S localhost:8080 -t public)
-
PHPSpec
$ composer phpspec
-
Behat
$ composer behat
-
All tests (phpspec & behat)
$ composer test