#-7he-judge-_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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/1422667714845216849
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- -7he-judge-_error, 51 minutes ago, 36 messages
- -7he-judge-_error, 9 hours ago, 12 messages
- -7he-judge-_best-practices, 5 days ago, 9 messages
- -7he-judge-_best-practices, 6 days ago, 24 messages
Hello
What exactly is the question?
It's continue of conversation to this chat
https://discord.com/channels/841573134531821608/1422608023074897970
- I can have some different type of products (subscription/one-time) in my checkout
I handle it viastripe.paymentIntents.create - I load
PaymentElementthere - After succeeded payment I have trigger in webhook for event, it checks. if subscription exists in my products list
it create subscription manually for customer,
BUT the main problem is one more additional transaction in my stripe dashboard
How could I do it without additional transaction?
btw, I have deffered payment
that allow me load PaymentElement without clientSecret
You can't have one-time products and Subscriptions show up under one transaction because they both work differently.
One-time purchases can be paid for using PaymentIntents directly.
With Subscriptions, it works a bit different. When you create a Subscription -> it creates an Invoice -> that Invoice then creates a PaymentIntent which is only specific to that particular invoice.
So if you create a PaymentIntent for one-time products + a Subscription separately then there will be two different PaymentIntents for each
With that said, we do allow you to add one-time price IDs (which only show up on one invoice) when you create a Subscription - https://docs.stripe.com/billing/invoices/subscription#first-invoice-extra
So you can add the one-time price as an Invoice item which will then group that purchase with the Subscription under one invoice
should I follow the guide above?
The doc I shared above is not an end to end guide.
Since you're using deferred intent flow, you'll need to combine the steps from that doc with this one - https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
Step 6 from this doc - https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription#create-intent will need to be changed according to https://docs.stripe.com/billing/invoices/subscription#first-invoice-extra with add_invoice_items parameter
well, the main aim is using subscriptions.create with property add_invoice_items?
Correct
That let's you bundle one-time price with a Subscription under one invoice
avoiding additional PaymentIntent creations
which I think is what you're asking about
But it's about subscription, but if I needed use only one time products on my checkout
but logic already wrote for subscription
what could you propose?
Not sure I understand.
If you have mixed items then you create a Subscription and use add_invoice_items
If you only have one-time products then just create a PaymentIntent?
no, look
I can sometimes change my products list for checkout
And I want to have scalable logic
working with these options:
- subscriptions (our discussion coveres it)
- one time (???)
- subscriptions + one time (our discussion coveres it)
For one-time purchases, you can just do - https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment
I'm not sure what's confusing you but @pallid ledge can help clarify if you explain where the disconnect is
๐ changing of the guard. I'll be taking over the thread.
Let me know if those steps make sense for you.