Result Codes
Test different payment result scenarios
Result Codes
Test how your integration handles various payment outcomes.
Success scenarios
| Card Number | Result |
|---|---|
4242424242424242 | Payment succeeds |
5555555555554444 | Payment succeeds (Mastercard) |
378282246310005 | Payment succeeds (Amex) |
Decline scenarios
Trigger specific decline reasons:
| Card Number | Decline Reason |
|---|---|
4000000000000002 | Generic decline |
4000000000009995 | Insufficient funds |
4000000000009987 | Lost card |
4000000000009979 | Stolen card |
4000000000000069 | Expired card |
4000000000000127 | Incorrect CVC |
4000000000000119 | Processing error |
4000000000000101 | Invalid number |
Handle decline responses
Send a payment request with a decline test card to see how errors are returned:
curl -X POST https://api.plexypay.com/v2/payments \
-H "x-api-key: YOUR_TEST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000,
"currency": "USD",
"payment_method": {
"type": "card",
"card": {
"number": "4000000000009995",
"exp_month": 12,
"exp_year": 2030,
"cvc": "123"
}
}
}'The API responds with HTTP 402 and an error object:
{
"error": {
"type": "card_error",
"code": "insufficient_funds",
"message": "The card has insufficient funds.",
"decline_code": "insufficient_funds"
}
}Check error.code to determine the specific decline reason and show an appropriate message to the customer.
CVC check results
| CVC | Result |
|---|---|
123 | CVC check passes |
000 | CVC check fails |
AVS check results
| Postal Code | Result |
|---|---|
12345 | AVS passes |
00000 | AVS fails |
Response structure
Failed payments include detailed error information:
{
"id": "pay_abc123",
"status": "failed",
"failure_code": "insufficient_funds",
"failure_message": "The card has insufficient funds.",
"decline_code": "insufficient_funds",
"outcome": {
"type": "issuer_declined",
"reason": "insufficient_funds",
"ripr_level": "normal"
}
}Map to customer messages
| Code | Customer Message |
|---|---|
insufficient_funds | "Your card has insufficient funds. Please try a different card." |
card_declined | "Your card was declined. Please try a different card." |
expired_card | "Your card has expired. Please use a valid card." |
incorrect_cvc | "The security code is incorrect. Please check and try again." |
processing_error | "An error occurred. Please try again." |
See also
- Error Codes - API error reference
- Test Cards - All test card numbers