#jtishler-invoice-trial

1 messages · Page 1 of 1 (latest)

pale siren
#

hello, can you share the Invoice ID of an example?

vagrant egret
#

in_1Lb8gCCr1cvUccnXA0lpleO9

peak root
#

👋

#

stepping in here as hmunoz had to step away

#

Taking a look

#

Hmm yeah you will need to listen for a payment method attachment in this case if you want to reliably know a card was added

vagrant egret
#

what event is that? and is there a way to distinguish subscriptions from one time purchases?

peak root
#

You only are about this for Subs I would assume

#

In that case, yeah the payment_method.attached won't be the best event

#

What you could do instead would be to listen for customer.subscription.updated

#

That should fire when the default_payment_method is no longer null due to the SetupIntent confirmation

vagrant egret
#

gotcha

#

that event seemed pretty broad from the documentation and there wasnt a lot there on how to distinguish specific scenarios

#

such as first purchase from renewal

peak root
#

For renewal versus first purchase you would look at the status and the previous_attributes to determine that.

vagrant egret
#

ah i see - thanks that's very helpful!