- Card verification code (CVC)
- Primary account number (PAN)
- Expiration date
- Get a public key from Adyen.
- Generate an encrypted session key.
- Request card details from Adyen.
- Decrypt and reveal the card details in your user interface.
Requirements
Ensure that:- You have API credentials for the Configuration API.
- Your API credential has the Bank Issuing PaymentInstrument Reveal Webservice role.
- Your application uses iOS version 13.0 or later.
- You installed Adyen’s Card Reveal iOS SDK.
Get a public key from Adyen
You need a base64-encoded RSA public key to generate an encrypted session key. Use the Configuration API to get the public key from Adyen. To get a public key:-
Make a GET /publicKey request, specifying the following query parameters:
Get a public key
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
The response contains:- The public key
- The expiry date of the public key
- Pass the publicKey to your client.
Generate an encrypted session key
You need an encrypted symmetric session key to securely request the card details from Adyen. Generate the encrypted session key using the public key and Adyen’s Card Reveal iOS SDK. The steps are as follows:-
Initialize the
CardRevealServicemethod. Initialize the service -
Call the
generateEncryptedKeymethod, passing the publicKey as a parameter. Generate encrypted session key
encryptedKey contains the encrypted symmetric session key that you need to request the card details from Adyen.
Request card details from Adyen
Request from Adyen the encrypted card details as follows:-
Make a POST /paymentInstruments/reveal request and specify the following parameters:
Request for revealing the details of a card
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
The response contains the encryptedData. Response - Pass the encryptedData to your client.
Decrypt and reveal card details
Use Adyen’s Card Reveal iOS SDK to decrypt and reveal the card data as follows:-
Call the
cardDetailsmethod to decrypt the encryptedData. Decrypt card details -
Pass the
decryptedCardDetailsto your app. -
Reveal the
decryptedCardDetailsin your user interface.