3 ms·
> The obvious approach is to have an event list which you as customer long-poll or just poll every few seconds This is also much much easier for the payments i
by davedx 4y ago
> The obvious approach is to have an event list which you as customer long-poll or just poll every few seconds
This is also much much easier for the payments integrations developers to test, compared to all the messing about and running dodgy proxies that testing webhooks involves.
Webhooks for critical application paths just seem like a bad idea all around really
- bmizerany 4y ago> Webhooks for critical application paths just seem like a bad idea all around really Well, put. I've been deep in the Stripe API for a while now, and the invoices API provides up-to-date account status information and what a customer is paying for. This can be referenced as needed and, if desired, cached with some TTL and referenced as the "truth." Then webhooks can be viewed as a convenient way to bust the cache quicker than waiting for the TTL to expire. It could be better, but it provides the necessary information without relying on webhooks. An example of how we use this API as a form of entitlement checks at Tier can be found here: https://github.com/tierrun/tier/blob/f7c32426d30ca314706ca7e64399340f306f1d0b/control/usage.go#L89-L116 https://github.com/tierrun/tier/blob/f7c32426d30ca314706ca7e...