This plugin allows you to integrate PayPlug payment with Sylius platform app.
Add a package to your private repository and add the repository to composer.json
:
{
"minimum-stability": "dev",
"repositories": [
{
"type": "vcs",
"url": "<your URL to private repository>"
}
]
}
-
Require plugin with composer:
composer require payplug/payplug-sylius
-
Import configuration in your
config/packages/_sylius.yaml
file:imports: - { resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/config.yml" }
-
Add plugin class to your
config/bundles.php
file:$bundles = [ PayPlug\SyliusPayPlugPlugin\PayPlugSyliusPayPlugPlugin::class => ['all' => true], ];
-
Clear cache:
bin/console cache:clear
In the channel settings, the base currency must be set to EUR because the payment gateway only works in this currency. The plugin in the local environment will not work properly because you will not be notified of the status of payments from the payment gateway
In the case when the IPN is blocked, you can set cron job every minute that updates the payment status.
For example:
* * * * * bin/console payplug:update-payment-state
If you want to follow the logs in the production environment, you need to add the configuration in config/packages/prod/monolog.yaml
, logs should be in var/log/prod.log
which can be searched after the phrase [Payum]
or [PayPlug]
:
monolog:
handlers:
...
payum:
level: debug
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
In the configuration of the payment gateway in the admin panel, set your url (eg from ngrok) to notifications in the field Notification url for environment dev
. This url will only work in the dev environment.
Run the below command to see what Symfony services are shared with this plugin:
$ bin/console debug:container payplug_sylius_payplug_plugin
$ composer install
$ cd tests/Application
$ yarn install
$ yarn run gulp
$ bin/console assets:install web -e test
$ bin/console doctrine:database:create -e test
$ bin/console doctrine:schema:create -e test
$ bin/console server:run 127.0.0.1:8080 -d web -e test
$ open http://localhost:8080
$ bin/behat
$ bin/phpspec run
Learn more about our contribution workflow on http://docs.sylius.org/en/latest/contributing/.