Requirements
How it works
- Create a custom module, where you can add your custom code.
- Add your custom module to Composer, so that you can deploy your custom code.
- Decide on the type of customizations you need, and add your customizations to the custom module you have created.
- Deploy your customizations.
Create a custom module
Create a custom module that holds your custom code. Read more about modules in Adobe Commerce documentation.-
Create a new module in your root directory, for example
Example/AdyenCustomizations. -
Create a directory structure for your module, and include required subdirectories.
Example directory structure for a custom module
-
In the
app/code/Example/AdyenCustomization/etc/module.xmlfile, define your module with a dependency on theAdyen_Paymentmodule. Define your module and add dependency -
Register the module in
app/code/Example/AdyenCustomization/registration.php. Register your module
Add your custom module to Composer
To deploy your code with Composer, includecomposer.json in your custom module’s root directory.
-
In the root of your custom module directory, create a
composer.jsonfile. Example composer.json file -
Add the module to the Composer autoload.
Add the module to Composer autoload
Implement customizations
After you have created a custom module, you can start implementing your customizations. You can implement the following types of customization:Override Adyen classes with Dependency Injections
To override default plugin functionality, override classes using Adobe Commerce Dependency Injections. By overriding default classes, you can change or extend the default plugin behaviors. This can include changing the way transactions are processed for a specific payment method, or integrating your business logic into payment flows.-
In the custom module that you created, add a
di.xmlfile. -
For the Adyen class that you want to override, implement a custom class in your module, for example:
app/code/Example/AdyenCustomization/Model/CustomClass.php. -
In your
di.xmlfile, configure the custom class to override the specific Adyen class. Override the Adyen Class
Modify default plugin methods
To make changes to specific methods in the plugin, such as adding logic before or after a method runs, or modifying a method’s output, use Adobe Commerce Plugins. This lets you modify the default plugin behaviors without overriding them.-
In the custom module that you created, add a
di.xmlfile. If you have already added adi.xmlfile for Dependency Injections, you do not have to create a new one. -
In the
di.xmlfile, define a plugin. Define a plugin -
Create and implement the plugin class in your custom module directory to execute logic before, after, or around methods.
Example implementation of a custom plugin
Customize the checkout UI
You can apply customizations to your checkout page to match your brand’s style and format. This includes modifying layout files, adding custom styles, and adding JavaScript for enhanced interactivity.-
Copy the default Adyen module’s layout XML and template files. These files are in the
view/frontendfolder in the default module. - Apply your customizations in the files that you have copied.
-
In the
view/frontendfolder of the custom module that you created:- Add the files that contain your custom code.
- Create a
require-config.jsfile, for example:app/code/Example/AdyenCustomization/view/frontend/requirejs-config.js. Include your custom JavaScript components, overrides, or modifications in this file.
Deploy your customizations
Run the following commands to update Composer, clear caches, and deploy the module. Deploy the custom moduleTesting
Before you go live, test your customizations in a staging or development environment. We recommend to run automated tests and perform manual tests to make sure your UI changes appear as expected. Use our test cards to test customizations that change the way the plugin processes payments.Next steps
Go live
Required. After you have tested your customizations, follow our Go-live checklist, and deploy the customizations in the live environment.
Troubleshoot
Monitor your customizations and follow the steps in our Troubleshooting guide if you experience any issues.