Reproducible card fixtures

Generate up to 10,000 local test records. Save the manifest to replay the batch with the same version and date.

Seed, date and negative cases

Synthetic format data for isolated tests. No account or payment acceptance checks. Percentages are sampling probabilities, not exact row quotas.

Batch manifest

A large test dataset is useful only when a failed run can be reproduced. This tool captures the seed, reference date, generator version, profile version and sampling settings in a separate manifest. Save it beside the exported data rather than keeping only a seed in a ticket.

Replay the same batch after New Year

A generator that reads the current year internally changes its expiry fields when January arrives. Here the reference date is explicit. Future rows get a year one to five years after its year; expired rows get a year one to three years before it. The random month remains a two-digit string. This is intentionally coarse expiry sampling; use fixed same-month cases for boundary tests.

Open Seed, date and negative cases and try seed ccg-eight-page-fixture, reference date 2026-11-08, quantity 25, even network mix and 25% for both negative controls. This configuration is also saved in the example project. A generated row may be both expired and Luhn-invalid because the two choices are independent.

The replay function rejects an incompatible bundle instead of silently creating different output:

export function replayBulk(manifest, profile) {
  if (manifest.schemaVersion !== 1 || manifest.generatorVersion !== DATA_VERSION || manifest.profileId !== profile.id) {
    throw new Error('Manifest version or profile differs; use the original bundle');
  }
  const session = bulkSession({ ...manifest.settings, seed: manifest.seed, referenceDate: manifest.referenceDate }, profile);
  return Array.from({ length: manifest.settings.count }, () => session.next());
}

Download the replay project with its golden dataset . Run node --test data-tools.test.mjs, then node fixture-demo.mjs > fixture.json. The tests compare the complete replay to fixture-expected.json, including names, security codes and expiry strings. The test-data management guide covers updating that baseline deliberately.

Network labels that agree with the validator

Generation uses the same profile as the main card generator. In particular, Maestro generation avoids the broad 56–69 detection fallback, and UnionPay is included as a ninth network. The table below is rendered from the exact configuration passed to both tools.

NetworkConfigured prefixesLengths
American Express34, 3715
Diners Club300–305, 36, 38, 3914
Discover6011, 65, 644–64916
JCB3528–358916
Maestro50, 56–58, 6304, 6759, 6761–676316, 19
Mastercard51–55, 2221–272016
Troy979216
UnionPay62, 8116, 19
Visa416

These are local generation profiles, not exhaustive issuer allocations. A test for overlapping prefixes belongs in a separately named ambiguity fixture. It should not appear as an ordinary Maestro record whose number is classified as Discover. The shared tests generate 250 records per network and independently inspect brand, supported length, checksum, security-code length and uniqueness within each batch.

Choose a data format deliberately

FormatShapeImport detail
JSONArray of eight-field objectsCard number, month, year and code remain strings
JSONLOne object per lineUseful for streaming test runners
CSV / TSVEight quoted columns with a headerImport identifier columns as text; quoting does not stop spreadsheet conversion
SQLSeven-column test_payment_methods INSERTOmits the name; verify your local schema before executing
ManifestSeparate JSON objectDescribes the batch, not a replacement for the data file

The JSON keys are cardNumber, network, expMonth, expYear, cvv, cardholderName, luhnValid and expired. CSV/TSV use snake_case headers for the multiword names. Embedded quotes are doubled in delimited exports. SQL escapes string quotes and keeps numeric-looking identifiers quoted.

The browser previews at most 25 rows. Copy all rows and Download data use the full batch. Changing settings leaves the old batch and manifest intact until Generate is pressed; changing the export format only reformats those existing rows. During generation the batch settings are locked, and export is disabled until all rows are ready.

Negative cases and their limits

At 100% invalid Luhn, every final check digit is changed by a nonzero offset. At 100% expired, every row precedes the reference year. At intermediate percentages the exact count varies: they are probabilities, not quotas. Empty input, pasted letters, current-month expiry and incomplete prefixes need small explicit cases from the payment-form checklist, rather than hoping a random batch produces them.

No generated row establishes an account, balance or gateway outcome. Use the processor test-card reference for sandbox authorization flows. Keep generated fixtures in isolated test environments.

Updated 8 November 2026: nine shared profiles, fixed reference dates and downloadable replay manifests replace the previous year-dependent implementation.

Frequently Asked Questions

Will the same seed always create the same output?
Use the same generator version, profile, seed, reference date and settings. The manifest records them. A version or profile mismatch is rejected by the replay function.
Does 25% invalid mean exactly 25 rows out of 100?
No. It is a probability applied to each row. Use fixed cases for exact boundaries; use 100% when every generated row must fail a particular check.
Why does Maestro use a narrower prefix set?
The broad detection fallback overlaps other networks. Generation uses the same narrower profile as the main tool so ordinary Maestro fixtures are not labeled as Discover or another more specific candidate.
What is included in the export?
JSON, JSONL, CSV and TSV include eight fields, including cardholderName. SQL retains the seven-column test_payment_methods shape and omits cardholderName. Copy and download include the whole batch, while the preview shows at most 25 rows.