Test 3DS

Use the Test Data API to simulate both 3DS flow paths without real cards.


Step 1: Create test payment data

Send a POST request to /testPaymentData on the staging endpoint. Set emulate3ds to true to start with the challenge flow enabled, or false for the frictionless flow:

curl --request POST \
  --url https://api-stage.centrobill.com/testPaymentData \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "visa",
    "emulate3ds": true,
    "currency": "USD",
    "balance": 100,
    "allowedIps": ["YOUR_SERVER_IP"]
  }'

A successful response returns the test card object including the card number and id:

{
  "id": 1234,
  "type": "visa",
  "emulate3ds": true,
  "number": "4024007179366348",
  "balance": 100,
  "blocked": false,
  "allowedIps": ["YOUR_SERVER_IP"],
  "createdAt": "2022-01-27 10:11:39",
  "updatedAt": "2022-01-27 10:11:39"
}

Step 2: Toggle 3DS emulation on an existing card

To update 3DS emulation on a card you have already created, use the dedicated endpoints.

To simulate the challenge flow:

curl --request POST \
  --url https://api-stage.centrobill.com/testPaymentData/{id}/emulate3ds \
  --header 'Authorization: YOUR_API_KEY'

To simulate the frictionless flow:

curl --request POST \
  --url https://api-stage.centrobill.com/testPaymentData/{id}/notEmulate3ds \
  --header 'Authorization: YOUR_API_KEY'

A successful response returns the updated test payment data object with the new emulate3ds value reflected.


Step 3: Submit a payment and observe the flow

Use the test card number in a POST /payment request exactly as you would in production.

  • Challenge flow (emulate3ds: true): the response returns payment.action: "redirect" and a challenge URL in payment.url. Redirect the customer to that URL to complete the challenge.
  • Frictionless flow (emulate3ds: false): the response returns payment.action: "charge" and the payment resolves immediately without a redirect.

In both cases, the final result is delivered to your ipnUrl as an IPN callback. See IPN reference for validation details.

For a full explanation of how to handle each flow in your integration, see 3DS transactions.


Did this page help you?