{"_id":"@cards-for-agents/checkout","name":"@cards-for-agents/checkout","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@cards-for-agents/checkout","version":"0.1.0","description":"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.","license":"MIT","type":"module","bin":{"cards-for-agents-checkout":"dist/cli.mjs"},"scripts":{"build":"node scripts/build.mjs","prepublishOnly":"node scripts/build.mjs","postinstall":"node -e \"if (!process.env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD) { try { require('child_process').execSync('npx playwright install chromium', {stdio:'inherit'}); } catch (e) { console.warn('[postinstall] run npx playwright install chromium manually if you hit Executable doesn\\'t exist'); } }\""},"engines":{"node":">=18"},"keywords":["mcp","agent","postable","greeting-card","claude-code"],"homepage":"https://cards-for-agents.com","repository":{"type":"git","url":"git+https://github.com/nicogoldberg1-rgb/postable-card-agent.git","directory":"packages/checkout"},"dependencies":{"playwright":"1.48.0"},"devDependencies":{"@types/node":"^20.0.0","esbuild":"^0.24.0","typescript":"^5.6.0"},"_id":"@cards-for-agents/checkout@0.1.0","bugs":{"url":"https://github.com/nicogoldberg1-rgb/postable-card-agent/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-XtvLVLf0En4JYgJ/FfU/EabJ6AyzgZ/pDQO+Qu6kQin1LeY/D2idjbIt1G9I7Yjj4ZAdi2orS/yeo3pwdYh14w==","shasum":"b1c3299426351eb38feeb227a58c4f9ce0718a00","tarball":"https://registry.npmjs.org/@cards-for-agents/checkout/-/checkout-0.1.0.tgz","fileCount":3,"unpackedSize":24942,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDfrUZdZMBkovBzpw/x9jT+GwUVW3Jm1HKouV0F9z2hvgIhANk7jHlAMsZKx965O2FMUXaqSm642ycFAj6Nt1j8AzQm"}]},"_npmUser":{"name":"nicolasgoldberg","email":"nicogoldberg1@gmail.com"},"directories":{},"maintainers":[{"name":"nicolasgoldberg","email":"nicogoldberg1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/checkout_0.1.0_1776983176106_0.6605899299068902"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T22:26:15.971Z","0.1.0":"2026-04-23T22:26:16.245Z","modified":"2026-04-23T22:26:16.584Z"},"maintainers":[{"name":"nicolasgoldberg","email":"nicogoldberg1@gmail.com"}],"description":"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.","homepage":"https://cards-for-agents.com","keywords":["mcp","agent","postable","greeting-card","claude-code"],"repository":{"type":"git","url":"git+https://github.com/nicogoldberg1-rgb/postable-card-agent.git","directory":"packages/checkout"},"bugs":{"url":"https://github.com/nicogoldberg1-rgb/postable-card-agent/issues"},"license":"MIT","readme":"# @cards-for-agents/checkout\n\nLocal Playwright-driven Postable checkout for\n[cards-for-agents](https://cards-for-agents.com) orders.\n\nDesigned to be invoked by an agent with bash access (Claude Code, Cursor,\nWarp Agent, etc.) to finish an order end-to-end **without routing card data\nthrough any server.** Card details flow: your terminal → this CLI → local\nPlaywright → Stripe's iframe on Postable's page. Our servers never see them.\n\n## Install / run\n\nYou don't install — your agent runs it on demand:\n\n```\nnpx @cards-for-agents/checkout --order-id <uuid>\n```\n\nFirst run downloads Chromium (~140 MB). Subsequent runs start in ~2 seconds.\n\n## Passing card details\n\nTwo equally safe options. Pick whichever fits your agent.\n\n### Env vars\n\n```\nCFAC_CARD_NUMBER=4432522629186373 \\\nCFAC_CARD_EXP=08/26 \\\nCFAC_CARD_CVC=434 \\\nCFAC_CARD_NAME='Nicolas Goldberg' \\\nCFAC_CARD_ZIP=94123 \\\nnpx @cards-for-agents/checkout --order-id <uuid>\n```\n\n### Stdin (JSON)\n\n```\necho '{\"number\":\"4432...\",\"exp\":\"08/26\",\"cvc\":\"434\",\"name\":\"Nicolas Goldberg\",\"zip\":\"94123\"}' \\\n  | npx @cards-for-agents/checkout --order-id <uuid> --card-stdin\n```\n\n## Flags\n\n- `--order-id <uuid>` — required. The order to finish (from `POST /v1/orders`).\n- `--api <url>` — override the API base. Default `https://api.cards-for-agents.com`.\n- `--dry-run` — walk through the Postable flow but stop before clicking **Place order**. No charge. Useful for first-run validation.\n- `--headed` — show the browser while it drives (for debugging).\n- `--card-stdin` — read card JSON from stdin instead of env vars.\n\n## End-to-end flow\n\n1. **Compose the order** via `https://cards-for-agents.com`'s REST or MCP\n   (search_cards → create_order → set_card → compose_message →\n   set_recipient → set_sender). Keep the order id.\n2. **Preview the order** (optional but recommended). Open\n   `https://api.cards-for-agents.com/preview/<id>?token=<token>` and verify.\n3. **Run this CLI.** It calls `GET /v1/orders/<id>/plan` to fetch the\n   composed data, drives Postable in a local Playwright browser, declines\n   any gift upsells, asserts the cart contains exactly `[1 card, 1 stamp]`,\n   types the card into Stripe, submits.\n4. **Output** — JSON on stdout with the confirmation URL, detected order\n   number, and raw Stripe/Postable submit responses.\n\n## Safety guards\n\n- Before submitting, the CLI runs `assertCartSanity` — verifies the cart\n  total is under $10 and contains exactly `[1 card, 1 stamp, 0 other]`.\n  If a gift or add-on snuck in, the run aborts before any charge.\n- `--dry-run` stops before the final submit button and reports cart state.\n- Card data is never written to disk, logs, or process.stdout. Errors\n  report `page.url()` and the Stripe response preview but not the card.\n\n## Scope in v1\n\n- US recipient only.\n- Single Mother's Day folded card.\n- No photo upload, no bulk orders.\n- Postable's invisible reCAPTCHA on `/cart` usually passes a real-browser\n  Playwright session; if not, fall back to paying on Postable manually via\n  the preview page's \"Paying yourself?\" link.\n","readmeFilename":"README.md","_rev":"1-765b63392b45af0a16783ff708ac0c41"}