Installation

Supported Version: This assumes you're using Symfony Flex and Sylius Rector. If you're on a legacy setup without them, refer to the manual installation instead.

1. Prepare Your Environment

Before installing the plugin, ensure that your project:

  • Uses Symfony Flex

  • Runs Sylius ^2.0 version

  • Has yarn and Symfony Encore correctly configured

2. Allow Symfony Contrib Recipes

To allow Symfony to install community recipes:

composer config extra.symfony.allow-contrib true

If prompted during plugin installation, accept the community recipe when asked.

3. Install the Plugin via Composer

composer require sylius/adyen-plugin:"^2.0@alpha"

This will install the plugin and apply the Flex recipe, which registers required services and configuration.

4. Update and run Rector

Update <project_root>/rector.php

...
+ use Sylius\SyliusRector\Set\SyliusAdyen;

return static function (RectorConfig $rectorConfig): void {
    // ...
    $rectorConfig->sets([
+       SyliusAdyen::ADYEN_PLUGIN_20,
    ]);
};

Run rector

vendor/bin/rector

5. Install and build assets

bin/console assets:install public

yarn install
yarn encore dev # or yarn encore prod

6. Run database migrations

bin/console doctrine:migrations:migrate # add `-e prod` for production

7. Clear cache

bin/console cache:clear # add `-e prod` for production

[Optional] Add the Adyen gateway to supported gateways of Refund Plugin

# config/packages/_sylius.yaml

parameters:
    ...
    sylius_refund.supported_gateways:
        - offline
        - adyen

[Optional] Route Adyen logs to specific handlers

The plugin comes with the adyen monolog channel preconfigured, if you want you can route the logs generated to a specific handler by environment

# config/packages/monolog.yaml

when@dev:
  monolog:
    handlers:
      adyen_file:
        type: rotating_file
        path: '%kernel.logs_dir%/adyen-dev.log'
        max_files: 14
        level: debug
        channels: ['adyen']

when@prod:
  monolog:
    handlers:
      adyen_file:
        type: rotating_file
        path: '%kernel.logs_dir%/adyen-%kernel.environment%.log'
        max_files: 30
        level: info
        channels: ['adyen']

Next steps

Once the plugin is installed, don’t forget to configure at least one Sylius payment method that uses Adyen as the gateway.

Follow the guide here: Configuring Adyen Payment Method

This step is required to make Adyen payment options available during checkout.

Last updated

Was this helpful?