Skip to content

Instantly share code, notes, and snippets.

@OrderAndCh4oS
Created July 18, 2020 08:32
Show Gist options
  • Save OrderAndCh4oS/03949a67ea1279f04dfde0efeaa53058 to your computer and use it in GitHub Desktop.
Save OrderAndCh4oS/03949a67ea1279f04dfde0efeaa53058 to your computer and use it in GitHub Desktop.
Stripe Test Card Data
const randomInteger = (min: number, max: number) =>
Math.floor(Math.random() * (max - min + 1)) + min;
export const getFutureExpiryDate = () => {
const now = new Date();
now.setFullYear(now.getFullYear() + randomInteger(1, 5));
return {month: randomInteger(1, 12), year: now.getFullYear().toString().slice(2)};
}
export const getPastExpiryDate = () => {
const now = new Date();
now.setFullYear(now.getFullYear() - 2);
return {month: randomInteger(1, 12), year: now.getFullYear().toString().slice(2)};
}
export const cardData = [
{number: '4242424242424242', type: 'Visa', description: 'Standard', is3DS: false, cvc: '123'},
{number: '4000056655665556', type: 'Visa (Debit)', description: 'Standard', is3DS: false, cvc: '123'},
{number: '5555555555554444', type: 'Mastercard', description: 'Standard', is3DS: false, cvc: '123'},
{number: '5555555555554444', type: 'Mastercard (2-series)', description: 'Standard', is3DS: false, cvc: '123'},
{number: '5200828282828210', type: 'Mastercard (debit)', description: 'Standard', is3DS: false, cvc: '123'},
{number: '5105105105105100', type: 'Mastercard (prepaid)', description: 'Standard', is3DS: false, cvc: '123'},
{number: '378282246310005', type: 'American Express', description: 'Standard', is3DS: false, cvc: '123'},
{number: '371449635398431', type: 'American Express', description: 'Standard', is3DS: false, cvc: '123'},
{number: '6011111111111117', type: 'Discover', description: 'Standard', is3DS: false, cvc: '123'},
{number: '6011111111111117', type: 'Discover', description: 'Standard', is3DS: false, cvc: '123'},
{number: '3056930009020004', type: 'Diners Club', description: 'Standard', is3DS: false, cvc: '123'},
{number: '36227206271667', type: 'Diners Club (14 digit card)', description: 'Standard', is3DS: false, cvc: '123'},
{number: '3566002020360505', type: 'JCB', description: 'Standard', is3DS: false, cvc: '123'},
{number: '6200000000000005', type: 'UnionPay', description: 'Standard', is3DS: false, cvc: '123'},
{
number: '4000002500003155',
type: 'SCA 3DS',
description: 'This card requires authentication for one-time payments. However, if you set up this card and use the saved card for subsequent off-session payments, no further authentication is needed. In live mode, Stripe dynamically determines when a particular transaction requires authentication due to regional regulations such as Strong Customer Authentication.',
is3DS: true,
cvc: '123'
},
{
number: '4000002760003184',
type: 'SCA 3DS',
description: 'This card requires authentication on all transactions, regardless of how the card is set up.',
is3DS: true,
cvc: '123'
},
{
number: '4000008260003178',
type: 'SCA 3DS',
description: 'This card requires authentication for one-time payments. All payments will be declined with an insufficient_funds failure code even after being successfully authenticated or previously set up.',
is3DS: true,
cvc: '123'
},
{
number: '4000003800000446',
type: 'SCA 3DS',
description: 'This card requires authentication for one-time and other on-session payments. However, all off-session payments will succeed as if the card has been previously set up.',
is3DS: true,
cvc: '123'
},
{
number: '4000053560000011',
type: 'SCA 3DS',
description: 'This card requires authentication on all transactions, regardless of how you set it up. You can only use this card for INR payments.',
is3DS: true,
cvc: '123'
},
{
number: '4000000000003220',
type: '3DS Required',
description: '3D Secure 2 authentication must be completed for the payment to be successful. By default, your Radar rules will request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4000000000003063',
type: '3DS Required',
description: '3D Secure authentication must be completed for the payment to be successful. By default, your Radar rules will request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4000008400001629',
type: '3DS Required',
description: '3D Secure authentication is required, but payments will be declined with a card_declined failure code after authentication. By default, your Radar rules will request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4000008400001280',
type: '3DS Required',
description: '3D Secure authentication is required, but the 3D Secure lookup request will fail with a processing error. Payments will be declined with a card_declined failure code. By default, your Radar rules will request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4000000000003055',
type: '3DS Supported',
description: '3D Secure authentication may still be performed, but is not required. By default, your Radar rules will not request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4000000000003097',
type: '3DS Supported',
description: '3D Secure authentication may still be performed, but is not required. However, attempts to perform 3D Secure result in a processing error. By default, your Radar rules will not request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '4242424242424242',
type: '3DS Supported',
description: '3D Secure is supported for this card, but this card is not enrolled in 3D Secure. This means that if 3D Secure is requested by your Radar rules, the customer will not go through additional authentication. By default, your Radar rules will not request 3D Secure authentication for this card.',
is3DS: true,
cvc: '123'
},
{
number: '378282246310005',
type: '3DS Not Supported',
description: '3D Secure is not supported on this card and cannot be invoked. The PaymentIntent will proceed without performing authentication.',
is3DS: true,
cvc: '123'
},
{
number: '4000000000000077',
type: 'Response Check',
description: 'Charge succeeds and funds will be added directly to your available balance (bypassing your pending balance).',
is3DS: false,
cvc: '123'
},
{
number: '4000003720000278',
type: 'Response Check',
description: 'Charge succeeds and funds will be added directly to your available balance (bypassing your pending balance).',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000093',
type: 'Response Check',
description: 'Charge succeeds and domestic pricing is used (other test cards use international pricing). This card is only significant in countries with split pricing.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000010',
type: 'Response Check',
description: 'The address_line1_check and address_zip_check verifications fail. If your account is blocking payments that fail postal code validation, the charge is declined.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000028',
type: 'Response Check',
description: 'Charge succeeds but the address_line1_check verification fails.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000036',
type: 'Response Check',
description: 'The address_zip_check verification fails. If your account is blocking payments that fail postal code validation, the charge is declined.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000044',
type: 'Response Check',
description: 'Charge succeeds but the address_zip_check and address_line1_check verifications are both unavailable.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000005126',
type: 'Response Check',
description: 'Charge succeeds but refunding a captured charge fails asynchronously with a failure_reason of expired_or_canceled_card. Note that because refund failures are asynchronous, the refund will appear to be successful at first and will only have the failed status on subsequent fetches. We also notify you of refund failures using the charge.refund.updated webhook event.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000101',
type: 'Response Check',
description: 'If a CVC number is provided, the cvc_check fails. If your account is blocking payments that fail CVC code validation, the charge is declined.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000341',
type: 'Response Check',
description: 'Attaching this card to a Customer object succeeds, but attempts to charge the customer fail.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000009235',
type: 'Response Check',
description: 'Results in a charge with a risk_level of elevated.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000004954',
type: 'Response Check',
description: 'Results in a charge with a risk_level of highest.',
is3DS: false,
cvc: '123'
},
{
number: '4100000000000019',
type: 'Response Check',
description: 'Results in a charge with a risk_level of highest. The charge is blocked as it\'s considered fraudulent.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000002',
type: 'Response Check',
description: 'Charge is declined with a card_declined code.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000009995',
type: 'Response Check',
description: 'Charge is declined with a card_declined code. The decline_code attribute is insufficient_funds.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000009987',
type: 'Response Check',
description: 'Charge is declined with a card_declined code. The decline_code attribute is lost_card.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000009979',
type: 'Response Check',
description: 'Charge is declined with a card_declined code. The decline_code attribute is stolen_card.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000069',
type: 'Response Check',
description: 'Charge is declined with an expired_card code.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000127',
type: 'Response Check',
description: 'Charge is declined with an incorrect_cvc code.',
is3DS: false,
cvc: '123'
},
{
number: '4000000000000119',
type: 'Response Check',
description: 'Charge is declined with a processing_error code.',
is3DS: false,
cvc: '123'
},
{
number: '4242424242424241',
type: 'Response Check',
description: 'Charge is declined with an incorrect_number code as the card number fails the Luhn check.',
is3DS: false,
cvc: '123'
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment