Skip to content

docs: add README for basic and vaulted checkout examples#3

Open
okxint wants to merge 1 commit into
primer-io:mainfrom
okxint:docs/add-example-readmes
Open

docs: add README for basic and vaulted checkout examples#3
okxint wants to merge 1 commit into
primer-io:mainfrom
okxint:docs/add-example-readmes

Conversation

@okxint
Copy link
Copy Markdown

@okxint okxint commented Jun 3, 2026

What

Adds README.md to two examples that had no documentation at all:

  • examples/primer-checkout-basic/
  • examples/primer-checkout-vaulted/

Why

Both examples are linked from the root README.md but had zero documentation. A developer landing in either folder had no idea what the example does, when to use it, or how to run it.

What each README covers

Basic checkout:

  • When to reach for the drop-in vs custom UI patterns
  • End-to-end flow diagram (frontend → backend → Primer → processor)
  • Why setAttribute() is required for the client token
  • How to listen for checkout-complete
  • Test card numbers for success/decline/3DS scenarios

Vaulted checkout:

  • Business case for vaulting (returning customer conversion, subscriptions, one-click)
  • How the vault flow differs between a first visit and a return visit
  • Why customerId is required to link saved methods to a customer
  • How to charge a vaulted payment method server-side after the initial checkout
  • Links to the Vault API and Payments API for next steps

Both READMEs follow the format established by primer-checkout-themes/README.md.

Both examples were missing documentation entirely. Each README covers:
- When to use the pattern and the business case for it
- How the integration flow works end-to-end
- Key implementation details and common mistakes
- File structure and links to related examples
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