Skip to content

Adyen

Adyen is a payment platform allowing you to accept payments using common payment methods in eCommerce and Point of Sale.

After integrating Adyen into your Unidy setup users can store their payment details at Adyen and re-use them across your Adyen-enabled applications connected to Unidy. This means customers have to enter their payment details only once. Next time they pay at one of your shop systems, Adyen pre-fills the payment details.

This guide assumes that you're familiar with the Open ID Connect Authorization Code Flow and processing online payments with Adyen.

Privacy

As always before handling any customer data we strongly advise that you:

  • Get officially approved legal advice for example from your legal department or a specialized lawyer/law firm to ensure you understand the legal environment such as data protection rules and that you design a compliant solution.
  • Ensure you informed your customers about what you want to do with their data, asked for their permission and that they explicitly provided valid legal consent. Apart from covering legal aspects you can build trust with your customers this way.

Please note this is not legal advice.

Saved Payment Details

Warning

This only works if the shops are linked to the same merchant account on Adyen unless you requested them to store tokenized payment information on the company account level. We strongly recommend to not store that information on the company account level and recommend starting with a fresh merchant account when connecting to Unidy to reduce the risk of data mixups. We also recommend testing this thoroughly on the test environment before going live. This way you can check that all the systems are behaving as expected (e.g. validate that your shop systems support other shop systems being linked to the same merchant account and that it works with your accounting/legal environment etc.).

Overview

Unidy provides a shared user identifier (the Unidy ID) to connected services which in turn pass it to Adyen as a shopper reference. By providing the Unidy ID as shopper reference to Adyen, Adyen recognizes the user trying to make a payment and displays the saved payment details next time. This works even across multiple shop systems connected to the same Adyen account.

flowchart LR
    ShopA[Shop A]-->|Shopper Reference| Adyen;
    ShopB[Shop B]-->|Shopper Reference| Adyen;
    ShopN[Shop n]-.->|Shopper Reference| Adyen;
    style ShopN stroke-dasharray: 5 5
    Unidy-->|Unidy ID| ShopA;
    Unidy-->|Unidy ID| ShopB;
    Unidy-.->|Unidy ID| ShopN;

Prerequisites

You need

  • an application connected to Unidy with a working OIDC login and Adyen payment flow
  • an Adyen account

Getting the Unidy ID

If your connected application uses the OIDC authorization code flow for signing in Unidy users, you can fetch an ID Token from Unidy using the Authorization Code. You can then take the user's Unidy ID from the ID Token's sub claim. In short, the ID Token is a signed JSON Web Token containing information about a user. The sub attribute of that token contains the subject identifier. Here, this identifier is the user's Unidy ID.

Starting the Payment Flow

When starting a new payment flow or payment session at Adyen you need to provide the user's Unidy ID as the shopperReference parameter. This way Adyen can look up any stored payment details for that user. Please refer to Adyen's documentation for more information on customizing the payment flow for your use case.

That's it! When your customer chooses to store their payment details, next time they make a payment initiated with their Unidy ID as shopperReference, Adyen will display their stored details.