en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en pt en en de en en en en en en en en en en en en en en en en de it en en hy ru ru en en en en de en de en de en de de ja fr fr fr fr fr fr fr fr fr sv en en en en en en en en en en en en en en en vi en en en en en en en en ru en en en en en en en en en en en en en en en en en en en en en id en en en
Clear your cache in order to see translations
Now you can use the plugin and create your first Pledg Payment method :
Select the Pledg 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 allow 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.
mkdir -p templates/bundles/SyliusAdminBundle/ mkdir -p templates/bundles/SyliusShopBundle/ cp -R vendor/pledg/sylius-payment-plugin/tests/Application/templates/bundles/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/ cp -R vendor/pledg/sylius-payment-plugin/tests/Application/templates/bundles/SyliusShopBundle/* templates/bundles/SyliusShopBundle/
Add state machine configuration
Import the configuration in _sylius.yaml or your pledg_sylius_payment_plugin.yaml file :
imports: - { resource: "@PledgSyliusPaymentPlugin/Resources/config/state_machine.yaml" }
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 :
Launch make up in order to install the plugin in a dockerized environment with a test application
Launch make ci if you want to check if everything works fine
Make a PR and check if the CI is green.
The plugin does not (yet) use behat. To compensate this, we wrote unit tests with PHPUnit in a classical way.