Skip to main content

Implementation examples

See our example integration on GitHub! On this page we provide Adyen-specific information for building a Progressive Web Application (PWA) storefront. The PWA storefront works with a headless Adobe Commerce back-end that has the Adyen plugin installed and configured. You can use one of the following web APIs to get Adyen functionalities in your Adobe Commerce headless implementation:
  • REST: The most widely used web API. This method allows you to access all the functionalities provided by the Adyen plugin.
  • GraphQL: Requires plugin v8.2.0 or later The Adyen plugin utilizes the /graphql endpoint exposed by the Adobe Commerce back-end, and adds functionality that is related to the plugin. You can access all functionalities provided by the Adyen plugin with this method. For more information, checkout the Adobe Commerce GraphQL documentation.

Ecommerce checkout flow

Postman
See the API flows for a guest shopper on Postman With a headless Adobe Commerce back end, you build your own payment form for the Adobe Commerce PWA storefront. In the checkout flow, data passes from the PWA storefront through the Adobe Commerce back end to the Adyen API. Then, data passes back from the Adyen API through the Adobe Commerce back end to the PWA storefront. In the checkout flow, you need to do the following steps:
  1. Get the payment methods that are available on the Adyen platform, and for each of them determine the data that you need to collect.
  2. Collect shopper details by presenting the payment methods on your payment form. Then, when the shopper selects a payment method, present the fields to fill out or the options to choose from, and collect these details.
  3. Place the order.
  4. Check the payment status to see if you need to perform any extra steps before redirecting the user to the success page or showing an error message.
  5. Handle additional actions like redirecting the customer to the issue page for additional authentication, or presenting a QR code to complete the payment. If the payment fails, the following attempts will need to handle the additional actions as well

Requirements

Before you start integrating a Adobe Commerce PWA storefront with the Adyen platform:
  1. Make sure that you have completed the steps to configure the Adobe Commerce back end: Setting up in-person payments is not required for a PWA storefront.
  2. The plugin uses Adobe Commerce’s recommended authentication methods to authenticate requests coming from the front-end application. The endpoints use self resources for logged-in shoppers and anonymous resources for guest shoppers.
    Therefore, an integration token is no longer required. Customer token needs to be used as Bearer Token for logged-in shoppers. For guest shoppers, no token is required because a masked card_id is used to authenticate requests.
For more information on resource access, refer to Adobe Commerce documentation.

Step 1: Get available payment methods

In this step, the Adobe Commerce back end retrieves the available payment methods from the /paymentMethods API endpoint and adds some extra information that you will need for rendering the components on the front end. To get the available payment methods and extra information:
  1. Make an API request to get the payment methods and data that you need to collect.
  2. Parse the API response to get a JSON object that contains the Adyen /paymentMethods response and required extra information.

1. Make an API request

If you are using REST, the endpoint differs per use case. If you are using GraphQL, the endpoint is /graphql.
The /payment-information and /shipping-information responses include extension_attributes. This field contains available payment methods and required extra information as adyen_payment_methods_response. The required extra information is relevant when collecting shopper details in Step 2.The payment_methods object in the response of /payment-information or /shipping-information endpoints is filtered and sorted according to the response of /paymentMethods endpoint.