#scif_docs
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/1221750852180639805
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
No, this doesn't sound right. Let me check...
I see the coupon is applied to an Invoice at creation. I believe, since you can attempt to pay an Invoice multiple times, it's expected that the coupon is redeemed. Are you creating a new Invoice for every payment attempt?
Hi Ivan! Even voided invoice does count attempt as used/applied
Yes, I guess that was the intention, since unlike simple PaymentIntent payments, if an Invoice was created then, in most cases, the customer is obliged to pay.
Do you always need to create Invoices for your use case?
Yes, it's much easier to track discounts/apply application fee/track status of purchase rather than for PI
I remember there was unable to establish the connection between PI and something else: coupon or price
Yes, PaymentIntents only accept the final amount.
And do customers pay on your own website? Or Hosted invoice page?
I create an invoice and supply client_secret to FE and my FE use confirm[Card|Sepa|Upi|โฆ]Payment()
You can use Stripe Checkout that also supports Prices/Products, and can accept coupons: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=stripe-hosted
Yep, the platform supports both Stripe.Checkout and our own one.
There is a really loop here:
To be able to get a final amount, I need to: get price object, apply a coupon, calculate application_fee and invoices make these jobs but you advice me to make all these actions and use PI which makes invoices totally useless here ๐ฆ
Does it mean that created subscription acts the same and wastes attempt even though if payment will not collected?
I understand. That's why another option is to use Stripe Checkout which is not supposed to waste the coupon.
Any chance I can adjust my flow? Like to unlink a coupon from the invoice on receiving a webhook invoice.updated marking the invoice as uncollectible?
What's about this question? ^
Are you creating it directly via API?
Yep, that's correct
It doesn't seem like you can update max_redemptions for a coupon: https://docs.stripe.com/api/coupons/update
As a workaround you can maybe track the redemptions on your side, or via metadata field. And only update it if the payment goes through.
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hi @barren fable , thanks for handling my question. I'm still curious whether subscriptions waste coupon attempts in the same fashion as invoices?
I would guess so since subscriptions use invoices