#CowLover24

1 messages ยท Page 1 of 1 (latest)

clever pilotBOT
errant jacinth
#

Let me check to make sure I understand. The subscriptions in stripe is active and customer payments are succeeding, but for some reason your own system are recording some other status?

kind perch
#

Yes, that is mostly accurate. It is strange because our customers put in their payment info and everything went successfully. They made their first payment and their subscription was active. And in our database, it also showed that their subscription was active. Now, their status has been switched to incomplete though. Sorry if this is confusing it is confusing to me as well. I just do not know how this happened. The only way our records change are through Stripe webhooks, so it had to of been changed as a result of that. don't hesitate to ask if more clarification is needed or any other details.

#

When I say now their subscription has been switched. I mean like a week or two after their first payment

errant jacinth
#

Do you have an example subscription ID i can look at?

#

I can only guess as to why your system would make such a change if we're not seeing any changes ourselves

#

You will likely need to work backwards to determine what is causing your subscription tracking to make these changes

#

Then if that's driven by something unexpected then we can dig into that

kind perch
#

Here is an example subsription ID: sub_1MZeQlL5D7Gm20cBtbYgcqA1

#

This user has an active subscription on stripe, but suddenly in our records their status has been switched to incomplete. This hd to of been done through a webhook call. Not sure why tho.

errant jacinth
#

There don't appears to have been any events since the initial sign up, so I've not sure why you'd have that happen

#

That's the event showing the active subscription following checkout completion

kind perch
#

this is what we have stored is this the same response?

#

sorry its ugly to look at

errant jacinth
#

OK, i think i have an idea of what happened here

kind perch
#

awesome!

errant jacinth
#

During checkout, several events happen in quick succession, and they are likely arriving/processing out of order (this is expected and documented)

#

this has status incomplete

#

My records show you got these during the same clock second

kind perch
#

that event does look a lot more similar

errant jacinth
#

If you're tracking the status of these from events and using both the created and updated event, you want to make sure you're getting the latest status

#

So instead of directly logging the status from the event in your system, instead retrieve the subscription by its ID, and use the status on the response you get

#

this will guarantee you have the latest version of that object

kind perch
#

So here is our webhooks to handle the updated vs created event they both are essentially doing the same thing. Both assigning the stripeId object you saw above. Are we doing something wrong here? are you saying the .created call is overriding the .updated call? like its happening before?

kind perch
#

Sorry lots of questions will give you a sec to take it in and respond.

errant jacinth
#

Nothing explicitly wrong, aside from perhaps assuming you'll get the updated event after the created event, which may not be true

#

SO you either want to retrieve the latest version of the object instead of using the event payload, or you can skip the db update when handling the created event if the subscription record already exists (from the updated event)

kind perch
#

Thank you for this.

#

I have one last thing.

#

I believe this issue just came about though. This event was on Feb 9th when the user paid and they have been very active on the since. Not until today did this issue come up. Do you know why this could be?

thick hamlet
#

Hello ๐Ÿ‘‹
Taking over as synthrider needs to step away

kind perch
#

Hello thank you!

thick hamlet
#

this seems like a long running thread ๐Ÿ˜…
Would you mind giving me a quick summary of the ask while I catch up?

kind perch
#

Yes, sorry about the length

#

The latest question I asked was just about why this issue cane up recently. My understanding is we have the data from the event.created event instead of event.updated. I believe that is pretty certain at this point. My confusion tho is that this just came up. This was an event from Feb 9th so I am not sure why now it is an issue.

#

Also, synthrider recommended that I retrieve the latest version of the object instead using the event payload. If you had insight into this method instead that would be great.

pearl wyvern
kind perch
#

I will look into this. Hopefully, with all of this additional knowledge, I will be able to figure it out. Thank you for all the help.

pearl wyvern
#

Absolutely!