Repository navigation
Document cvc-only VGS cards in the CLI - #313
Conversation
A VGS card for a card the merchant already holds on file sets card_mode cvc_only and sends the CVC alias alone. The spec help, the VGS checkout flow, the create example and the requested-state guidance now describe both modes. The CLI already forwards the spec unchanged, so no request handling changes.
The vault item output allowlist dropped spec.card_mode, so -o json hid it on every SDK version. Add it, and assert it in the cvc-only test. The help now says an absent card_mode means full, names the 400 a mode mismatch returns, lists the fields each VGS card fills, and matches the API's wording for rejected and masked fields.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b861062. Configure here.
| for the security code: send cvc_alias alone. card_mode must match the card, so a full card | ||
| missing pan_alias is rejected rather than treated as cvc_only. a mismatch, or any of pan_alias, | ||
| exp_month, exp_year or last4 on a cvc_only card, returns http 400. Kernel cannot verify which card | ||
| the merchant holds, and the payment window routes browser egress exactly as widely as a full card's. |
There was a problem hiding this comment.
New help uses Kernel not KERNEL
Low Severity
New VGS spec Long help names the product Kernel in Kernel cannot verify which card the merchant holds. Vaults user-facing copy uses KERNEL for the product name.
Triggered by learned rule: Vaults user-facing copy is lowercase; KERNEL for product
Reviewed by Cursor Bugbot for commit b861062. Configure here.
There was a problem hiding this comment.
PR #313 review
- vaults_help.go:246-247: the egress sentence leaves out the real risk. Use the
API's wording: while the window is open, the proxy reveals the card's aliases
to any destination, not only the CVC. - No card_mode row in the table, so a cvc-only card looks like a full card.
Waiting on the SDK isn't needed: v0.143.0 has shipped, and printVaultItem
(vaults_output.go:386) already has the raw JSON. - Nit, vaults_output.go:680: "or an expired card" doesn't fit cvc-only cards.
Verified: the help text matches the API, tests and CI pass.
Older issue, not from this PR (traced in code, not run): the API stores the error
message as status_reason, but the CLI matches on codes, so users probably see
only the generic declined text.


Summary
The API now accepts a second VGS card shape:
spec.card_mode: "cvc_only"withspec.cardcarrying onlycvc_alias, for a card the merchant already holds on file whose checkout asks only for the security code.card_modedefaults tofull, and must match the card sent (a full card missingpan_aliasis rejected, not treated ascvc_only).This updates the CLI's text to cover both modes:
VgsCardSpecin thecards create/cards updatehelp addscard_mode?: "full" | "cvc_only"and markspan_alias,exp_month,exp_yearandlast4optional, required withfulland rejected withcvc_only.cvc_only, that the number fields are rejected even when empty, and that a cvc-only card fills onlycvcand reports no last4.cards creategains a cvc-only example.No request handling changes.
cards create --provider vgs --spec-filealready forwards the spec as written, so cvc-only cards work with the current Go SDK.Output
-o jsonnow showsspec.card_modefor a cvc-only card. It was missing because the CLI's vault item output allowlist did not include it (the CLI filters the raw response, so the SDK version was not the cause). A full card's read omitscard_mode, matching the API, and the help says an absent value means full. The human table view still has nocard_moderow; adding one needs the Go SDK bump to 0.143.0, which is otherwise a drop-in for the CLI.Tests
TestVaultVgsCVCOnlyCardSendsOnlyTheCVCAlias: the request body carriescard_mode: "cvc_only"and acardobject containing onlycvc_alias;-o jsonshowscard_mode; the alias never appears in output.TestVaultSpecHelpAndFlagsasserts the new type fields and guidance.go vet ./...andgo test ./...pass.Note
Low Risk
Doc, display filtering, and test updates only; VGS create already forwards specs unchanged.
Overview
Updates the vaults CLI for the API's
spec.card_mode: "cvc_only"VGS shape: help, checkout flow text, andVgsCardSpecnow describefullvscvc_only(CVC alias only when the merchant already has the card on file), validation rules (PAN/expiry/last4 rejected on cvc_only), and that fill/authorize behave differently for cvc-only cards.Adds a
cards createexample for saved-card checkout, tweaks fill and requested-state guidance, and includesspec.card_modein the-o jsonvault item allowlist so cvc-only items show the mode (full reads still omit it per API).Adds
TestVaultVgsCVCOnlyCardSendsOnlyTheCVCAliasand extends help/spec tests; no change to how--spec-fileis forwarded.Reviewed by Cursor Bugbot for commit b861062. Bugbot is set up for automated code reviews on this repo. Configure here.