The SyliusNexiPlugin provides an integration between Sylius and Nexi XPay payment gateway. This plugin implements the Hosted Payment Page integration method.
Note! This plugin is only compatible with the Nexi configuration which allows only one payment per request. It is therefore not possible to retry the payment several times on the Nexi checkout, so make sure that your Nexi gateway is configured to not allow payment retry (you'll have to ask to Nexi customer care for this)!
-
Run
composer require webgriffe/sylius-nexi-plugin
-
Add
Webgriffe\SyliusNexiPlugin\WebgriffeSyliusNexiPlugin::class => ['all' => true]
to yourconfig/bundles.php
. -
(Optional) It's suggested to also install the Payum Lock Request Extension Bundle:
composer require webgriffe/payum-lock-request-extension-bundle
and add
Webgriffe\PayumLockRequestExtensionBundle\WebgriffePayumLockRequestExtensionBundle::class => ['all' => true]
to yourconfig/bundles.php
. This Payum extension avoids issues when concurrent requests are made by the buyer and the Nexi gateway for the same payment.
Go in your Sylius admin panel and create a new payment method. Choose Nexi Gateway
as the payment gateway and fill the required fields.
You can also enable the Sandbox mode if you want to test the integration with the Nexi test environment.
-
PHPUnit
vendor/bin/phpunit
-
PHPSpec
vendor/bin/phpspec run
-
Behat (non-JS scenarios)
vendor/bin/behat --strict --tags="~@javascript"
-
Behat (JS scenarios)
-
Start Headless Chrome:
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
- Install SSL certificates (only once needed) and run test application's webserver on
127.0.0.1:8080
:
symfony server:ca:install APP_ENV=test symfony server:start --port=8080 --dir=tests/Application/public --daemon
- Run Behat:
vendor/bin/behat --strict --tags="@javascript"
-
Static Analysis
-
Psalm
vendor/bin/psalm
-
PHPStan
vendor/bin/phpstan analyse -c phpstan.neon -l max src/
-
-
Coding Standard
vendor/bin/ecs check src
-
Using
test
environment:(cd tests/Application && APP_ENV=test bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=test bin/console server:run -d public)
-
Using
dev
environment:(cd tests/Application && APP_ENV=dev bin/console sylius:fixtures:load) (cd tests/Application && APP_ENV=dev bin/console server:run -d public)
This plugin is under the MIT license. See the complete license in the LICENSE file.
Developed by Webgriffe®.