#adambutler-sub-coupon
1 messages · Page 1 of 1 (latest)
Hey! That's interesting use case
My assumption is that this is the expected behaviour as we always assume that an invoice will be paid. In this case that invoice amount will reflect the promotion code usage and therefore technically 'redeeemed'
The actual solution here is to store the Payment Intent and/or client_secret from that invoice in state and then attempt to re-confirm it when the same user returns, as opposed to creating a new subscription
@visual crow We could reuse the same incomplete subscription but this is no longer valid on the following day for instance. Stripe transitions the subscription to incomplete_expired after 23hrs without payment. However, I believe the coupon redemption still remains.
Hi! I'm taking over this thread.
Yes that makes sense. You could listen to customer.subscription.updated to be notified when a subscription becomes incomplete_expired. However it looks like it's not possible to update the max_redemptions of the coupon.
However, I believe the coupon redemption still remains.
I just tested this with test clocks, and I confirm that the redemption remains.
So the only option I see is to not use Stripe's max_redemptions, and keep track of this number on your end.
Thanks, I had come to the same conclusion before messaging here to be honest. I was hoping there would be a more elegant solution though.
I think I might have to utilise the metadata to set an artificial max redemptions value and as you've suggested track this myself.