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).
Creating a Payment Link
Section titled “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" },});Updating a Payment Link
Section titled “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" },});