stripe-integration

v2026.09.24

Stripe payment integration with Node.js SDK. Covers Checkout Sessions, Payment Intents, Subscriptions, Customer Portal, webhooks, and Stripe Elements. Use when implementing checkout flows, payment processing, subscription billing, webhook handlers, or payment forms with Stripe Elements. Use for stripe, payments, checkout, subscriptions, billing, webhooks, payment intents, stripe elements.

GitHub
Install command
npx skhub add oakoss/stripe-integration
Markdown
SKILL.md

Stripe Integration

Overview

Stripe provides a complete payments platform with server-side SDKs (Node.js) and client-side libraries (Stripe.js, React Stripe.js). The Node.js SDK handles server operations like creating Payment Intents, managing Subscriptions, and verifying webhooks. The React Stripe.js library provides pre-built UI components (PaymentElement, Elements provider) for secure client-side payment collection.

When to use: One-time payments, recurring subscriptions, usage-based billing, marketplace payouts, hosted checkout pages, custom payment forms, webhook-driven fulfillment.

When NOT to use: Cryptocurrency payments (not supported), regions where Stripe is unavailable, simple static product sales without payment processing (use a hosted storefront).

Quick Reference

PatternAPIKey Points
Hosted checkoutstripe.checkout.sessions.create()Stripe-hosted page, supports payment, subscription, setup modes
Payment Intentstripe.paymentIntents.create()Server-side, returns client_secret for client confirmation
Confirm paymentstripe.confirmPayment({ elements, clientSecret })Client-side, requires Elements instance
Create subscriptionstripe.subscriptions.create()Use payment_behavior: 'default_incomplete' for SCA
Update subscriptionstripe.subscriptions.update()Set proration_behavior explicitly
Cancel subscriptionstripe.subscriptions.cancel()Use prorate: true to credit unused time
Customer Portalstripe.billingPortal.sessions.create()Self-service billing management, returns short-lived URL
Webhook verifystripe.webhooks.constructEvent()Requires raw body, signature header, and endpoint secret
Elements provider<Elements stripe={stripePromise} options={options}>Wraps payment components, pass clientSecret or mode
PaymentElement<PaymentElement />Renders all supported payment methods automatically
Retrieve + expandstripe.checkout.sessions.retrieve(id, { expand })Expand nested objects to reduce API calls
Searchstripe.paymentIntents.search({ query })Stripe Query Language for filtering

Common Mistakes

MistakeCorrect Pattern
Parsing webhook body as JSON before verificationUse express.raw({ type: 'application/json' }) to pass raw body to constructEvent
Hardcoding payment method typesUse automatic_payment_methods or let Checkout choose based on currency and region
Creating PaymentIntent client-sideCreate on server, pass only client_secret to client
Not awaiting elements.submit() before confirmCall elements.submit() first to trigger validation, then confirmPayment
Missing return_url in confirmPaymentAlways provide return_url for redirect-based payment methods
Using test keys in productionStore keys in environment variables, validate STRIPE_SECRET_KEY prefix (sk_live_ vs sk_test_)
Not handling requires_action statusCheck PaymentIntent status after confirmation, handle 3D Secure or other authentication
Creating Customer Portal session without settingsSave portal settings in Dashboard first, otherwise API returns an error
Not expanding related objectsUse expand parameter to include nested objects like latest_invoice.payment_intent
Ignoring webhook idempotencyUse event.id to deduplicate, webhook events can be delivered more than once

Delegation

  • Payment flow architecture: Use Explore agent to discover integration patterns
  • Webhook debugging: Use Task agent for end-to-end event tracing
  • Code review: Delegate to code-reviewer agent for security review of payment handlers

References

Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

Not specified

Source path

skills/stripe-integration

Default branch

main

Latest commit

85e3a39

Tree SHA

a4c9e7b