#scif_docs

1 messages ยท Page 1 of 1 (latest)

dark oceanBOT
#

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

amber templeBOT
random dust
#

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?

outer tundra
#

Hi Ivan! Even voided invoice does count attempt as used/applied

random dust
#

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?

outer tundra
#

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

random dust
#

Yes, PaymentIntents only accept the final amount.

#

And do customers pay on your own website? Or Hosted invoice page?

outer tundra
#

I create an invoice and supply client_secret to FE and my FE use confirm[Card|Sepa|Upi|โ€ฆ]Payment()

random dust
outer tundra
#

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?

random dust
#

I understand. That's why another option is to use Stripe Checkout which is not supposed to waste the coupon.

outer tundra
#

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?

outer tundra
random dust
outer tundra
#

Yep, that's correct

random dust
#

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.

dark oceanBOT
barren fable
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

outer tundra
#

Hi @barren fable , thanks for handling my question. I'm still curious whether subscriptions waste coupon attempts in the same fashion as invoices?

barren fable
#

I would guess so since subscriptions use invoices

outer tundra
#

I know but I thought an invoice is created for the subscription once the payment is collected

#

I could be wrong ๐Ÿ™‚