Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Test Stripe Subscription without trial

I am working with the Stripe API, and I’ve found it quite challenging to test subscription renewals. I need to simulate a charge on a user’s card at the end of the subscription period. Previously, we could set a very short trial period (e.g., 5 minutes), but now Stripe requires us to set it to at least 2 days in the future. This is a long wait for testing, and I would have to keep my server running 24/7 just to wait for this test.

Is there an alternative way to trigger the renewal of a subscription without having to wait for hours?

I tried to trigger something similar with CLI, but coudn’t do it.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

we could set a very short trial period (e.g., 5 minutes), but now Stripe requires us to set it to at least 2 days in the future.

That’s definitely still possible when using the direct Subscription API to set trial_end to a unix timestamp, but maybe you’re using something like a CheckoutSession instead.

The other/better way to test this is with TestClocks : https://docs.stripe.com/billing/testing/test-clocks

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading