"fast forward" time in a sandbox environment

A lot of complex processes we work with involve asyncronous scheduled actions on Stripe’s end. The most prescient example for my team is payouts.

We have a process that fetches all the existing payouts for a connected account via stripe’s API, then also fetches the balance transactions that make up that payout, and correlates that with various information in our system.

Testing this is hard because whenever we make test payments, we have to wait at least a day for Stripe to generate a payout covering those payments. Stripe allows the creation of “on demand” payouts, but a key differentiator of those is that we can’t fetch the individual balance transactions that contributed to that payout.

It would be nice if stripe focused on improving the test experience for this. Some solutions might be to either:

  • Add some functionality to trigger a daily payout immediately, using whatever balance was available at the time the payout was triggered, or
  • Add an ability to simulate time passing in sandbox environments. For example, today is the 23rd of May, but a developer can go into the workbench or make an API call to fast forward to the 30th. Any events that would happen on stripe’s end over time could then happen sequentially all at once, fire off the expected webhooks, etc.

The second option covers a lot more use cases than just payouts. For example, cases where disputes need to be resolved or account information needs to be updated before a deadline.

We have similar functionality to this in our app’s staging environments and it works pretty well. There’s some potential hangups like people tend to override the time and then forget they did so, then report bugs about the “incorrect” data showing up in places. My hope is that as stripe evolves, sandbox environments will become more ephemeral, so it’ll be easier to just spin up a new sandbox with fresh data every time a scenario like this needs to be tested.

I stripe considering adding any functionality like this?

1 Like