Result Codes
Test different payment result scenarios
Test how your integration handles various payment outcomes.
| Card Number | Result |
|---|
4242424242424242 | Payment succeeds |
5555555555554444 | Payment succeeds (Mastercard) |
378282246310005 | Payment succeeds (Amex) |
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 |
try {
const payment = await plexy.payments.create({
amount: 5000,
currency: 'USD',
payment_method: {
type: 'card',
card: {
number: '4000000000009995', // Insufficient funds
exp_month: 12,
exp_year: 2030,
cvc: '123',
},
},
});
} catch (error) {
if (error.type === 'card_error') {
switch (error.code) {
case 'insufficient_funds':
// Ask customer to try different card
break;
case 'card_declined':
// Generic decline message
break;
default:
// Handle other declines
}
}
}
| CVC | Result |
|---|
123 | CVC check passes |
000 | CVC check fails |
| Postal Code | Result |
|---|
12345 | AVS passes |
00000 | AVS fails |
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"
}
}
| 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." |