Skip to content

Instantly share code, notes, and snippets.

@OmarKhattab
Created November 19, 2020 02:17
Show Gist options
  • Save OmarKhattab/367bee585510973eea68a7bfa2d4ca13 to your computer and use it in GitHub Desktop.
Save OmarKhattab/367bee585510973eea68a7bfa2d4ca13 to your computer and use it in GitHub Desktop.
stripe checkout
const customer = await stripe.customers.create();
const { id } = customer
const session = await stripe.checkout.sessions.create({
customer: id,
payment_method_types: ["card"],
mode: "setup",
success_url: `${host}/stripe-checkout-status?success=true`,
cancel_url: `${host}/stripe-checkout-status?errors=true`,
});
const checkoutSessionID = session.id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment