#ibrahim menem-subscriptions

1 messages ยท Page 1 of 1 (latest)

cerulean oyster
#

๐Ÿ‘‹ happy to help

#

but I'm not sure if it's really the right thing to do

#

what events are you listening to in your webhooks?

solid eagle
#

not sure, we first started listening to payment_intent.failed then changed to invoice.payment_failed

cerulean oyster
#

yes the invoice.* events are the ones you should be listening to

#

I don't know how you would be able to pre-auth unless you do a separate PaymentIntent to place a hold on the card.

solid eagle
#

so the pre-auth doesn't sound like a good practice?

#

what would be the ideal workflow?
1 - update subscription
2 - if inovice.payment_failed happens
3 - revert the subscription update with new update

cerulean oyster
#

sorry I was just made aware of a feature we have

#

but there are other ways of achieving this as well

#

you could do something like a normal Payment Intent where you collect the money

#

then you create a Customer Balance with that amount

#

and once that's done, you update the subscription which will create a new invoice. Stripe will then use the Customer Balance to pay that invoice

#

those are really the 3 options I could think of

#

like 2 I thought of and one came from my colleague ๐Ÿ™ˆ

solid eagle
#

oh the last one sounds interesting and robust ๐Ÿ™‚ so we charge, transfer the money to stripe then update the subscription

#

thank you and to your colleague

#

is any of them considered better practice than the others?

cerulean oyster
#

the one about pending-updates is I think the official way of doing it

solid eagle
#

I'll investigate that first then, but probably end up implementing the last one

#

to create a customer balance does it require an api call? or just the payment intent is enough?

cerulean oyster
#

yes you'd have to call the API for that

solid eagle
#

thank you very much thankyou