### Would you like to contact support?

No momento, esta página não está disponível em português

# Test authorisation result codes

You can test how your integration handles responses from the plataforma de pagamentos da Adyen by forcing specific result codes.

Refer to the instructions for your type of 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 of type: scheme containing the fields required for a card payment. In the number and cvc fields, specify a test card number and corresponding CVC.

• An additionalData object containing a RequestedTestAcquirerResponseCode 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 the card.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"
},
"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 a refusalReason.

#### 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 the number and cvc fields, specify a test card number and corresponding CVC.

• An additionalData object containing a RequestedTestAcquirerResponseCode 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 the card.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"
},
"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 a refusalReason.

#### Sample /authorise response

{
"pspReference": "851563882585825A",
"refusalReason": "Expired Card",
"resultCode": "Refused"
}