@cards-for-agents/checkout
v0.1.0
Published
Local Playwright-driven Postable checkout for cards-for-agents orders. Invoke from Claude Code or any agent with bash access to complete an order end-to-end without routing card data through a server.
Downloads
53
Maintainers
Readme
@cards-for-agents/checkout
Local Playwright-driven Postable checkout for cards-for-agents orders.
Designed to be invoked by an agent with bash access (Claude Code, Cursor, Warp Agent, etc.) to finish an order end-to-end without routing card data through any server. Card details flow: your terminal → this CLI → local Playwright → Stripe's iframe on Postable's page. Our servers never see them.
Install / run
You don't install — your agent runs it on demand:
npx @cards-for-agents/checkout --order-id <uuid>First run downloads Chromium (~140 MB). Subsequent runs start in ~2 seconds.
Passing card details
Two equally safe options. Pick whichever fits your agent.
Env vars
CFAC_CARD_NUMBER=4432522629186373 \
CFAC_CARD_EXP=08/26 \
CFAC_CARD_CVC=434 \
CFAC_CARD_NAME='Nicolas Goldberg' \
CFAC_CARD_ZIP=94123 \
npx @cards-for-agents/checkout --order-id <uuid>Stdin (JSON)
echo '{"number":"4432...","exp":"08/26","cvc":"434","name":"Nicolas Goldberg","zip":"94123"}' \
| npx @cards-for-agents/checkout --order-id <uuid> --card-stdinFlags
--order-id <uuid>— required. The order to finish (fromPOST /v1/orders).--api <url>— override the API base. Defaulthttps://api.cards-for-agents.com.--dry-run— walk through the Postable flow but stop before clicking Place order. No charge. Useful for first-run validation.--headed— show the browser while it drives (for debugging).--card-stdin— read card JSON from stdin instead of env vars.
End-to-end flow
- Compose the order via
https://cards-for-agents.com's REST or MCP (search_cards → create_order → set_card → compose_message → set_recipient → set_sender). Keep the order id. - Preview the order (optional but recommended). Open
https://api.cards-for-agents.com/preview/<id>?token=<token>and verify. - Run this CLI. It calls
GET /v1/orders/<id>/planto fetch the composed data, drives Postable in a local Playwright browser, declines any gift upsells, asserts the cart contains exactly[1 card, 1 stamp], types the card into Stripe, submits. - Output — JSON on stdout with the confirmation URL, detected order number, and raw Stripe/Postable submit responses.
Safety guards
- Before submitting, the CLI runs
assertCartSanity— verifies the cart total is under $10 and contains exactly[1 card, 1 stamp, 0 other]. If a gift or add-on snuck in, the run aborts before any charge. --dry-runstops before the final submit button and reports cart state.- Card data is never written to disk, logs, or process.stdout. Errors
report
page.url()and the Stripe response preview but not the card.
Scope in v1
- US recipient only.
- Single Mother's Day folded card.
- No photo upload, no bulk orders.
- Postable's invisible reCAPTCHA on
/cartusually passes a real-browser Playwright session; if not, fall back to paying on Postable manually via the preview page's "Paying yourself?" link.
