मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)33k · #8802

stripe-integration

यह क्या करती है

यह स्किल आपके एजेंट को किसी ऐप या वेबसाइट में Stripe भुगतान जोड़ने में मार्गदर्शन देती है। इसमें checkout, सब्सक्रिप्शन और webhooks शामिल हैं, और ऑर्डर खोने या keys लीक होने से बचने के कदम भी।

कब इस्तेमाल करें

  • ✓जब आप अपनी वेबसाइट या ऐप में checkout, सब्सक्रिप्शन या बिलिंग जोड़ना चाहते हैं।
  • ✓जब आपको Stripe webhooks सेट करने हों ताकि ऑर्डर भरोसेमंद तरीके से पक्के हों।
  • ✓जब आप मौजूदा भुगतान कोड में गलतियाँ या सुरक्षा कमियाँ जाँचना चाहते हैं।

Skill का लिंक

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/stripe-integration/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/stripe-integration/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी ऑनलाइन दुकान के लिए Stripe Checkout सेट कीजिए और पक्का कीजिए कि भुगतान webhook से कन्फ़र्म हों।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट Stripe के मौजूदा मार्गदर्शन का पालन करता है, आपके मामले के लिए सही भुगतान तरीका चुनता है, और idempotency व restricted API keys जैसी जाँच लागू करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Stripe Integration

Guidance for building payment code that does not lose orders, double-charge or leak keys. It follows Stripe's own recommendations as of October 2026. When a detail matters (a parameter, an event name, an API version), check docs.stripe.com or the Stripe MCP server's search_stripe_documentation tool before relying on memory.

Versions

  • Latest API version: 2026-09-30.endive. Pin it explicitly on the client so an account default change never alters response shapes under you.
  • Latest server SDKs: Node.js 23, Python 16, Ruby 20, PHP 22, Java 34, Go 87, .NET 53. Create a client instance; the global key pattern (stripe.api_key = …, Stripe.setApiKey) is deprecated in every SDK.
  • To move an existing integration to a newer version, read Upgrading your API version first.
// lib/stripe.ts
import Stripe from 'stripe';

export const stripe = new Stripe(process.env.STRIPE_API_KEY!, {
  apiVersion: '2026-09-30.endive',
});

Choose the API

