#-7he-judge-_best-practices

1 messages ยท Page 1 of 1 (latest)

stable hollowBOT
#

๐Ÿ‘‹ 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.

ancient socket
#

Hello
What exactly is the question?

north temple
#
  1. I can have some different type of products (subscription/one-time) in my checkout
    I handle it via stripe.paymentIntents.create
  2. I load PaymentElement there
  3. 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

ancient socket
#

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

#

So you can add the one-time price as an Invoice item which will then group that purchase with the Subscription under one invoice

north temple
#

should I follow the guide above?

stable hollowBOT
ancient socket
north temple
#

well, the main aim is using subscriptions.create with property add_invoice_items?

ancient socket
#

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

north temple
#

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?

ancient socket
#

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?

north temple
#

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)
ancient socket
pallid ledge
#

๐Ÿ‘‹ changing of the guard. I'll be taking over the thread.

#

Let me know if those steps make sense for you.

stable hollowBOT