#TheUchi007-events-fulfillment

1 messages · Page 1 of 1 (latest)

wintry cape
#

However, when I subscription is renewed, payment_intent.succeeded is no longer called
payment_intent.succeeded should still fire if the Payment Intent attached to the subscription's invoice is successful.

Do you have an example where this wasn't the case?

young jetty
#

Yes. I am using the clock simulation feature that Stripe has, and that is how I am triggering the renewal. Attached is a screenshot of the events that happened during that time

#

Anything on 13:43 is what happened during the renewal

#

UPDATE

#

Ok, so it seems that the payment_intent.succeeded happens intermittently. Sometimes it gets called, sometimes it doesn't. Is there a reason for this?

wintry cape
#

Can you copy/paste the Event id for an event where a renewal event had an underlying payment intent succeed, but the event was not sent as a webhook?

young jetty
#

Hmmm not sure if this helps, but according to my log, when this event was called:

evt_1LUwSzLDvlb4rPYaYjuii2EC

During that chain, there was never a payment_intent.suceeded

#

That event I posted is for a invoice.payment_succeeded

#

Also, I just got an instance in which no events even fired up. Again, this is all from the clock simulation part, so not sure if this is a bug, or if this has the potential to happen on a real scenario

wintry cape
#

Taking a look now

#

And do you have a payment_intent.succeeded event that fired for a renewal?

young jetty
#

Sorry for late reply. Yes

#

Lemme get you the event ID

#

evt_3LUwvBLDvlb4rPYa0MBlkbo7

worn gazelle
#

Thank you. two-shoes had to step out but I can check in to that event in a minute

young jetty
#

Awesome, thanks

worn gazelle
#

Looking to see if I can see more on that...

young jetty
#

Ah ok, so it did happened, it just didn't go through.

#

Is it because it is a local CLI?

#

Also, what event, essentially, would trigger whenever a successful payment is made and added to Stripe?

#

It is my assumption that it is payment_intent.succeeded,but want to make sure

#

Like, what event will always trigger upon a successful payment

worn gazelle
#

I am not sure why this didn't send but yes payment_intent.succeeded is typically the cannonical event to use for when payments succeed (unless you are on an older integration that only uses charges)

#

Can you try again with the CLI still running to see if you don't receive it again? I am still not sure why you didn't get it here

young jetty
#

Ok, let me try to usethe testclock again

#

Ok, everything went through without a hitch

#

My main concern is that, if this happens on production, it could cause me some issues with the referral system

#

Like, an event not triggering I mean

worn gazelle
#

In production you should always get these events. This was very likely CLI or test clock weirdness

#

And even here we logged when the event didn't send properly, so the event would be resent until your endpoint responds as per our retry logic

young jetty
#

Ah ok, got it. Yeah, I get intermittent results still on local

worn gazelle
#

Have you seen this lack of event for other events or just this payment_intent.succeeded event?

young jetty
#

Yes, tho I don't really need them for now, but I sometimes don't get transfer.created

#

I can see the transfer did went through because I can see that balance added to the connect account

#

but I sometimes just don't get that event being triggered

#

It is worth noting that this issue is happening only when I test the renewal

#

First time payment on a sub works perfect

#

As well as a normal payment

worn gazelle
#

Gotcha, from what I can see, Stripe is always generating these events so not receiving them may be network related or some similar break in the chain down the line. I will consult my colleagues on debugging intermittent CLI issues like this and will try to get back to you with next steps

young jetty
#

Ok, so it might have been on my side. After doing troubleshooting and such, I found that I don't always get the customer ID on all events

#

Everytime an event comes, I try to retrieve the customer ID data

#

most specifically, the metadata

worn gazelle
#

Ah so it is erroring out if that value isn't present?

young jetty
#

and since it not always had it, I kept getting an error

#

yup

worn gazelle
#

Good catch

young jetty
#

I just fixed it and it seems to work well now

worn gazelle
#

Nice!

young jetty
#

I thought the customer ID was always present, so I kinda left it as is

#

now I left a conditional and seems to be working fine now

#

5 tests in a row, and all green

#

sweet!

#

Sorry about this lol I should've spotted that earlier