Time traveling for stripe subscription, Test Clock API

Advance time in the stripe sandbox dashboard

Simplest way to try this logic it's with stripe sandbox (test mode),simulation have to be enabled by default.

To try it you need to have:

You can open this subscription and at the top you should see the bar where declared current simulation time and option to advance it.

Before advancing the time, to visualize the effect you can create a "Trial" subscription for 7 days, to understand how it reflect when customer has attached payment method or not, or create basic subscription and remove or attach payment method, to see how subscription status is reflect, when you advance the time over the ending period.

After you click "Advance time", you will see this window where you can specify the date in the future. (you can move time only in the future)

Advance time stripe dashboard

Advance time with stripe API and test clock feature

References:
https://docs.stripe.com/billing/testing/test-clocks