#sir4ndr3w_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/1424670959914455170
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
What specifically is your use case?
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
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?
Im applying them to quotes ๐
Should I do it solely in the UI or is there a matching stripe endpoint?
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
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?
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
Ah, last time I checked that was still in beta
Completely internal APIs
Nope, it's GA now as of a few months
Okay, then I will give that another go. Many thank
Related discount stuff is in beta, but you should be able to get access easily: https://docs.stripe.com/payments/advanced/dynamically-update-discounts
I think that is used to actually create new discounts, but I only need to apply already existing ones
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
Okay I see, I will try the custom checkout session again
Let us know if we can help with anything