pledg / sylius-payment-plugin
Payment Gateway Plugin using PledgBySofinco (Sylius 2.x)
Package info
github.com/pledgcorporate/ecard-sylius
Type:sylius-plugin
pkg:composer/pledg/sylius-payment-plugin
Requires
- php: ^8.2
- sylius/sylius: ^1.14 || ^2.0
- winzou/state-machine-bundle: ^0.6.4
Requires (Dev)
- behat/behat: ^3.14
- dmore/behat-chrome-extension: ^1.4
- 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
- lchrusciel/api-test-case: ^5.0
- nelmio/alice: ^3.10
- nyholm/psr7: ^1.8
- phpstan/phpstan-doctrine: ^1.5
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^10.5
- robertfausk/behat-panther-extension: ^1.1
- sylius-labs/coding-standard: ^4.4
- sylius-labs/suite-tags-extension: ~0.2
- sylius/sylius-rector: ^2.0
- sylius/test-application: ^2.0.0@alpha
- symfony/browser-kit: ^6.4 || ^7.1
- symfony/debug-bundle: ^6.4 || ^7.1
- symfony/dotenv: ^6.4 || ^7.1
- symfony/http-client: ^6.4 || ^7.1
- symfony/intl: ^6.4 || ^7.1
- symfony/web-profiler-bundle: ^6.4 || ^7.1
- symfony/webpack-encore-bundle: ^2.1
- dev-main
- 3.0.0
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- dev-debug-weelova
- dev-dependabot/npm_and_yarn/tests/Application/fast-uri-3.1.2
- dev-dependabot/npm_and_yarn/tests/Application/follow-redirects-1.16.0
- dev-dependabot/npm_and_yarn/tests/Application/lodash-4.18.1
- dev-dependabot/npm_and_yarn/tests/Application/svgo-2.8.2
- dev-dependabot/npm_and_yarn/tests/Application/node-forge-1.4.0
- dev-dependabot/npm_and_yarn/tests/Application/picomatch-2.3.2
- dev-dependabot/npm_and_yarn/tests/Application/flatted-3.4.2
- dev-dependabot/npm_and_yarn/tests/Application/immutable-5.1.5
- dev-upgrade-sylius-2.2
This package is auto-updated.
Last update: 2026-06-10 17:51:07 UTC
README
Installation
- Install the package (beware of which version of our plugin supports your version of Sylius)
composer require pledg/sylius-payment-plugin
- Import routes in one of your routing file or create a new one (like
config/routes/pledg_sylius_payment.yaml)
pledg_sylius_payment: resource: "@PledgSyliusPaymentPlugin/Resources/config/routing.yml" prefix: /pledg
- Clear your cache in order to see translations
bin/console c:c
Create your payment method
Now you can use the plugin and create your first Pledg Payment method :
-
Select the PledgBySofinco Type
-
Fill all required fields (specially with your merchant id, secret and restricted countries). Don't forget to activate the method on your channel.
Pledg allows to use a payment method without a signature but the plugin does not allow it. So even in sandbox mode, the secret is required and exchanges will be signed.
How the plugin works ?
We use Payum and the Sylius payment workflow in order to redirect on the Pledg payment page. Pledg uses all the parameters already filled in order to avoid you to refill them again. If all mandatory parameters are filled, you just need to fill your banking information. Otherwise, you could potentially fill in your address and your phone number.
All parameters in this url are in a signature parameter corresponding to a JSON Web Token encoding with the HS256 algorithm.
The plugin reuses Payum in order to retrieve the result of the payment process.
We also have a webhook route for 2 types of Pledg notifications (Standard and Transfer mode). This 2 types are also signed : the first with a custom signature and the second with a JWT.
All the details (parameters, redirection url, pledg result, pledg errors, pledg notifications) are stored in the payment entity.
How to contribute ?
You just have to :
- Retrieve the package
- Launch
make env && make create-projectto create a new Sylius project - Launch
make installto install the database - Launch
make deploy_pledg_pluginto install the plugin in the container - Make a PR and check if the CI is green. Do not forget to upgrade the version number in the CHANGELOG.md and in the Pledg\SyliusPaymentPlugin\RedirectUrl\ParamBuilder.php file.
The plugin does not (yet) use behat. To compensate this, we wrote unit tests with PHPUnit in a classical way.