#noah-classdojo_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.
- noah-classdojo_api, 3 hours ago, 6 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/1245129022074126436
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there!
That's correct, the PaymentElement can't be used with a coupon. When rendering a PaymentElement, that means you're working directly with PaymentIntents, which rely on amount only
Coupons can only be used when working directly with Prices and Products, which you're not really doing when integrating directly with the PaymentElement
Thanks for confirming - so am I correct in understanding that if we want to show a user a payment page (happy for it to be a PaymentElement or a Stripe session), it is impossible to have both custom content rendered (which we have been doing alongside our payment element) and a coupon?
Perhaps I am missing something we could be doing in a stripe checkout session?
By custom content, do you mean a separate form/input fields of yours?
Let's take a step back. What's your ultimate goal here and where are you blocked?
thanks
Here's a naive version of today's payment element, with custom content on top that we want to render alongside the user's payment
Today we achieve this with a payment intent created on our backend, which sends a client secret to the frontend, and we render our content above the payment element which is hydrated with the client secret
However - we cannot integrate coupons into this form
The custom content is just information about the class the user plans to book - no custom form inputs
The options that I can imagine would be:
- coerce this to work by adding our own coupons, validating them, then updating the paymentIntent with a new price. Not great, we dont get any info on coupon redemptions
- figure out how to get our UI from that screenshot (unique to each purchase) into a stripe checkout page
- something else?
Please let me know if I can clarify anything ^^
You could explore Embedded Checkout: https://docs.stripe.com/checkout/embedded/quickstart
You can add your content above or below the Checkout Session that is embedded within a div on your page
Since it's still Checkout under the hood, you can make use of promotion codes and have that all still tie back to Prices and coupon redemptions that Stripe tracks
Oh, interesting! That's new to me
If you're really keen on using Coupons on Stripe (vs. having to generate IDs yourself, having to keep track of redemptions, validation, etc.), Checkout (Stripe hosted or embedded) is really your only option
my editor is suggesting that ui_mode isnt available, I'd guess its a newer feature and I'd need to bump my stripe version
I'm intrigued by this embedded option, that may be the middleground that I was looking for
Embedded Checkout was released October 2023 in case you're curious
Ok, we are on stripe 13, so I'll need to do a major version bump. This is worth exploring, and potentially solves the problem
The other alternative you listed is the only other option I'd consider: keeping track of your own coupons then either updating the PaymentIntent with the new price or opting to use the deferred intent flow (where you create the PaymentIntent after rendering the PaymentElement) - https://docs.stripe.com/payments/accept-a-payment-deferred