Testing JavaScript API Integration
Radial provides a set of mock card numbers that you can use to trigger specific error codes from Radial's JavaScript APIs.
Error Codes and Mock Cards
The table below lists the error codes that Radial's JavaScript APIs can return, and the mock card numbers that you can use during your testing to trigger each error condition.
Some of the error codes are based on particular offerings. For example, errors 50004, 50005, and 50006 apply to 3DS only. Errors 50001, 50002, and 50003 apply to all offerings.
Error Code |
Error Message |
Description |
Mock Card |
---|---|---|---|
50001 |
TimeoutError |
There was a time out attempting to contact Radial’s payment service |
4161616161616008 |
50002 |
InvalidLoginError |
The nonce used to connect to Radial is invalid or timed out. Renew the nonce and try again. |
Client can easily reproduce this, by passing expired nonce or wrong nonce |
50003 |
RadialInternalError |
There was an internal error in Radial's system |
5204242750270044 |
50004 |
InvalidJWTError |
The JWT used to connect to Radial is invalid |
6011000000004312 |
50005 |
3dsGatewayTimeoutError |
The 3ds gateway timed out |
378282246310005 |
50006 |
3dsGatewayInternalError |
There was an internal error in the 3ds gateway |
6011000000004311 |
Expected Responses While Using Mock Cards
Timeout
Note: The below mock responses are generated from Test environment.
{
error_code: "50001",
error_message: "There was a time out attempting to contact Radial’s payment service.",
error: "TimeoutError",
ActionCode: "ERROR",
account_token: "416161X1xQ466008"
}
Radial Internal Error
{
error_code: "50003",
error_message: "There was an internal error in Radial’s system.",
error: "RadialInternalError",
ActionCode: "ERROR",
account_token: "520424kXadlS0044"
}
Invalid JWT Error
{
error_code: "50004",
error_message: "The JWT used to connect to Radial is invalid. Get a fresh jwt and try again.",
error: "InvalidJWTError",
ActionCode: "ERROR",
account_token: "601195qBycAR6811"
}
3DS Gateway Timeout Error
{
error_code: "50005",
error_message: "The 3ds gateway timed out. At this point, the webs…n if it wishes or retry the authentication again.",
error: "3dsGatewayTimeoutError",
ActionCode: "ERROR",
account_token: "378282gfTp90005"
}
3DS Gateway Internal Error
{
error_code: "50006",
error_message: "There was an internal error in the 3ds gateway.",
error: "3dsGatewayInternalError",
ActionCode: "ERROR",
account_token: "601100nW1ONf4311"
}