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
Requires
- php: ^7.3 || ^8.0
- ext-json: *
- nyholm/psr7: ^1.4
- paygreen/paygreen-php: ^1.1
- sylius/sylius: ~1.8 || ~1.9 || ~1.10
- symfony/http-client: ^5.4
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- friendsofsymfony/oauth-server-bundle: ^1.6 || >2.0.0-alpha.0 ^2.0@dev
- overtrue/phplint: ^2.0
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: 0.12.85
- phpstan/phpstan-doctrine: 0.12.33
- phpstan/phpstan-strict-rules: ^0.12.0
- phpstan/phpstan-webmozart-assert: 0.12.12
- phpunit/phpunit: ^9.5
- sensiolabs/security-checker: ^6.0
- sylius-labs/coding-standard: ^4.0
- sylius/admin-api-bundle: ^1.10
- symfony/browser-kit: ^4.4 || ^5.2
- symfony/debug-bundle: ^4.4 || ^5.2
- symfony/dotenv: ^4.4 || ^5.2
- symfony/intl: ^4.4 || ^5.2
- symfony/monolog-bundle: ^3.7
- symfony/web-profiler-bundle: ^4.4 || ^5.2
- vimeo/psalm: 4.7.1
README
Sylius payment module with Paygreen
Installation
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/
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
- 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?
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