Directory lookup call

The directory lookup returns the available payment methods for the shopper based on the country they are shopping from, the amount and currency and skin code you provided. The returned data is a JSON object containing an array of the payment methods. You can parse the response and provide the list of payment methods to your shopper. 

The first part of this payment flow is to make a POST to directory.shtml.

All the fields mentioned in the request example (currencyCodemerchantAccountpaymentAmount, skinCode, merchantReference, sessionValidity and merchantSig), except countryCode, are mandatory.

It is recommended that you provide the countryCode field, to accurately state the actual location of the payment, so that the correct payment methods for that location are retrieved.

Some payment methods restrict WebView in the app for security reasons. We recommend using the following if you want to display local payment method in your app:

The directory lookup returns the available payment methods for the shopper based on the country they are shopping from, the amount and currency and skin code you provided. The returned data is a JSON object containing an array with the payment methods. You can parse the response and provide the list of payment methods to your shopper.

Request

To retrieve a list of available local payment methods make a lookup request to the directory endpoint with the fields in the code example. For Adyen to verify the authenticity of the request calculate the signature of the request and include this in the merchantSig field.

The example below shows how to make such a request. For additional fields and more details for the payment methods request refer to the API Reference.

 

curl https://test.adyen.com/hpp/directory.shtml \
 -d countryCode=DE \
 -d currencyCode=EUR \
 -d merchantAccount=TestMerchant \
 -d merchantReference=Test_directory_lookup \
 -d paymentAmount=2000 \
 -d sessionValidity=2017-12-25T10%3A31%3A06Z \
 -d skinCode=sH9qpMyS \
 -d merchantSig=94AwPXSxs0ECicXi1UDdKEmdzHQ6rf7EF9CC%2FzUO5Tg%3D

Response

Version 1

A response returns a JSON object containing a list of applicable payment methods. Each payment method has a namebrandCode, and optionally, a list of issuers (depending on the payment method). In this case, the issuerId identifies a specific issuer and can be used to direct a shopper to the related method's webpage.



When parsing this response, you can format and display the methods according to your design if you like.

{
   "paymentMethods":[
      {
         "brandCode":"ideal",
         "name":"iDEAL",
         "issuers":[
            {
               "issuerId":"1121",
               "name":"Test Issuer"
            },
            {
               "issuerId":"1152",
               "name":"Test Issuer 3"
            },
            {
               "issuerId":"1151",
               "name":"Test Issuer 2"
            }
         ]
      },
      {
         "brandCode":"sepadirectdebit",
         "name":"SEPA Direct Debit"
      },
      {
         "brandCode":"moneybookers",
         "name":"Moneybookers"
      },
      {
         "brandCode":"klarna",
         "name":"Klarna Invoice"
      },
      {
         "brandCode":"afterpay_default",
         "name":"AfterPay Invoice"
      },
      {
         "brandCode":"boku",
         "name":"Boku"
      },
      {
         "brandCode":"paysafecard",
         "name":"Paysafecard"
      },
      {
         "brandCode":"paypal",
         "name":"PayPal"
      }
   ]
}

Version 2

In case you made a directory lookup request to version 2 (https://test.adyen.com/hpp/directory/v2.shtml), each payment method also returns the logos field containing links to normal, small, and tiny images.

Version 2 response
 {
   "paymentMethods":[
      {
         "brandCode":"paypal",
         "logos":{
            "normal":"http:\/\/test\/hpp\/img\/pm\/paypal.png",
            "small":"http:\/\/test\/hpp\/img\/pm\/paypal_small.png",
            "tiny":"http:\/\/test\/hpp\/img\/pm\/paypal_tiny.png"
         },
         "name":"PayPal"
      },
      {
         "brandCode":"amex",
         "logos":{
            "normal":"http:\/\/test\/hpp\/img\/pm\/amex.png",
            "small":"http:\/\/test\/hpp\/img\/pm\/amex_small.png",
            "tiny":"http:\/\/test\/hpp\/img\/pm\/amex_tiny.png"
         },
         "name":"American Express"
      },
      {
         "brandCode":"ideal",
         "issuers":[
            {
               "issuerId":"1121",
               "name":"Test Issuer"
            },
            {
               "issuerId":"1154",
               "name":"Test Issuer 5"
            }
         ],
         "logos":{
            "normal":"http:\/\/test\/hpp\/img\/pm\/ideal.png",
            "small":"http:\/\/test\/hpp\/img\/pm\/ideal_small.png",
            "tiny":"http:\/\/test\/hpp\/img\/pm\/ideal_tiny.png"
         },
         "name":"iDEAL"
      },
      {
         "brandCode":"mc",
         "logos":{
            "normal":"http:\/\/test\/hpp\/img\/pm\/mc.png",
            "small":"http:\/\/test\/hpp\/img\/pm\/mc_small.png",
            "tiny":"http:\/\/test\/hpp\/img\/pm\/mc_tiny.png"
         },
         "name":"MasterCard"
      }
   ]
}

Skip HPP

If you want, you can skip displaying the payment method selection page with the list of available payment methods returned by the directory lookup. You can route your shopper directly to the payment or order detail entry page.

To use this payment flow:

  • Make a payment request call to skipDetails.shtml.
  • In the call, include the brandCode and issuerId parameters.

Request:

<html>
   <body>
      <form method="post" action="https://test.adyen.com/hpp/skipDetails.shtml" id="adyenForm" name="adyenForm" target="_parent">
         <input type="hidden" name="merchantSig" value="3iWDU/V5RMtdaiZC4YRIpoX9/v0=" />
         <input type="hidden" name="sessionValidity" value="2016-10-11T10:30:00Z" />
         <input type="hidden" name="shopperLocale" value="en_GB" />
         <input type="hidden" name="merchantAccount" value="TestMerchant" />
         <input type="hidden" name="paymentAmount" value="10000" />
         <input type="hidden" name="currencyCode" value="GBP" />
         <input type="hidden" name="skinCode" value="4aD37dJA" />
         <input type="hidden" name="merchantReference" value="Internet order 12345" />
         <input type="hidden" name="brandCode" value="ideal" />
         <input type="hidden" name="issuerId" value="1121" />
         <input type="submit" value="Send" />
         <input type="reset" />
      </form>
   </body>
</html>

Fields for this call vary per payment method, contact Support Team for more information.