Use Cursor's browser aria snapshots to audit a page for accessibility issues — missing labels, broken tab order, contrast, and ARIA misuse.
中文简介正在准备中。当前显示原文说明。
Integrate Stripe payments into a web application, including checkout sessions, webhooks, and customer portal.
中文简介正在准备中。当前显示原文说明。
安装前可以查看交给 AI 代理的指令内容。
Use this skill when the user asks to add payments, billing, subscriptions, or Stripe integration.
Install the SDK
npm install stripe @stripe/stripe-js
Add environment variables
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
Create a Stripe client module — create lib/stripe.ts:
import Stripe from "stripe";
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: "2024-12-18.acacia",
});
Create a checkout API route — create an endpoint that creates a Stripe Checkout session:
const session = await stripe.checkout.sessions.create({
mode: "subscription", // or "payment" for one-time
payment_method_types: ["card"],
line_items: [{ price: priceId, quantity: 1 }],
success_url: `${origin}/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${origin}/pricing`,
customer_email: userEmail,
});
return redirect(session.url!);
Create a webhook handler — create a POST endpoint at /api/webhooks/stripe:
stripe.webhooks.constructEvent.checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_failed.Add customer portal (optional) — create an endpoint that redirects to stripe.billingPortal.sessions.create so users can manage their subscription.
Add pricing page UI — create a pricing page with plan cards that call the checkout API route.
stripe listen --forward-to localhost:3000/api/webhooks/stripe) for local webhook testing.stripe.prices.list to fetch prices dynamically instead of hardcoding them.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Use Cursor's browser aria snapshots to audit a page for accessibility issues — missing labels, broken tab order, contrast, and ARIA misuse.
中文简介正在准备中。当前显示原文说明。
Add PostHog analytics to a web application, including event tracking, page views, feature flags, and session replay.
中文简介正在准备中。当前显示原文说明。
Generate OpenAPI/Swagger documentation for an API, including endpoint schemas, request/response types, and interactive docs UI.
中文简介正在准备中。当前显示原文说明。
Add authentication to a web application using NextAuth.js (Auth.js), including OAuth providers, session management, and protected routes.
中文简介正在准备中。当前显示原文说明。
Dockerize an application with a production-ready Dockerfile, docker-compose setup, and .dockerignore.
中文简介正在准备中。当前显示原文说明。
Set up Playwright end-to-end testing in a project, including test configuration, example tests, and CI integration.
中文简介正在准备中。当前显示原文说明。