#ringo-webhooks

1 messages · Page 1 of 1 (latest)

sour bolt
#

you can check the created time on the Event objects in the webhooks, but I think generally a good approach is to e.g. if you get a charge.failed event, retrieve the Charge object it references from the API and then pass it to a generic function that syncs your system against that(the latest state of the object), and do the same when you get the charge.succeeded event, which should be a no-op since you retrieve the object again and get the same state

kindred lark
#

gotcha. i was just thinking the same thing

#

i'm dealing with subscriptions, so if i get a subscription.x event, then I should use the api to find the latest status rather than relying on what's in the event. and the same for invoice events - ie trace back to the customer, and forward through their subscription -> invoice -> payment intent

sour bolt
#

yep, reconciling that way helps with this — treat the event as a notification of "something happened" and then go fetch state from the API