More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Stripe Integration: Payments and Subscriptions

    1

    Integrate Stripe so it survives production: hosted-checkout-first flow selection, webhook-driven state, idempotent handlers, an explicit subscription lifecycle, SCA, and a test matrix.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Stripe Integration: Payments and Subscriptions

    Stripe Integration: Payments and Subscriptions

    Example session with this skill installed

    We're adding subscriptions to our SaaS — monthly and annual plans, a 14-day trial, and we want checkout to look native in our app. What should we build, and in what order?

    • Read your context and instructions
    • Compiled the stripe integration

    INTEGRATION PLAN — produced by applying the skill.

    Flow decision: you asked for native-looking checkout, which points at embedded elements — your page, Stripe's card inputs. Recorded trade: you own the surrounding logic, which is exactly the work below. (If native look turns out to be negotiable, hosted checkout deletes most of it; "we might want flexibility later" would not justify raw Payment Intents.)

    Build order, state model first:

    1. Webhook endpoint before any checkout UI. Signature verification against the raw body — route it around your framework's JSON parser, which is the classic reason verification fails in production. Handlers idempotent on event ID behind a unique constraint; unknown event types logged, never dropped.
    2. Subscription state machine in your database: trialing, active, past_due, canceled, with transitions driven only by webhook events. Every access check reads this state. No isPro boolean — it goes stale at the first failed renewal.
    3. Boundary decisions, encoded now: trial ends with no card → downgrade to free tier at trial end, no grace (your call, but make it now); first renewal charge fails → past_due, dunning emails, access continues through Stripe's retry window, cancels when retries exhaust.
    4. Embedded checkout on top, creating the subscription in trialing. The success page is a courtesy screen only — it confirms nothing; the webhook does.
    5. SCA path: expect authentication-required as a pause-and-resume, tested explicitly, or your European signups fail silently.
    6. Nightly reconciliation job diffing your subscription table against Stripe's, alerting on drift.

    Test matrix before launch (scripted, not clicked): happy path, hard decline (no order created), authentication-required completes, insufficient funds → past_due → retry succeeds, same webhook fired twice changes nothing, subscription.updated arriving before its invoice.paid leaves consistent state, full lifecycle trial → active → past_due → canceled.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most Stripe integrations work in the demo and break in production — and the breakage is never the API. It's the state model around it: duplicate webhooks, payments that succeeded at Stripe but never recorded locally, subscriptions that drift from the dashboard until a customer complains. This skill builds the integration around those failure modes from the start. It opens with a flow-selection decision table keyed to who owns the UI — hosted checkout by default (smallest PCI and maintenance burden), embedded elements when design demands it, raw Payment Intents only for genuinely custom money movement — with a decision point that calls out "flexibility we might need later" as a non-reason. Then the core discipline: webhooks are the source of truth, not the redirect. The handler protocol covers signature verification against the raw body (and the framework body-parsing trap that breaks it), idempotency keyed on event IDs behind a uniqueness constraint, loose ordering with tolerance for out-of-order events, logging unknown event types instead of dropping them, and a nightly reconciliation job that diffs local subscription state against Stripe's — because webhooks give eventual correctness and reconciliation makes it guaranteed. Subscriptions get modeled as a state machine (trialing, active, past_due, canceled) instead of a cached isPro boolean, with a boundary-decisions table forcing the product calls — trial ends with no card, downgrade mid-cycle, retries exhausted — to be encoded before launch rather than during an incident. SCA is handled as a resumable flow, not an error. The deliverables are concrete: a worked webhook handler in pseudocode with an incident walkthrough showing the pieces interlocking, a scripted eight-case test matrix (including duplicate delivery and out-of-order events), an edge-cases section, anti-patterns, and a launch checklist as the quality gate.

    • It covers the card-payments and subscriptions core. Marketplace payouts (Connect), metered usage at high volume, and tax filing each add their own models on top of this foundation.
    • Boundary decisions (grace periods, proration, revocation timing) are product and policy calls — the skill forces them to be made explicitly but cannot make them for you.
    • Stripe's API and event set evolve; the protocol (verify, idempotency, reconcile) is stable, but event names should be confirmed against the current docs for your API version.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 24 days ago

    Permissions

    No special permissions declared or detected

    Listed24 days ago
    Updated21 days ago

    What's inside

    Frequently Asked Questions

    Because the redirect path works until it doesn't: a closed tab, a dropped connection, or a failed renewal three months later all leave Stripe and your database disagreeing, and the failure surfaces as a paying customer locked out — or a non-paying one with access. The skill's incident walkthrough shows the renewal case: nothing about the original checkout helps you there. Webhooks plus reconciliation are what make state correct on day 90, not just day one.

    For most products, yes — it carries the smallest PCI burden, handles tax, discounts, and saved methods, and its only real cost is the redirect and less visual control. The decision table in the skill graduates you to embedded elements when the design requirement is concrete, and reserves raw Payment Intents for money movement that genuinely can't be expressed otherwise. Choosing more surface area than you need is a permanent maintenance commitment.

    It's the single most reliable predictor of billing bugs. The flag is set once, at signup, and nothing updates it when a renewal fails, a trial lapses, or a subscription cancels — so access decisions drift further from reality every month. The fix the skill prescribes is mechanical: a four-state lifecycle table updated only by webhook events, with access checks reading the state. Most teams can migrate in an afternoon; the boundary-decisions table is the part worth slowing down for.

    New in APIs & Backend