Skip to content

Add card network, funding, prepaid, commercial, consumer, segment and subbrand keys - #272

Merged
TomK merged 3 commits into
masterfrom
card-bin-keys
Nov 1, 2026
Merged

TomK merged 3 commits into
masterfrom
card-bin-keys

Conversation

@TomK

@TomK TomK commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Selector rules can only route cards on scheme, card brand, issuer and country. Chargehive now looks up each card's bin data server-side, which also says which networks it can route over (e.g. VISA, ACCEL, STAR), how it is funded, whether it is prepaid, commercial or consumer, its cardholder segment and its product family (e.g. Maestro within Mastercard).

  • New selector keys: method.info.card.network (matches if any of the card's networks does), method.info.card.funding (a FundingType: credit, debit, charge, deferred_debit), method.info.card.prepaid / .commercial / .consumer (true/false), method.info.card.segment (CONSUMER, BUSINESS, COMMERCIAL, GOVERNMENT), method.info.card.subbrand (a CardSubbrand: MAESTRO, CIRRUS (ATM only), VISA_ELECTRON, V_PAY). A key the bin data doesn't report is absent.
  • New method info keys: card_networks (comma separated, brand's own first), card_funding, card_prepaid, card_commercial, card_consumer, card_segment; card_subbrand already exists; card_type keeps its existing values.
  • CardSubbrand values for the product families Mastercard and Visa identify by product code.
  • FundingTypeDeferredDebit (deferred_debit) added to FundingType.
  • New scheme: card_unbranded, a card issued without a scheme (EBT, private-label rails).

Assemble fills and matches these in a follow-up; until then the keys are accepted and never match.

Test plan

  • go build ./..., go vet on selector and paymentmethod, and go test ./... pass.

🤖 Generated with Claude Code

TomK and others added 2 commits November 1, 2026 00:23
…bbrand keys

Selector keys and method info keys for the bin data Chargehive looks up
server-side: every network a card can route over (matching if any
does), its funding type, the prepaid, commercial and consumer flags,
the cardholder segment, and the product family within its brand (e.g.
Maestro). Adds the card_unbranded scheme for cards issued without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
method.info.card.type was vague beside method.type; the key holds how a
card is funded, so it is method.info.card.funding with its own
card_funding info key, card_type keeping its existing values. Its
values are paymentmethod.FundingType, which gains deferred_debit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomK TomK changed the title Add card network, type, prepaid, commercial, consumer, segment and subbrand keys Add card network, funding, prepaid, commercial, consumer, segment and subbrand keys Nov 1, 2026
The product families the card brands identify by product code (in
Pagos's data: Maestro MSI/MSO/MSB/MSW/OLS/MSS/MSM/MSG and Cirrus CIR
within Mastercard, Visa Electron L and V PAY V within Visa) as
CardSubbrand values for method.info.card.subbrand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomK
TomK merged commit c8722fa into master Nov 1, 2026
1 check passed
@TomK
TomK deleted the card-bin-keys branch November 1, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant