#saurabh_best-practices

1 messages ¡ Page 1 of 1 (latest)

haughty ravineBOT
#

👋 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/1288779968771264533

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

humble radish
#

hello! I'm sorry, I don't understand what you're asking.

ruby python
#

in stripe for subscriptions, we create subscription then a invoice object is associated with that subscription

#

in similar way, a payment object is associated with that invoice, and there is a client secret in payment object

#

we use that client_secret to go to the payment page from frontend

#

but now i want to apply coupons on that payment page

#

??

humble radish
ruby python
#

if I pass the 100%off coupon while creating subscription then a 0$ invoice is generated but no payment object is associated with that invoice and also that invoice is already paid.

humble radish
#

correct, yes.

ruby python
#

in that case i can't pass any client_secret to my frontend team to go to payment page

#

it will break my flow

humble radish
#

then you should fix your flow to not rely on the guranteed presence of a PaymentIntent on the Invoice.

#

if you'd still like to collect details in this case, there is a subscription.pending_setup_intent.client_secret that can be used, for example.