Skip to content

FlorentinGarnier/payplug-sylius

 
 

Repository files navigation

Overview

This plugin allows you to integrate PayPlug payment with Sylius platform app.

Installation

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>"
        }
    ]
}
  1. Require plugin with composer:

    composer require payplug/payplug-sylius
  2. Import configuration in your config/packages/_sylius.yaml file:

    imports:
        - { resource: "@PayPlugSyliusPayPlugPlugin/Resources/config/config.yml" }
  3. Add plugin class to your config/bundles.php file:

    $bundles = [
        PayPlug\SyliusPayPlugPlugin\PayPlugSyliusPayPlugPlugin::class => ['all' => true],
    ];
  4. Clear cache:

    bin/console cache:clear

Requirements

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

Cron job

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

Logs

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"

IPN testing on the local machine

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.

Customization

Available services you can decorate and forms you can extend

Run the below command to see what Symfony services are shared with this plugin:

$ bin/console debug:container payplug_sylius_payplug_plugin

Testing

$ 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

Contribution

Learn more about our contribution workflow on http://docs.sylius.org/en/latest/contributing/.

About

PayPlug plugin for Sylius

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 89.6%
  • Gherkin 7.0%
  • JavaScript 3.4%