Test data only. Local fixtures do not issue cards, verify accounts or provide payment authorization. Use them only in authorized tests. Why?
5 test cards
- Generated fields are not uploaded
- Randomly generated in your browser
- Every number passes the Luhn check
Distinguish a recognized Troy card from an enabled payment method
A checkout can identify a Troy-shaped number correctly while the merchant’s configuration does not enable that method. It can also lose the logo asset while acceptance stays enabled. Those are different states and should produce different messages. This page provides a presentation fixture that keeps brand recognition, acceptance and artwork independent.
The generator emits 16-digit Luhn-valid strings starting with 9792 and a three-digit
synthetic security code. The example number 9792123456789018 is a fixed local test input.
The accompanying acceptance values are mocks, not results obtained from a Turkish gateway.
Define the three acceptance states
TROY is Türkiye’s payment scheme; BKM’s overview also explains that international use involves an international scheme logo on the card. A short prefix check cannot resolve those routing arrangements or the capabilities of a particular merchant account.
For this test contract, true means the mocked checkout configuration enables TROY,
false means it does not, and missing or unexpected data means acceptance is unconfirmed.
The candidate prefix is deliberately restricted to the generator’s 9792 profile.
Braintree’s maintained card-type configuration
includes additional Troy patterns, so 9792 must not be presented as an exhaustive list.
| Situation | Brand label | Expected customer-facing behavior |
|---|---|---|
| Recognized profile, capability true, logo loaded | TROY | Say the method is enabled for this checkout |
| Same input with the logo unavailable | TROY as text | Preserve the same acceptance state |
| Recognized profile, capability false | TROY | Say this checkout does not accept TROY |
| Configuration has not loaded | TROY | Keep acceptance unconfirmed rather than guessing |
Capability arrives as the string "false" | TROY | Treat the malformed response as unconfirmed |
| Input no longer matches the configured shape | Generic Card/Kart label | Clear the stale brand and acceptance message |
The string case matters because JavaScript treats a nonempty string as truthy. A loose
if (capability) check would accidentally turn "false" into an enabled payment method.
Run the Turkish and English presentation cases
Download the Troy capability mocks and the runnable UI contract checks :
node --test troy-capabilities.test.mjs
The fixtures cover both languages, a fallback to English for an unsupported locale, missing artwork, explicit rejection of truthy strings and a cleared brand after deletion. The disabled message in Turkish is “Bu ödeme formu TROY kabul etmiyor.” It describes the checkout’s capability rather than blaming the number the customer entered.
function presentTroy(number, capability, locale, logoLoaded) {
const candidate = typeof number === 'string' && /^9792\d{12}$/.test(number);
const acceptance = candidate && capability === true ? 'enabled'
: candidate && capability === false ? 'disabled' : 'unconfirmed';
const messages = locale === 'tr' ? {
enabled: 'TROY bu ödeme formunda etkin.',
disabled: 'Bu ödeme formu TROY kabul etmiyor.',
unconfirmed: 'Kart kabul durumu henüz doğrulanmadı.'
} : {
enabled: 'TROY is enabled for this checkout.',
disabled: 'This checkout does not accept TROY.',
unconfirmed: 'Card acceptance has not been confirmed.'
};
return {
brand: candidate ? 'TROY' : null,
acceptance,
message: messages[acceptance],
presentation: candidate && logoLoaded === true ? 'logo-with-text' : 'text',
label: candidate ? 'TROY' : locale === 'tr' ? 'Kart' : 'Card'
};
}The runner also checks that changing the logo cannot alter acceptance, changing the locale cannot enable a disabled method, and switching capability states replaces the message without losing the brand label. The function checks number shape only; checksum, other fields and payment readiness must be assessed separately.
Connect the mocks to your actual checkout
Replace presentTroy with an adapter that reads your component’s visible label, message
and presentation state. Supply capability through the same interface used for your real
merchant configuration, using mocks in the test. Do not infer that capability from the
customer’s country, interface language or a matching prefix.
In a browser test, force the logo request to fail and confirm the TROY text remains readable. Check that a brand image has an appropriate accessible name and that the acceptance message is not communicated by color alone. Switch between Turkish and English without resetting the mocked capability. Then shorten the input and confirm that the previous enabled message disappears.
Keep “enabled” distinct from “payment approved.” Use provider-published fixtures in a separate sandbox test flow for authorization and 3-D Secure outcomes. The payment-form checklist helps connect those responses to the rest of the interface.
For disagreements between local brand rules, use the Maestro candidate-resolution tests. The BIN and IIN guide explains what a prefix cannot establish, and the tool directory provides the other available network generators.