plugins/game-dev/engineering/stripe-game-payments/SKILL.md
Use when implementing game payments, in-app purchases, subscriptions, Stripe webhooks, or monetization flows. Triggers: payments, IAP, subscription, Stripe, checkout, webhooks, monetization.
npx skillsauth add fcsouza/agent-skills engineering-stripe-game-paymentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In-app purchases, subscriptions, consumables, webhooks, idempotency, and fraud prevention for games using Stripe.
Trigger: payments, Stripe, IAP, in-app purchase, subscription, premium, battle pass, virtual currency, webhook, checkout, monetization
postgres-game-schema (player accounts, inventory, currency tables)betterauth-integration (authenticated player sessions)Sid Meier: "A game is a series of interesting decisions." Monetization should enable interesting decisions, not replace them.
bun add stripe
Use boilerplate/stripe-setup.ts to initialize the Stripe SDK, sync your product catalog, and link Stripe customers to player accounts.
Start with templates/product-catalog.ts to define your product types (consumable, subscription, currency bundle, cosmetic) and map them to Stripe price IDs and game rewards.
Use boilerplate/checkout.ts to create Stripe Checkout sessions for one-time purchases, subscriptions, and premium currency bundles. Always attach player metadata.
Implement boilerplate/webhooks.ts for signature verification, idempotent event processing, and two-phase fulfillment. Route events to typed handlers defined in templates/webhook-events.ts.
After recording a purchase, dispatch a fulfillment job via BullMQ (see bullmq-game-queues). The worker grants the items, currency, or subscription entitlement.
Listen for charge.refunded and charge.dispute.* events. Revoke granted rewards, deduct premium currency, and flag the player account for review.
Log every payment event with an audit trail. Track fulfillment status (pending, fulfilled, revoked) and alert on anomalies.
import { createCurrencyBundleCheckout } from './checkout';
const session = await createCurrencyBundleCheckout({
playerId: 'player_123',
priceId: 'price_premium_1000',
quantity: 1,
successUrl: 'https://game.example.com/store/success',
cancelUrl: 'https://game.example.com/store',
});
import { createSubscriptionCheckout } from './checkout';
const session = await createSubscriptionCheckout({
playerId: 'player_123',
priceId: 'price_battle_pass_monthly',
successUrl: 'https://game.example.com/pass/success',
cancelUrl: 'https://game.example.com/pass',
});
import { handleStripeWebhook } from './webhooks';
app.post('/webhooks/stripe', async ({ request }) => {
const sig = request.headers.get('stripe-signature')!;
const body = await request.text();
await handleStripeWebhook(body, sig);
return new Response('ok', { status: 200 });
});
See boilerplate/stripe-setup.ts for client configuration, boilerplate/checkout.ts for session creation, boilerplate/webhooks.ts for event handling, and templates/product-catalog.ts for product definitions.
betterauth-integration for authenticated player sessions and Stripe customer linkingpostgres-game-schema for purchase records, inventory, and currency tablesbullmq-game-queues for async fulfillment job dispatch and processinggame-economy-design for pricing strategy and currency balance designSid Meier: Monetization should enable interesting decisions, not replace them. A well-designed payment system gives players meaningful choices about how they engage with content. Premium currency buys time, not power. A battle pass rewards engagement, not spending. Fair monetization respects player skill and time investment — the best purchases enhance the experience without gating core gameplay.
tools
Use when implementing client-server state synchronization, delta compression, optimistic updates, rollback netcode, or real-time game state reconciliation. Triggers: state sync, netcode, delta, rollback, interpolation, prediction.
testing
Use when designing virtual economies, currencies, sink/faucet balance, loot tables, crafting systems, shops, or inflation control. Triggers: economy, currency, sinks, loot, inflation, crafting, shop.
development
Audits existing game code against design principles — checks server-authority, schema conventions, auth security, payment safety, narrative coherence, and MVP scope drift. Extract the optional component name or path from the user's message (defaults to entire src/). Use after building components or before committing.
testing
Designs a single quest end-to-end — coherence check, objective tree, quest brief, and registry entry. Extract the quest name from the user's message. Requires docs/world-lore.md and docs/quest-registry.md.