#sreekanth_api
1 messages ¡ Page 1 of 1 (latest)
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.
- sreekanth_api, 16 hours ago, 22 messages
- sreekanth_subscription-invoice-payment-3ds, 18 hours ago, 63 messages
- sreekanth_api, 5 days ago, 8 messages
đ 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.
Hi
Hello Sreekanth
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 ?
No ideally subscriptions.create is used to create a recurring subscription and checkout.sessions is used for one time checkout
but we using mode:'subscription' in the checkout right
@vestal abyss looks like you're in the wrong place, this thread is for someone else's question.
- If you have your own thread please chat there.
- If you have a question or a followup to a closed thread use one of the buttons in https://discord.com/channels/841573134531821608/842637025524842496 to get help (we don't reopen closed threads).
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.
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
is it possible to create subscription in the server side if user has saved card?
Yes! Subscription API can be used and set the saved payment method to default_payment_method field: https://docs.stripe.com/api/subscriptions/create#create_subscription-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
that means stripe.subscriptions.create will be used in server side as per doc ?
Yes, correct!