#TheUchi007-events

1 messages ยท Page 1 of 1 (latest)

queen basin
#

Hi ๐Ÿ‘‹ could you clarify what you're referring to when you say "charge type"? I just want to make sure we're aligned.

karmic haven
#

Ok, so when I get to the payment_intent.succeeded event type, I can get some details on what the payment was for. It might not be charge type exactly, so I apologize if it isn't, but I do get a piece of info of what the payment was for. Whenever I buy a subscription, it returns "Subscription creation".

#

So my question is if I will always get that during payment_intent.succeeded, regardless of whether the subscription payment is for a new one, or renewing one

queen basin
#

Would you mind checking what field it is that you're referring to? I'm afraid you're relying a field such as description that is an arbitrary value that is set by your integration.

karmic haven
#

Ah ok, got it. And yeah, it is the description one, sorry. Is a property named description on the event that is returning that

#

Is that something I have control over, all the way to payment_intent.succeeded event?

queen basin
#

Yup, description is a field that you have control over.

If you're looking to take action for subscription based payments, then I would recommend listening to invoice.payment_succeeded instead. It will only be triggered for Invoice payments rather than all payments, and all Subscriptions will use Invoices. Additionally the Invoice object has a reference to the related Subscription.

karmic haven
#

Ah really? That is great! Thank you so much, I will try that!

#

that invoice.payment_succeeded will only be upon successful charge, right? In other words, it will only happen if a charge was successful and the payment goes through, right?

#

I just want to make sure it happens only when a user successfully makes a payment

queen basin
#

Correct, invoice.payment_failed is triggered if the payment is not successful.

karmic haven
#

Awesome. I just tried it and it works super awesome! Thank you so much!

#

Having that subscription info in the event object really makes it so reliable to know if the payment was for a sub, or just a normal one

#

Thank you much!

queen basin
#

Awesome, glad to hear that was helpful ๐Ÿ˜„