بنقرة واحدة
autumn-add-payments
Skill for adding Stripe checkout and payment flows using Autumn.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Skill for adding Stripe checkout and payment flows using Autumn.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when finishing a feature, fixing a bug, before committing React code, or when the user types `/doctor`, asks to scan, triage, or clean up React diagnostics. Covers lint, accessibility, bundle size, architecture. Includes a regression check and a full local-triage workflow that fetches the canonical playbook.
Git workflow for pushing code and opening pull requests on GitHub. ALWAYS use this before you git push, push to a remote, open or create a pull request, raise a PR, or "ship" code. Covers confirming the user actually asked to push, cutting a Conventional-Commits feature branch off main, writing a Conventional-Commit PR title, and using the repo's .github PR template as the body. Use whenever the user says push, ship, open/create a PR, raise a pull request, or commit-and-push.
Fetch official brand/product/tool logos (Stripe, GitHub, Notion, AWS, Figma, etc.) as clean SVGs from SVGL (svgl.app) — as saved .svg files, inline markup, or installed React components. Check this whenever logos or SVGs come up, e.g. adding brand marks to integration/partner rows, footers, pricing tables, or slides; replacing a blurry logo with a vector; getting light/dark variants; or finding an official logo. Prefer it over hand-writing SVG markup or grabbing random files. Skip for generic UI icons, illustrations, charts, favicons from an existing logo, or designing a brand-new custom logo.
Expert guidance for Satori, the library that converts JSX/HTML and CSS into SVG (the engine behind dynamic Open Graph images and social cards). Use whenever writing or debugging Satori markup e.g. authoring JSX for OG images, choosing CSS that Satori actually supports, fixing layout that renders wrong, embedding fonts, rendering emoji or images, or resolving Satori errors like "Expected length unit" or unsupported property issues. Reach for this any time someone renders HTML/CSS to SVG or PNG with Satori, even if they do not name it.
Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript. Use when the user asks about c15t setup, components, hooks, styling, cookie/consent UX, GDPR/CCPA/IAB TCF compliance, script or iframe blocking, GTM/GA4/PostHog/Meta integrations etc, or self-hosting c15t/backend.
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
| name | autumn-add-payments |
| description | Skill for adding Stripe checkout and payment flows using Autumn. |
Always consult docs.useautumn.com for code examples and latest API.
Autumn handles Stripe checkout, upgrades, downgrades, and cancellations automatically.
checkout - Returns Stripe URL (new) or preview data (returning customer)attach - Confirms purchase when card already on file| Field | Description |
|---|---|
url | Stripe checkout URL (null if card on file) |
product | Target product with scenario |
current_product | Customer's current product |
lines | Invoice line items |
total | Amount in major currency units |
currency | Currency code |
| Scenario | Meaning | Action |
|---|---|---|
new | Not subscribed | Subscribe |
active | Current plan | Current Plan |
scheduled | Scheduled | Already Scheduled |
upgrade | Higher tier | Upgrade |
downgrade | Lower tier | Downgrade |
renew | Cancelled | Renew |
import { useCustomer, usePricingTable } from "autumn-js/react";
const { checkout, attach } = useCustomer();
const { products } = usePricingTable();
// Checkout flow
const data = await checkout({ productId: "pro" });
if (data.url) {
window.location.href = data.url; // New customer
} else {
// Show confirmation dialog, then:
await attach({ productId: "pro" });
}
// Cancel
const { cancel } = useCustomer();
await cancel({ productId: "pro" });
// Or downgrade to free:
await attach({ productId: "free" });
import { Autumn } from "autumn-js";
const autumn = new Autumn({ secretKey: process.env.AUTUMN_SECRET_KEY });
// Checkout
const { data } = await autumn.checkout({ customer_id, product_id: "pro" });
if (data.url) return redirect(data.url);
// Attach (after user confirms)
await autumn.attach({ customer_id, product_id: "pro" });
// Get products with scenarios
const { data: productsData } = await autumn.products.list({ customer_id });
For seat-based or prepaid products, pass quantities:
await autumn.checkout({
customer_id,
product_id: "credits_pack",
options: [{ feature_id: "credits", quantity: 500 }],
});
function getButtonText(product: Product): string {
const { scenario, properties } = product;
if (properties?.has_trial) return "Start Trial";
if (scenario === "active") return "Current Plan";
const text = { upgrade: "Upgrade", downgrade: "Downgrade", new: "Subscribe" };
return text[scenario] ?? "Enable";
}
data.url, not data.checkout_urlproducts.list for scenariossuccess_url to redirect after Stripe checkout