Adyen iDEAL

SEPA transfers

Step 1 - Tokenize the iDEAL payment method in Adyen

** Adyen iDEAL Tokenizing Direct Debit Payment Methods
You can also choose to tokenize your Direct Debit payment methods with Adyen iDEAL. In order to do this you must create a payment token via the iDEAL frontend integration. Adyen iDEAL supports tokenization using the Client Secure Encryption (CSE) and by implementing the required features using their guides.

curl https://checkout.adyen.com/v52/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
  "reference":"YOUR_ORDER_NUMBER",
  "amount":{
    "currency":"EUR",
    "value":1000
  },
  "paymentMethod":{
    "type":"ideal",
    "issuer":"0721"
  },
  "returnUrl":"https://your-company.com/checkout?shopperOrder=12xy.."
}'

Response will be along the lines of:

"resultCode": "RedirectShopper",
    "action": {
        "paymentData": "Ab02b4c0!BQABAgBAwlyrnseSoJgCMQejzs9NVAhNpMsRJHLT5PoO1gu03zmKEttCC/O1WFWVezZSWfbn5Ejd1uy2Edbd6GfZbAIcygprejckr4pgZ9D9MS9zZR5Y0/H3AKBQ8zsBrqO1kyoU4XWaX+yeo2Q2pcyLZiiK67guVA0/2XxLoZW45YtbHJ1AF2A6m7iRRF8WQFB+jb6T9dFcWmZRmWGe1eZA4PecOk03E…",
        "paymentMethodType": "ideal",
        "url": "https://test.adyen.com/hpp/redirectIdeal.shtml?brandCode=ideal&currencyCode=EUR&issuerId=1121&merchantAccount=TestCompanyORG727&merchantIntegration.type=CHECKOUT_GENERIC&merchantIntegration.version=49&merchantReference=YOUR_ORDER_NUMBER&merchantReturnData=85159135896K&merchantSig=P2n%2BXGjOMzNEJC3v4Qwr.... ",
        "method": "GET",
        "type": "redirect"
    },
    "details": [
        {
            "key": "payload",
            "type": "text"
        }
    ],

Step 2 - Redirect the customer to the Adyen URL

url is where the shopper should be redirected to. Save PaymentData for later.

After a successfully completed authorization after the redirect you get a Payload

Step 3 - Fetch the PspReference

With the PaymentData and the Payload call the endpoint

curl https://checkout.adyen.com/v52/payments/details \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
     "paymentData":"Ab02b4c0!BQABAgCdyi+oPHoTqHBQnlhRQCYzQrDsYZaz2Bo...",
     "details":{
       "payload":"Ab02b4c0!BQABAgA0znYLL2v5D5DMjdQJrwA3sfYmNppeWfZMSLRWdc7M3fo..."
     }
}'

Response:

{
    "pspReference": "881591357918059A",
    "resultCode": "Authorised",
    "merchantReference": "YOUR_ORDER_NUMBER",
    "paymentMethod": "ideal",
    "shopperLocale": "en_GB"
}

Step 4 - Get the ListRecurringDetails using the PspReference

curl https://pal-test.adyen.com/pal/servlet/Recurring/v49/listRecurringDetails \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
  "recurring": {
    "contract": "RECURRING"
  },
  "shopperReference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
  "merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}'

Response:

{
    "creationDate": "2020-06-05T13:52:21+02:00",
    "details": [
        {
            "RecurringDetail": {
                "bank": {
                    "bankName": "Test Issuer",
                    "bic": "TESTNL01",
                    "countryCode": "NL",
                    "iban": "NL13TEST0123456789",
                    "ownerName": "A. Klaassen"
                },
                "contractTypes": [
                    "RECURRING"
                ],
                "creationDate": "2020-06-05T13:52:21+02:00",
                "firstPspReference": "881591357918059A",
                "paymentMethodVariant": "idealtestissuer",
                "recurringDetailReference": "8315913579417773",
                "variant": "ideal"
            }
        }
    ],
    "shopperReference": "test_reference6"
}

Find the recurring contract firstPspReference matching your pspReference.

Save the recurringDetailReference for this one, which should be sent to Upodi as token.

Step 5 - Send the token to Upodi

Posting those to Upod will be done by making a POST request to /paymentmethods/{customerId} with a body including the token object:

{
  "type" : 64,
  "makedefault" : "true",
  "puretoken" : {
    "token" : { 
      "Token": "7219687191761347", 
      "shopperreference": "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
      "immediateRefund": true, //Optional, issue an immediate refund of a first payment
      "initialPaymentReference": "{pspReference}", //Only if immediateRefund is true. Pass the reference for the payment you want to refund
      "currency": "EUR", //Only if immediateRefund is true
      "amount": 1.00 //Only if immediateRefund is true
    },
    "paymentgateway" : "adyen_directdebit"
  }
}

Step 6 - Adyen Webhook setup

❗️

Required

The Adyen webhook setup is required for Upodi to know the payment status.

In Adyen Server Communication Settings setup a new Standard Notification and set it up with URL https://app.upodi.io/catcher.ashx?type=adyen&t={Upodi Callback key} and choose TLSv1.2. The rest of the settings can be left as they are.

556

The Server Communication Settings to create a webhook service for Upodi.

Now Adyen will automatically notify Upodi about the payment status of your payments.