Building Use
One-time payment, simple product Payment Links (no code) or Checkout Sessions
One-time payment in your web app Checkout Sessions (hosted or embedded)
Custom payment form Checkout Sessions with ui_mode: 'custom' + Payment Element
Save a card for later Setup Intents
Charge off-session (no customer present) Payment Intents with a saved payment method
Subscriptions, seats, trials Billing APIs + Checkout mode: 'subscription' + Customer Portal
New usage-based billing Metronome (Stripe's usage platform), not raw Billing Meters
Marketplace or platform Connect, Accounts v2 (/v2/core/accounts), Stripe-hosted onboarding

Never use the Charges API, Sources API, Tokens API, Card Element or the plan object. They are deprecated or legacy; use the rows above and Prices.

Rules

Fulfill from webhooks, never from the success page

A customer can pay and close the tab before the success page loads. Grant access, send email and write orders only in the webhook handler.

  • Handle checkout.session.completed and checkout.session.async_payment_succeeded. Fulfill only when session.payment_status !== 'unpaid'. Delayed methods (bank debits) send completed while still unpaid.
  • Handle checkout.session.async_payment_failed for those failures.
  • Subscriptions need customer.subscription.created|updated|deleted, invoice.paid and invoice.payment_failed. Renewals, dunning and cancellations only reach you this way.
  • Webhooks are required before launch, not a follow-up.

Verify every webhook signature on the raw body

Signature verification needs the exact bytes Stripe sent. Body-parsing middleware breaks it.

// Next.js App Router: app/api/stripe/webhook/route.ts
import Stripe from 'stripe';
import { stripe } from '@/lib/stripe';

export async function POST(req: Request) {
  const body = await req.text(); // raw body, do not use req.json()
  const signature = req.headers.get('stripe-signature');
  if (!signature) return new Response('missing signature', { status: 400 });

  let event: Stripe.Event;
  try {
    event = stripe.webhooks.constructEvent(
      body,
      signature,
      process.env.STRIPE_WEBHOOK_SECRET!,
    );
  } catch {
    return new Response('invalid signature', { status: 400 });
  }

  switch (event.type) {
    case 'checkout.session.completed':
    case 'checkout.session.async_payment_succeeded': {
      // Re-fetch instead of trusting the payload snapshot.
      const session = await stripe.checkout.sessions.retrieve(event.data.object.id);
      // fulfillOrder must be idempotent: the same event can arrive twice.
      if (session.payment_status !== 'unpaid') await fulfillOrder(session.id);
      break;
    }
    case 'checkout.session.async_payment_failed':
      await markPaymentFailed(event.data.object.id);
      break;
  }
  return new Response(null, { status: 200 });
}
  • On Cloudflare Workers, Deno or Bun use await stripe.webhooks.constructEventAsync(...).
  • In Express, mount express.raw({ type: 'application/json' }) on the webhook route only, before any global express.json().
  • In live mode Stripe retries for up to three days and can deliver an event more than once or out of order. Make fulfillOrder idempotent (store processed event or session IDs with a unique constraint) and decide by the object's current state, not by event order
अक्सर पूछे जाने वाले सवाल

क्या इसमें रिफ़ंड भी शामिल हैं?

हाँ। विवरण में checkout, सब्सक्रिप्शन, customer portal और Stripe Tax के साथ रिफ़ंड भी शामिल हैं।

यह secret keys को कैसे संभालती है?

स्किल keys उजागर होने से चेतावनी देती है और restricted API keys की सलाह देती है।

क्या यह सलाह अप-टू-डेट है?

स्किल बताती है कि वह अक्टूबर 2026 तक के Stripe मार्गदर्शन का पालन करती है, और एजेंट को कहा गया है कि जब कोई विवरण मायने रखे तो Stripe के docs जाँचे।

जानकारी

लेखक का मूल विवरण

Build or review a Stripe integration with current Stripe guidance: Checkout Sessions, Payment Element, Setup Intents, subscriptions and the Customer Portal, webhook-driven fulfillment, idempotency, restricted API keys and Stripe Tax. Use when: stripe, payments, checkout, subscription, billing, webhook, refund, payment intent.

repo: davila7/claude-code-templates

लोकप्रियता

GitHub स्टार
33k
रैंकिंग में स्थान
#8802
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

owasp-security

33k

आपके एजेंट को वेब ऐप, API, मोबाइल, कंटेनर और AI एजेंट्स के लिए OWASP सुरक्षा मार्गदर्शन सिखाती है, ताकि वह आम कमज़ोरियाँ पहचान सके और सुधार सुझा सके।

कोडिंगसिक्योरिटी

agent-management

33k

आपके एजेंट को AI Maestro कमांड-लाइन से AI एजेंट बनाने, सूची देखने, hibernate और wake करने, नाम बदलने और हटाने देती है, हर एजेंट के जीवन-चक्र को संभालते हुए।

AI और एजेंटएजेंट

agent-messaging

33k

Agent Messaging Protocol का उपयोग करके AI एजेंट्स के बीच हस्ताक्षरित संदेश भेजने, प्राप्त करने और उनका जवाब देने देती है, ज़्यादातर आपकी अपनी मशीन पर।

AI और एजेंटएजेंट

docs-search

33k

आपके एजेंट को फ़ंक्शन सिग्नेचर, क्लास परिभाषा और कमेंट के लिए ऑटो-जनरेटेड कोड डॉक्यूमेंटेशन खोजने देती है, ताकि कोड बदलने से पहले वह असली API जाँच सके।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills