#sir4ndr3w_best-practices

1 messages ยท Page 1 of 1 (latest)

analog drumBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

tropic oyster
#

What specifically is your use case?

hidden wedge
#

Im currently building the checkout flow. So a person has selected the amount of users and license type (like "pro" or "base") and they get to the final checkout page where you enter your credit card details and coupons. And upon changing coupons or adding them I want to show the final price that will be deducted monthly

#

And currently I am creating quotes to compute the total but I was wondering if there is a more efficient way, as you have a limited amount of quotes

tropic oyster
#

When you apply the coupons, are they Stripe objects that you're applying directly to a subscription (or similar)? Or are you just discounting the price in your UI before any call to Stripe?

hidden wedge
#

Im applying them to quotes ๐Ÿ™‚

#

Should I do it solely in the UI or is there a matching stripe endpoint?

tropic oyster
#

Any opposition to using the Checkout Session API? That way the subscription creation is (and coupon application) is deferred until after they've committed to purchase and having provided payment details via the UI

#

It'll handle the line item/amount computation for you when the customer applies the coupon, and you can render that in your own custom UI

hidden wedge
#

Yes, I was using the Checkout Session before hand but I wanted to do it customized because we need the Company Name for the billing adress and I couldnt get the form fields in the hosted UI to include that.

#

What requests is the hosted UI using to preview the final price though?

tropic oyster
#

Yes, that guide I sent uses ui_mode: 'custom' and doesn't come with any prebuilt UI components so you can design the checkout UI exactly as you need and use Payment Element to collect the card details

hidden wedge
#

Ah, last time I checked that was still in beta

tropic oyster
tropic oyster
hidden wedge
#

Okay, then I will give that another go. Many thank

tropic oyster
hidden wedge
#

I think that is used to actually create new discounts, but I only need to apply already existing ones

tropic oyster
#

No, that's to apply discounts to the session if line items change (e.g. quantity updates and you want to apply 20% off or something)

#

It might not be relevant, you can still apply discount when you create the session

hidden wedge
#

Okay I see, I will try the custom checkout session again

tropic oyster
#

Let us know if we can help with anything