Skip to content

ericrisco/rsc-harness / skills/stripe

stripe

Verified

Use when wiring an app to Stripe for payments, subscriptions, Checkout, webhooks or the billing portal — adding a paywall or paid plan, charging recurring fees, and debugging why a completion event never fires, why signature verification fails, or why a webhook fires twice and duplicates the order. NOT a generic non-Stripe inbound event receiver (that is `webhooks`), NOT the invoice document's legal form (that is `invoicing`), NOT deciding what to charge (that is `pricing`).

FileKindSize
SKILL.mdskill md11.6 KB
evals/README.mdmarkdown707 B
evals/cases.yamlconfig2.8 KB
references/going-live.mdmarkdown2.7 KB
references/webhook-events.mdmarkdown3.3 KB
scripts/verify.shexecutablescript4.7 KB

references/going-live.md

View on GitHub
# Going live — production hardening

The Checkout/webhook code is the easy part. These are the things that bite in
production.

## Test → live cutover

- Test and live mode have **separate keys, separate webhook endpoints, separate
  signing secrets, and separate data**. Nothing crosses over.
- Create the live webhook endpoint in the dashboard; copy its **own**
  `whsec_…`. The CLI secret from `stripe listen` is for local only.
- Swap keys via environment/secret manager, never by editing code. A `sk_live_`
  literal in source is a drainable credential.

## Restricted API keys

Do not run the server with the account's unrestricted secret key. Create a
**restricted key** granting only the resources you touch (e.g. write on
Checkout Sessions, Customers, Subscriptions; read on Prices). If it leaks, blast
radius is bounded. Rotate it on suspicion of exposure.

## Webhook secret rotation

When rotating a webhook signing secret, Stripe lets you keep the old secret
valid during a roll window. Verify against both during the overlap, then drop
the old one. Never log the secret or the raw signature header.

## Idempotency keys

Every create call that a retry could duplicate (`checkout.sessions.create`,
`subscriptions.create`, `customers.create`) takes an `idempotencyKey`. Derive it
from the operation (`checkout:${userId}:${planId}`), not `Math.random()`, so a
genuine retry collides and Stripe returns the original result instead of making
a second object.

## SCA / 3DS

Strong Customer Authentication and 3D Secure are handled for you by Checkout and
the Payment Element — that is a core reason to prefer them over hand-rolled
PaymentIntents + cards. Don't reimplement the authentication dance.

## Test clocks

To exercise renewals, trials ending, and dunning without waiting real days,
attach a Customer to a **test clock** and advance time. This is the only sane
way to test the multi-day subscription lifecycle.

## PCI scope

With Checkout (Stripe-hosted) or the Payment Element, card data never touches
your server, keeping you in the lightest PCI tier (SAQ A-class). Raw card
numbers hitting your backend escalate scope dramatically — don't.

## Pre-launch checklist

- [ ] `apiVersion` pinned in the client.
- [ ] Live keys/secret in env, not code; test literals gone.
- [ ] Live webhook endpoint created; its own signing secret wired.
- [ ] Event subscription restricted to the allowlist you actually handle.
- [ ] Restricted API key in use on the server.
- [ ] Idempotency keys on all create calls.
- [ ] Webhook handler verifies signature, returns 2xx fast, dedupes on `event.id`.
- [ ] Access gated on `subscription.status`, refreshed by webhooks.
- [ ] Tested the renewal/dunning path against a test clock.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall