You can test how your integration handles responses from the Adyen payments platform by forcing specific result codes.
Refer to the instructions for your type of integration:
- Using the /payments endpoint in a Checkout API integration.
- Using the /authorise endpoint in a classic integration.
Test result codes with the /payments endpoint
To force a card payment response:
-
Make a POST request to the /payments endpoint, specifying:
-
A
paymentMethod
object oftype
: scheme containing the fields required for a card payment. In thenumber
andcvc
fields, specify a test card number and corresponding CVC. -
An
additionalData
object containing aRequestedTestAcquirerResponseCode
element.
In this element, provide either a Code (as an integer) or a Response (as a string) that you want to test from our list of Adyen response codes.
If you can't submit
additionalData
for testing, you can also test specific payment results using thecard.holderName
field. For more information, see Testing with cardholder name.The following example tests a "Refused" payment result due to an expired card:
Sample /payments request
{ "amount": { "currency": "USD", "value": 1000 }, "paymentMethod":{ "type":"scheme", "expiryYear":"2020", "expiryMonth":"10", "cvc":"737", "number":"4444333322221111", "holderName":"J. De Tester" }, "additionalData":{ "RequestedTestAcquirerResponseCode":6 }, "reference":"ref213784568978023465896", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }
You'll receive a response containing a
resultCode
. If the payment is refused, you'll also receive arefusalReason
.Sample /payments response
{ "pspReference": "851563882585825A", "refusalReason": "Expired Card", "resultCode": "Refused", "refusalReasonCode": "6" }
-
Test result codes with the /authorise endpoint
To force a card payment response:
-
Make a POST request to the /authorise endpoint, specifying:
-
A
card
object containing the fields required for a card payment. In thenumber
andcvc
fields, specify a test card number and corresponding CVC. -
An
additionalData
object containing aRequestedTestAcquirerResponseCode
element.
In this element, provide either a Code (as an integer) or a Response (as a string) that you want to test from our list of Adyen response codes.
If you can't submit
additionalData
for testing, you can also test specific payment results using thecard.holderName
field. For more information, see Testing with cardholder name.The following example tests a "Refused" payment result due to an expired card:
Sample /authorise request
{ "amount": { "currency": "USD", "value": 1000 }, "card":{ "expiryYear":"2020", "expiryMonth":"10", "cvc":"737", "number":"4444333322221111", "holderName":"J. De Tester" }, "additionalData":{ "RequestedTestAcquirerResponseCode":6 }, "reference":"ref213784568978023465896", "merchantAccount":"YOUR_MERCHANT_ACCOUNT" }
You'll receive a response containing a
resultCode
. If the payment is refused, you'll also receive arefusalReason
.Sample /authorise response
{ "pspReference": "851563882585825A", "refusalReason": "Expired Card", "resultCode": "Refused" }
-