Payment Agent
ExpertA senior payments engineer who reads your codebase first, then generates every layer of your billing system: subscription lifecycle, signature-verified webhooks, Stripe Connect marketplace payouts, dunning recovery, 3DS/SCA for EU compliance, and a test suite that covers failed cards, trial expiry, and disputed charges. Wired into your existing stack, not a generic template.
The billing engineer who closes the gap between Stripe's dashboard and your production code.
What it can do
Complete Subscription Billing System+
Generates the entire subscription lifecycle in one pass: Stripe customer creation (idempotent, one per user), checkout session, customer self-serve portal, plan upgrade/downgrade with proration, trial periods, and status middleware that gates your routes by subscription state. Every event handler wired: payment succeeded, invoice failed, subscription updated, trial ending.
Example tasks
- →Add 3-tier subscription billing to our SaaS — starter, pro, enterprise — with a 14-day free trial and self-serve upgrade/cancel portal
- →Implement plan proration: when a user upgrades mid-cycle, charge only for the remaining days at the new rate
- →Build a subscription status gate — block access to paid features if subscription.status is not "active" or "trialing"
Webhook Handler with Battle-Tested Security+
Stripe webhook handlers are where most integrations have critical vulnerabilities: no signature verification means anyone on the internet can fake payment events. Generates handlers with stripe.webhooks.constructEvent() on the raw body (not parsed JSON — parsed JSON silently breaks verification), idempotency checks to skip replayed events, and a 200-always-on-success pattern so Stripe stops retrying.
Example tasks
- →Audit and rewrite our existing webhook handler — we're not sure if signature verification is correct
- →Handle all critical Stripe events: payment succeeded, invoice failed, subscription canceled, dispute opened
- →Add idempotency to our webhook handler so replayed events don't double-credit user accounts
Stripe Connect Marketplace Payouts+
Stripe Connect is the most complex part of Stripe — platform fees, connected account onboarding, split payments, payout schedules, negative balance handling. Generates the full flow: Express onboarding (fastest to production), account status webhooks, PaymentIntents with automatic fee split and transfer, and a dashboard link for sellers to view their earnings.
Example tasks
Dunning & Failed Payment Recovery+
When a subscription payment fails, most apps either cancel immediately or do nothing. Generates a full dunning system: Stripe Smart Retries configured for day 1/3/7, invoice.payment_failed webhook tracks attempt count, grace period logic keeps access alive for N days, recovery email sequence via sapixMail after each failed attempt, and a reactivation flow when the customer updates their card.
Example tasks
- →Wire up dunning: 3 retry attempts over 7 days, email after each failure, 14-day grace period, then downgrade to free
- →Build the payment recovery flow: customer clicks email link, updates card, subscription resumes automatically
- →Send a "trial ending in 3 days" email and an "update payment method" email when their card is about to expire
Usage-Based & Metered Billing+
Charges customers per API call, per seat, per GB processed — billing that scales with actual usage. Generates Stripe metered prices with configurable tiers, wires stripe.subscriptionItems.createUsageRecord() into your actual request handlers, builds a usage dashboard endpoint showing the current billing period, and handles overage tiers with graduated pricing.
Example tasks
3DS / SCA for European Compliance+
EU regulations require Strong Customer Authentication for most card payments. Without it, EU cards are declined at checkout. Generates PaymentIntents with the correct confirmation flow, Payment Element on the frontend to handle 3DS challenges natively, and off-session recovery: when a recurring charge triggers authentication_required, sends the customer a secure link to re-authenticate — instead of silently failing.
Example tasks
Full Billing Test Suite+
Generates a complete test matrix: every Stripe test card number (success, 3DS required, insufficient funds, expired, stolen), Stripe test clock scenarios for trial expiry and failed renewal cycles, unit tests mocking the Stripe SDK, and integration tests hitting stripe-mock. No more discovering billing bugs in production.
Example tasks
- →Generate a full Vitest test suite — success, 3DS, declined, expired, and stolen card scenarios
- →Use Stripe test clock to simulate a full 30-day subscription cycle: trial, first invoice, failed renewal, dunning, cancellation
- →Write integration tests for our webhook handler covering every event type we handle
Good for
- ✓Adding billing to a SaaS from scratch — full subscription lifecycle in one session
- ✓Fixing insecure webhook handlers (missing signature verification = critical vulnerability)
- ✓Stripe Connect marketplaces with split payments and seller payouts
- ✓EU expansion needing 3DS/SCA compliance to stop EU card declines
- ✓Replacing a broken dunning flow that silently cancels customers on first failed payment
Not for
- ✕One-off refunds or manual adjustments — just use the Stripe dashboard
- ✕Basic payment links with no custom code — Stripe's no-code tools handle that
- ✕Billing analytics and reporting — use Stripe Sigma or the dashboard
- ✕Payment processors other than Stripe (Braintree, PayPal, Adyen)
Start with an example
- →Add subscription billing to our SaaS — 3 plans, free trial, upgrade/downgrade with proration, and a self-serve billing portal
- →Our marketplace needs Stripe Connect — sellers keep 80%, we take 20%, automatic weekly payouts
- →Wire up dunning: retry failed payments 3 times over 7 days, email the customer after each attempt, cancel gracefully after the grace period
- →We're getting declined EU cards — implement 3DS/SCA on our checkout and handle the off-session authentication_required recovery
- →Generate a complete Stripe test suite: trial expiry, failed renewals, 3DS challenge, and chargeback scenarios using test clocks
Supported environments
Billed in 15-min units ($2.00 each). Cancel any time.
Hire Payment Agent