Send payment authentication code
Verify API supports Strong Customer Authentication for payments. To begin the process, supply the customer's telephone number (in E.164 format ), the payee that will receive the payment, and the amount (in Euro) of the transaction, to the PSD2 endpoint.
The Verify API returns a request_id. Use this to identify a specific verification request in subsequent calls to the API, such as when making a check request to see if the user provided the correct code.
Replace the following variables in the sample code with your own values:
| Key | Description |
|---|---|
VONAGE_API_KEY | Your Vonage API key (see it on your dashboard). |
VONAGE_API_SECRET | Your Vonage API secret (also available on your dashboard). |
RECIPIENT_NUMBER | The phone number to verify |
PAYEE | Included in the message to describe the payment recipient |
AMOUNT | How much the payment is for (always in Euro) |
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named psd2.js and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Add the following to build.gradle:
Create a file named StartPsd2Verification and add the following code to the main method:
Write the code
Add the following to the main method of the StartPsd2Verification file:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.kt.verify.legacy with the package containing StartPsd2Verification:
Prerequisites
Add the following to build.gradle:
Create a file named StartPsd2Verification and add the following code to the main method:
Write the code
Add the following to the main method of the StartPsd2Verification file:
Run your code
We can use the application plugin for Gradle to simplify the running of our application. Update your build.gradle with the following:
Run the following gradle command to execute your application, replacing com.vonage.quickstart.verify with the package containing StartPsd2Verification:
Prerequisites
Create a file named SendPsd2.cs and add the following code:
Add the following to SendPsd2.cs:
Prerequisites
Create a file named send_psd2_request.php and add the following code:
Run your code
Save this file to your machine and run it:
Prerequisites
Run your code
Save this file to your machine and run it:
Prerequisites
Create a file named send_psd2_code.rb and add the following code:
Run your code
Save this file to your machine and run it: