#bhavyacodes
1 messages ยท Page 1 of 1 (latest)
if you don't want to use a beta, then integrate with Elements instead.
yes, I wanna know which api to call exactly? earlier I was using createPaymentIntent and passing the client_secret to PaymentElement component on react frontend
what data should and to what component can I pass for subscription
sounds perfect
you use the PaymentIntent that comes from the Invoice of the Subscription
Yes but its null for some reason
const session = await stripe.checkout.sessions.create({
line_items: [
{
// Provide the exact Price ID (for example, pr_1234) of the product you want to sell
price: prods.basic.priceId,
quantity: 1,
// price_data
},
],
mode: "subscription",
success_url: `${process.env.DOMAIN}?success=true&userId=${userId}`,
cancel_url: `${process.env.DOMAIN}?canceled=true&userId=${userId}`,
});
console.log(session);
why are you creating a CheckoutSession?
that's not relevant here since you want to use Elements instead, so you'd use e.g await stripe.subscriptions.create(...) like the doc I linked, you wouldn't be using Checkout at all
okay, thanks @void sentinel i'll go through the steps and let you know if I face any other problem ๐
FWIW I do recommend using Checkout instead, it's much easier
if you're concerned about the beta of the embedded Checkout(you seemed very adamant about that in your first message), I wouldn't be, it's planned to come out of beta quite soon
My team leader is concerned, I can't do much about that
and user not leaving our website is a hard requirement
cool then sounds like embedded Checkout might be a good fit!