#bryane_88036

1 messages · Page 1 of 1 (latest)

spark monolithBOT
keen oriole
half crag
#

Yup that's exactly what I was thinking, however the only attribute that gets returned when a subscription transitions from an incomplete to active state is the default_payment_method

#

Is there a better way of being able to check against that status transition?

keen oriole
#

You should get a customer.subscription.updated event for every param changing

#

So you should get an event when status changes

half crag
#

Yup totally on the same page there, we get an customer.subscription.created event where the status is incomplete, then a customer.subscription.updated event where the status is now active. That's specifically what I'm trying to assert: that a subscription got created in one event, then it was updated to be active in a follow up event. There's lot's of reasons why a customer.subscription.updated is emitted, but I only want to perform a certain action when the customer.subscription.updatedevent is specifically a subscription transitioning to active

keen oriole
#

Can't you just check for the event where status became active and in previous_attributes you see status as incomplete?

half crag
#

Well that's the thing: the only attribute I see on a customer.subscription.updated event, where a sub turns to active, is the default_payment_method field.

keen oriole
#

Oh can you send an event id?

half crag
#

when a sub is cancelled, there's much more data

#

yup

#

@keen oriole can I dm you since the event id since this is a public channel

keen oriole
#

No we don't do dms. Event id's aren't sensitive data

half crag
#

are or aren't

keen oriole
#

Wow I misstyped that my bad

#

Edited

#

Aren't*

half crag
#

lol don't scare me like that

#

evt_1Nso7WCi2Sw6UZ9JUWusJU2X

keen oriole
#

So sorry haha

half crag
#

all good, I appreciate the help!

keen oriole
half crag
#

Why two events? How would I be able to tell the difference?

keen oriole
#

You'd listen to all customer.subscription.updated events. Then only action ones where status changed from incomplete -> active

#

Just inspect status and previous_attributes for every event that comes in

half crag
#

Okay, that makes sense. I really appreciate it!