#makasmi-webhook-invoice-paid

1 messages · Page 1 of 1 (latest)

fossil acorn
#

Hi there!

#

So you need the PaymentIntent for this.

#

Can I ask why you decided on invoice.paid versus listening to payment_intent.succeeded?

#

It can work either way (though you may need extra requests), but just curious.

lime rampart
#

Because i didn't receive this event , i only received thoses events for the second recurring payment:

fossil acorn
#

Hmm interesting. What API version are you using?

#

Oh ignore that

#

It says at the top there that your endpoint is on 2020-08-27

#

Was this a $0 invoice?

#

To make this easier actually could you provide me that invoice.payment_succeeded event?

#

The event ID I mean

lime rampart
#

ok

#

"id": "evt_1LbvX7JjSYM2P8eWZ48KB47z",

#

it's just an invoice test

#

the payment_intent.succeeded event is returned for the first recurring payement but in the second automaic payment , i didnt receive itt

fossil acorn
#

Ah okay yeah so that is a $0 invoice

#

Which is why you don't see a payment_intent.succeeded

#

It is also why you won't have a PaymentIntent ID at all

lime rampart
#

ah okey so i can use both invoice.paid or payment_intent.succeeded

#

to get informations about the second third ... recurring payments

fossil acorn
#

Yep every successful payment that isn't $0 will fire a payment_intent.succeeded event

lime rampart
#

Thanks very much

fossil acorn
#

If you are just looking to ingest data about a Subscription renewing then you likely want customer.subscription.updated

#

Sure thing! Let me know if I can help further!

lime rampart
#

i m looking for the payment id , amount and user for next payments (from the second) to save them intto my database

#

so i will use payment_intent.succeeded and search the field tto differenciate between one-time payment and recurring payment

fossil acorn
#

The reason you want to use this event is it will be all-encompassing

#

It will fire any time the Subscription renews, so whether it is a $0 payment or not $0.

#

The reason this is better than invoice.payment_succeeded is that you can also use it to monitor the Subscription status.

#

For instance, if the Subscription does renew for 2nd payment but it fails, then you won't get a invoice.payment_succeeded and you want to know that the customer hasn't paid for the renewal successfully and handle that accordingly.

lime rampart
#

Great so i will use first customer.subscription.updated . Thanks a lot for your help and your time

fossil acorn
#

Happy to help!

lime rampart
#

why in my last reccuring payment i didn't receive customer.subscription.updated

fossil acorn
#

Ah because that wasn't a renewal

#

That invoice was generated due to a cancellation

lime rampart
#

it was the last one

#

okey it's clear

#

Thanks very much