Skip to content

Fix CRD scheme enum to match the values actually emitted - #43

Merged
thejspr merged 1 commit into
masterfrom
document-protectbuy-crd-scheme
Sep 3, 2026
Merged

Fix CRD scheme enum to match the values actually emitted#43
thejspr merged 1 commit into
masterfrom
document-protectbuy-crd-scheme

Conversation

@thejspr

@thejspr thejspr commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

An integrator asked us to update the docs for CRD.scheme because they were sometimes getting protectbuy, which is not a documented value.

What was wrong

The enum listed standin, visa, mastercard, amex, discover. Two problems:

  • discover has never been emitted by the service.
  • jcb, upi and sbn were missing entirely, so the same surprise was waiting for those.

Notes

  • Descriptions mirror preauth.html verbatim for consistency.
  • Prettier clean with the repo's --bracket-same-line.
  • Not included, happy to add if wanted: sandbox can only ever return standin or sbn. The docs say standin is "only in sandbox", but the converse is the more useful fact and is undocumented — an integrator testing in sandbox will never see protectbuy or visa at all, which is probably why this only surfaced in production.

The CRD `scheme` attribute documented `discover`, a value the service has
never emitted, and omitted `jcb`, `upi` and `sbn` entirely.

The emitted value is the configured directory server's `Scheme` string,
passed through verbatim: the CRD cache tags every card range with
`ds.Scheme()` on ingest, and the preauth handler copies that onto the
response as `scheme`. There is no output-side enum. The possible values
are therefore exactly the DS configured per environment, which is
`visa`, `mastercard`, `amex`, `protectbuy`, `jcb`, `sbn` and `upi` in
production, plus `standin` in sandbox.

Discover's directory server has been configured as `protectbuy` since we
certified with them, after Discover's own name for their 3-D Secure
program (which covers Discover and Diners Club International), so
`discover` was never correct. The preauth `ds` field and the AReq
attributes already documented `protectbuy`; this brings the CRD table in
line with them.

`fime` and `jcb-tmp-off` are deliberately left out as staging-only.

Reported by an integrator who met `protectbuy` in production.
@thejspr
thejspr requested a review from a team September 2, 2026 08:20
@thejspr
thejspr merged commit 802d7ad into master Sep 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants