用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aiskillstore/marketplace --skill stripe-handler命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | stripe-handler |
| description | Handle Stripe payments, custom checkouts, and webhook fulfillment outside of standard plans/credits. |
| deps | ["plans-handler","credits-handler","inngest-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).
checkout.session.completed for custom metadata.src/app/api/webhooks/stripe/route.ts for non-standard events.Before writing code, determine the nature of the payment:
plans-handler.credits-handler.You need a server-side endpoint to create the Stripe Checkout Session.
src/app/api/app/orders/create/route.ts) or Server Action.import stripe from "@/lib/stripe";metadata to the session to identify the purchase type in the webhook.
metadata: {
type: "my_custom_feature",
userId: user.id,
customId: "..."
}
${process.env.NEXT_PUBLIC_APP_URL}/app/subscribe/success?session_id={CHECKOUT_SESSION_ID}${process.env.NEXT_PUBLIC_APP_URL}/app/subscribe/errorAll Stripe events go to src/app/api/webhooks/stripe/route.ts.
src/app/api/webhooks/stripe/route.tsonCheckoutSessionCompleted (for one-time) or handleOutsidePlanManagementProductInvoicePaid (for invoices).metadata from the event object.metadata.type matches your custom feature.Recommended for production: If your fulfillment logic involves multiple DB calls, external APIs, or could timeout (Stripe expects a response in < 3s):
inngest-handler to create a new function.await inngest.send({ name: "app/payment.custom_succeeded", data: { sessionId: object.id, metadata } });
src/inngest/functions/....orders, courses).url (Stripe Checkout).stripe listen to test webhooks locally.See reference.md for code snippets on creating sessions, handling webhooks, and using Inngest.