Payment FlowAI Workflow
Full Stripe checkout with email confirmation: creates the payment session, listens to the webhook, and automatically sends a receipt.
Prerequisites
Environment variables
STRIPE_SKSTRIPE_WEBHOOK_SECRETRESEND_KEYInstall
npx radzor@latest recipe add payment-flowAI Prompt
“Run `npx radzor@latest add stripe-checkout webhook-receiver email-send` to install 3 Radzor components. Then read components/radzor/stripe-checkout/radzor.manifest.json, components/radzor/webhook-receiver/radzor.manifest.json, components/radzor/email-send/radzor.manifest.json and each component's llm/integration.md. Wire them together to full Stripe checkout with email confirmation: creates the payment session, listens to the webhook, and automatically sends a receipt. Use the manifest's inputs (check envVar for required environment variables), outputs (check fields for object shapes), composability (check mapField for field extraction), and actions — don't invent custom interfaces.”
Paste this into Claude Code, Cursor, Windsurf, or any AI coding agent.
Pipeline
StripeCheckout
Creates the Stripe payment session
WebhookReceiver
Receives and verifies Stripe events
EmailSend
Sends a receipt to the customer
Scaffolded Code
// npx radzor@latest add stripe-checkout webhook-receiver email-send
import { StripeCheckout } from "./components/radzor/stripe-checkout"
import { WebhookReceiver } from "./components/radzor/webhook-receiver"
import { EmailSend } from "./components/radzor/email-send"
const checkout = new StripeCheckout({
secretKey: process.env.STRIPE_SK!,
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
successUrl: "/success",
cancelUrl: "/cancel",
priceId: "price_xxx",
})
const webhook = new WebhookReceiver({
secret: process.env.STRIPE_WEBHOOK_SECRET!,
algorithm: "sha256",
signatureHeader: "stripe-signature",
})
const mailer = new EmailSend({
provider: "resend",
apiKey: process.env.RESEND_KEY!,
from: "noreply@myapp.com",
})
// POST /api/webhook — verify signature, then handle event
async function handleWebhook(req: Request) {
const body = await req.text()
const signature = req.headers.get("stripe-signature") ?? ""
const event = webhook.verifyStripe(body, signature)
if (event.type === "checkout.session.completed") {
await mailer.send({
to: event.data.customer_email,
subject: "Payment confirmed",
html: `<p>Thank you! Your payment was received.</p>`,
})
}
}
// Create checkout session and redirect
const session = await checkout.createCheckout("customer@example.com")
// redirect user to session.urlComponents used
LLM tip
Pass all 3 radzor.manifest.json files to your agent at once. It will read the outputs of each step and match them against the inputs of the next — wiring the full pipeline without any extra instructions.