Stripe handler

From aiskillstore/marketplace · View interactive version

Stripe handler is an AI agent skill from the GitHub repository aiskillstore/marketplace. Handle Stripe payments, custom checkouts, and webhook fulfillment outside of standard plans/credits.

How to use this skill

Skill file

Stripe Handler

Use this skill when you need to implement payment logic using Stripe, specifically for use cases that are NOT standard SaaS subscription plans or standard Credit packages (which are handled by plans-handler and credits-handler respectively).

When to use

Process

1. Identify Payment Type

Before writing code, determine the nature of the payment:

2. Create Checkout Session (API/Action)

You need a server-side endpoint to create the Stripe Checkout Session.

```typescript

metadata: {

type: "my_custom_feature",

userId: user.id,

customId: "..."

}

```

3. Handle Webhook Fulfillment

All Stripe events go to src/app/api/webhooks/stripe/route.ts.

1. Extract metadata from the event object.

2. Check if metadata.type matches your custom feature.

3. If yes: Run your fulfillment logic.

4. If no: Let the function fall through to standard plan/credit handling.

4. Background Processing (Inngest)

Recommended for production: If your fulfillment logic involves multiple DB calls, external APIs, or could timeout (Stripe expects a response in < 3s):

```typescript

await inngest.send({ name: "app/payment.custom_succeeded", data: { sessionId: object.id, metadata } });

```

5. Database Updates

6. Frontend Integration

Best Practices

Reference

See reference.md for code snippets on creating sessions, handling webhooks, and using Inngest.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.