Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Latest commit

 

History

History
108 lines (60 loc) · 4.99 KB

adyen.md

File metadata and controls

108 lines (60 loc) · 4.99 KB

Adyen setup guide

In this guide we'll setup Adyen payment gateway with Saleor Checkout.

Setup

Saleor Checkout uses Adyen's Pay by Link flow

  1. Sign up for Adyen test account

  2. In test Customer Area create new merchant account

  3. Create new API credentials. Go to Developers > API credentials > Create new credential

Select "Web service user" and enter some description (for example "Saleor Checkout")

Setup Adyen API credentials modal in Customer Area

  1. Copy API key from newly generated API credentials:

Copy API key from Adyen Customer Area

Go to Checkout app configuration. It can be found in Saleor dashboard in: Apps > Third party apps > Checkout. Once you open the app, select one of the channels and click the gears icon:

Payment gateway configuration in Saleor dashboard

To configure API key go to: Adyen > Private API key and paste what you've copied from Adyen.

Paste API key in Checkout app configuration

  1. Click "Generate client key" and copy it to clipboard, paste it in Checkout app configuration > Adyen > Public client key

Copy client key from Adyen's Customer Area

Paste client key in Checkout app configuration

  1. Add allowed origin to your Client key, paste URL of your deployed Checkout SPA and click "Add"

Pasted deployed URL of Checkout SPA in client key's allowed origin

  1. Save changes you've made to API credential

  2. Create standard notification webhook. Go to Developers > Webhooks > "+ Webhook" > "Standard notification"

Creating new Standard notification webhook in Adyen portal

Fill out the webhook details:

  • Description - enter some description for your webhook (ex. Saleor Checkout notifications)
  • Server configuration
    • URL - URL of your deployed Checkout App + /api/webhooks/adyen
<YOUR_CHECKOUT_APP_URL>/api/webhooks/adyen
  • Other settings should be set to default:
    • Method: JSON
    • SSL version: TLSv1.2
    • Service version - 1

Webhook Server configuration config

  • Merchant accounts - choose "Include only specific merchant accounts" and select the merchant account you'll use for checkout, the name must be provided in Checkout App configuration

Webhook Merchant accounts configuration

Merchant account configuration in Checkout app settings

  • Events - leave events selected by default
  • Security
    • Basic authentication - arbitrary username and password, you can use openssl rand -hex 64 to generate random password
    • HMAC Key - click "Generate" and copy the key
    • Those 3 values: username, password and HMAC Key must be provided in Checkout App configuration

This is how your webhook configuration should look like in Adyen:

Final adyen webhook configuration

This is how your Checkout App configuration should look like in Saleor dashboard:

Final checkout app configuration in Saleor dashboard

  1. Save settings in Adyen and in Checkout App configuration

  2. Test webhook configuration in Adyen

Click "Test configuration" button after you've saved the configuration.

Select "AUTHORISATION" from the list and click "Test"

Selecting what webhook event should be sent to Checkout App

Adyen will make a call to your webhook. If everything is configured properly you'll see that the test was successful:

Successful webhook test in Adyen

Note: It can take a while for your webhook configuration to propagate in Adyen after you save it. If the test failed, give it a few minutes before you try again

If the response failed because of invalid configuration in Adyen, Checkout App will return the reason in response:

Failed test because of invalid HMAC Key

  1. After you've tested your webhook, enable it, by clicking the toggle button

Enabling the webhook in Adyen

  1. 🥳 Congrats! You've finished configuration of Adyen payment gateway