Created
November 19, 2020 02:17
-
-
Save OmarKhattab/367bee585510973eea68a7bfa2d4ca13 to your computer and use it in GitHub Desktop.
stripe checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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