Stripe.Checkout reference
CreateCheckoutSession
Section titled “CreateCheckoutSession”Source:
src/Stripe/CreateCheckoutSession.ts
Create a Stripe Checkout Session over HTTP. This is how a Worker starts
a purchase: create the session for a Price, then redirect the buyer to
session.url. Stripe hosts the payment page and sends
checkout.session.completed when it succeeds.
Account-scoped — binds the API key onto the host, not a specific resource.
CreateCheckoutSession: Starting a subscription checkout
Section titled “CreateCheckoutSession: Starting a subscription checkout”const createCheckout = yield* Stripe.CreateCheckoutSession();
// inside a Worker routeconst session = yield* createCheckout({ mode: "subscription", line_items: [{ price: price.id, quantity: 1 }], customer: customerId, success_url: `${origin}/welcome`, cancel_url: `${origin}/pricing`,});// redirect to session.urlCreateCheckoutSessionHttp
Section titled “CreateCheckoutSessionHttp”Source:
src/Stripe/CreateCheckoutSessionHttp.tsKind: Layer · Provides:Stripe.CreateCheckoutSession
HTTP implementation of CreateCheckoutSession. Provide it on the
Function or Worker Effect.
PaymentLink
Section titled “PaymentLink”Source:
src/Stripe/PaymentLink.ts
A Stripe Payment Link — a shareable URL that opens a hosted Checkout
page. Requires at least one lineItems price. Quantity, metadata,
active, and most Checkout options update in place; changing the set
of prices replaces the link. Payment links cannot be deleted; destroy
deactivates them (active=false).
PaymentLink: Creating a Payment Link
Section titled “PaymentLink: Creating a Payment Link”One-time price
const product = yield* Stripe.Product("pro-plan", { name: "Pro Plan" });const price = yield* Stripe.Price("pro-once", { product: product.id, currency: "usd", unitAmount: 2000,});const link = yield* Stripe.PaymentLink("buy", { lineItems: [{ price: price.id, quantity: 1 }],});Promotion codes and a confirmation message
const link = yield* Stripe.PaymentLink("buy", { lineItems: [{ price: price.id, quantity: 1 }], allowPromotionCodes: true, afterCompletion: { type: "hosted_confirmation", hostedConfirmation: { customMessage: "Thanks for your order." }, }, metadata: { campaign: "launch" },});PaymentLink: Updating a Payment Link
Section titled “PaymentLink: Updating a Payment Link”const link = yield* Stripe.PaymentLink("buy", { lineItems: [{ price: price.id, quantity: 2 }], active: false, inactiveMessage: "This link is no longer available.", metadata: { campaign: "paused" },});RetrievePaymentLink
Section titled “RetrievePaymentLink”Source:
src/Stripe/RetrievePaymentLink.ts
Retrieve a bound Stripe Payment Link over HTTP.
RetrievePaymentLink: Reading a Payment Link
Section titled “RetrievePaymentLink: Reading a Payment Link”const retrieve = yield* Stripe.RetrievePaymentLink(checkout);const live = yield* retrieve();RetrievePaymentLinkHttp
Section titled “RetrievePaymentLinkHttp”Source:
src/Stripe/RetrievePaymentLinkHttp.tsKind: Layer · Provides:Stripe.RetrievePaymentLink
HTTP implementation of RetrievePaymentLink. Provide it on the
Function or Worker Effect.