#impactfx

1 messages · Page 1 of 1 (latest)

sly vesselBOT
round stirrup
#

Hello 👋
You can't add a discount to an invoice if it has been finalized already.
Taking a step back, what's the usecase here? Why do you want to apply the discount after the PaymentIntent has been created specifically?

astral sedge
#

Ok let me explain

#

The user enters all there information, and is presented with the payment screen to enter there credit card. Inorder to do this we created the payment intent and use the stripe elements

#

But on that screen we want to show a "Add coupon" UI

#

We dont want the coupon code to be BEFORE the credit card screen

#

This is were we are stuck now, because if the invoice is finalized.. we can't do anything

#

Why can we not create subscription payment intents with a non finalized invoice?

round stirrup
#

Gotcha.

Why can we not create subscription payment intents with a non finalized invoice?
That's how the underlying API works unfortunately. When you create a subscription, it creates an invoice for the amount underneath.

Thinking of an alternative..

astral sedge
#

An alternative would be amazing if you have one.

A suggestion long term would be to allow the subscription.create method support a invoice
auto_advance=False method, so the invoice is not finalized. and thus, it could be edited.

round stirrup
astral sedge
#

this becomes a bit of a headache as i wouldnt know if this was a "first" subscription signup or there monthly renewal

#

There is no other options? how do other people normally do this.. cause adding a coupon before payment is a very common thing

round stirrup
astral sedge
#

ah ok. And if i set auto advanced
do i manually have to finalize the invoice or will stripe do it again onpayment intent complete?

round stirrup
#

I believe you'll need to finalize it when you apply the discount

astral sedge
#

ok, but then i run into an issue if they want to undo the coupon and apply a different one this whole logic becomes a bit of a nightmare

#

I feel this solution is pretty limited, cause id have to have my webhooks all working locally everytime i wanna test this etc.

Very confused that this is such a headache considering coupons are used alot in the flow we are doing things

round stirrup
#

That might help with your usecase

astral sedge
#

ya that would work

#

do i need to enroll in beta

round stirrup
#

Yeah you'll need to reach out to support for that

astral sedge
#

ah ok

#

Thanks for your help Ill reach to them.
might need to do something different until then unfortuantely