1.1 KiB
1.1 KiB
Checkout API
Serverless Stripe Checkout integration for the Agentic Engineering course.
Deploy
Cloudflare Worker (recommended)
npm install -g wrangler
cd api
wrangler deploy checkout.js --name checkout-api
wrangler secret put STRIPE_SECRET_KEY
Vercel
cd api
vercel deploy --prod
vercel secrets add STRIPE_SECRET_KEY sk_live_...
Standalone
export STRIPE_SECRET_KEY="sk_live_..."
node checkout.js
# Listens on port 8787
Price IDs
Create these products in Stripe Dashboard, then update site/checkout.md with the real price IDs:
| Product | Amount | Stripe Price ID |
|---|---|---|
| Self-Paced | $97 | price_self_paced → replace with real ID |
| Enterprise | $199 | price_enterprise → replace with real ID |
| Cohort | $247 | price_cohort → replace with real ID |
How It Works
- User clicks "Buy" → redirected to
/checkout?plan=self-paced - Frontend calls
/api/checkoutwith the price ID - API creates a Stripe Checkout Session
- User is redirected to Stripe's hosted checkout page
- After payment, user is redirected to
/checkout/success