#sreekanth_api

1 messages ¡ Page 1 of 1 (latest)

queen quailBOT
vale lodgeBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

queen quailBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1240559784613122121

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

mortal vortex
#

Hi

vestal abyss
#

Hello Sreekanth

mortal vortex
#

may i know the difference in the const subscription = await this.stripe.subscriptions.create({
customer: customer.id,
items: [{ price: priceId }],
payment_settings: {
payment_method_options: {
card: {
request_three_d_secure: 'any',
},
},
payment_method_types: ['card'],
save_default_payment_method: 'on_subscription',
},
expand: ['latest_invoice.payment_intent'],
}); and stripe checkout page const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [{
price: priceId,
quantity: 1,
}],
mode: 'subscription',
success_url: 'http://localhost:3000/success.html',
cancel_url: 'http://localhost:3000/cancel.html',
});

#

they both do samething ?

vestal abyss
#

No ideally subscriptions.create is used to create a recurring subscription and checkout.sessions is used for one time checkout

mortal vortex
#

but we using mode:'subscription' in the checkout right

queen quailBOT
#

@vestal abyss looks like you're in the wrong place, this thread is for someone else's question.

Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.

tropic ruin
#

The differences between Subscription API and Subscription mode on Checkout Session is the UI of payment method collection

#

With Subscription API, Payment Element (embedded into your website) can be used to collect the payment method details

With Subscription mode on Checkout Session, Stripe hosted payment page will be used ot collect the payment method details

#

Both will create the subscription and have the invoices for future billing

mortal vortex
#

is it possible to create subscription in the server side if user has saved card?

tropic ruin
mortal vortex
#

that means stripe.subscriptions.create will be used in server side as per doc ?

tropic ruin
#

Yes, correct!