#notdpr
1 messages · Page 1 of 1 (latest)
I can provide example invoice, customer, and coupon test ids if that is helpful. Thanks!
hey there, yes can you please share an example invoice using this ID? It's possible that this comes down to the specific mechanisms of certain payments (ie, Indian cards have a unique flow for authentication).
Invoice in_0OHX8i87iriRUvvJq8zTzq7l
Coupon YWepZVjh
Alright, so I'd expect this to redeem the coupon because it was applied to the invoice. Do you have an example that did not get counted you can share for comparison?
I can make one real quick
Ah ha, ok, so I see in the other case it does not increment times_redeemed because attaching the payment method to the customer failed, so it doesn't get to the invoice creation. I missed that detail in my debugging. https://dashboard.stripe.com/test/logs/req_dO8pJOMygMC2EG
This is helpful to at least understand the difference.
My next question is... I wonder if there is a way to test/know if these payment failures will happen before creating the invoice and redeeming the coupon. It doesn't make sense to me that Stripe is redeeming the coupon if the payment fails. There must be a way for us to determine this failure before we waste a coupon redemption.
I guess I'm asking... should I be doing something different to avoid/prevent that coupon redemption in these India/etc payment cases?
Thank you!
yes, that is an important distinction, the attachment fails for most test decline cards beyond that special case one
Or put another way... is there a way I missing to avoid creating that invoice in these India cases... some other thing to test the ability to make the payment
I wonder if there is a way to test/know if these payment failures will happen before creating the invoice and redeeming the coupon.
Not really, because you have a chicken an egg problem between attempting payment and setting the final payment amount via the coupon
It doesn't make sense to me that Stripe is redeeming the coupon if the payment fails. There must be a way for us to determine this failure before we waste a coupon redemption.
It does because once you create the invoice (with the coupon) we expect it to be paid, ie your customer wes you money and you'll collect another payment method to complete that
That the payment failed does not change the invoice validity or amount owing
Gotcha... that makes sense... once the invoice is created. So, I guess I have to find a way to avoid creating the invoice.. or at least avoid paying it.
We void the invoice after the failure... wish that was enough to "get the coupon back"
Unfortunately, the api does not allow updating the coupon times_redeemed
It does not, no. If it ends up being applied to a coupon, that's a redemption
This would be really ugly in my current code path.... but do you know if I were to create a separate Charge with capture = false as an auth check... would that reliably fail the same way the invoice payment fails for these India cards? I really don't want to have to implement such a pre-flight, but if that is the only way
It does seem like a pitfall in the api (not releasing the redemption if the invoice is voided).. because it means that we cannot reliably offer max redemption on a coupon... a batch of failing India charges will essentially wipe out the coupon for others.... which is likely since the payment success rate in India seems really low
No we don't recommend using "test charges" like that -- I think either managing coupons separately for indian customers might be an option here. More carefully let you track redemptions on paid invoices, if thats what you want, then accumulate that against the other coupon and deactivate if the total goes over what you want.
Not ideal, not smooth, but that's the way it works, currently
I can share some feedback about providing options to skip or "uncount" redemptions for payment failures in some way