Installation

Supported Version: This guide 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 ^1.14 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:"^1.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_10,
    ]);
};

Run rector

vendor/bin/rector

5. Copy the required templates

mkdir -p templates/bundles/SyliusAdminBundle/Order/Show \
         templates/bundles/SyliusShopBundle/Checkout/Complete \
         templates/bundles/SyliusShopBundle/Checkout/SelectPayment \
         templates/bundles/SyliusRefundPlugin/Order/Admin

cp vendor/sylius/adyen-plugin/templates/bundles/SyliusAdminBundle/Order/Show/_payment.html.twig \
   templates/bundles/SyliusAdminBundle/Order/Show/

cp vendor/sylius/adyen-plugin/templates/bundles/SyliusAdminBundle/Order/Show/_payments.html.twig \
   templates/bundles/SyliusAdminBundle/Order/Show/

cp vendor/sylius/adyen-plugin/templates/bundles/SyliusShopBundle/Checkout/Complete/_navigation.html.twig \
   templates/bundles/SyliusShopBundle/Checkout/Complete/

cp vendor/sylius/adyen-plugin/templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_payment.html.twig \
   templates/bundles/SyliusShopBundle/Checkout/SelectPayment/
   
cp vendor/sylius/adyen-plugin/templates/bundles/SyliusRefundPlugin/Order/Admin/_refundPayments.html.twig \
   templates/bundles/SyliusRefundPlugin/Order/Admin/_refundPayments.html.twig

6. Install and build assets

bin/console assets:install public

yarn install
yarn encore dev # or yarn encore prod

7. Run database migrations

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

8. 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?