#dineshkumar_docs
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1370400971343134780
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dineshkumar_testing-fraud-prevention, 3 days ago, 46 messages
- dineshkumar_docs, 6 days ago, 27 messages
subscription sub_1RMUcBEHihjLdxhNU5ffO3Dp created 9.35 AM EDT and i set advanced time same day 10.40 AM EDT, but not renewed subscription on 10.40 AM EDT, why?
The current period end on that subscription is set to a day after what the test clock's time is currently set to
If you advance it another day it should cycle and create a new invoice
we can't test subscription renewal, subscription created same day?
You can, looking at your API calls it looks like the test clock's time hasn't been advanced since you created the subscription
Oh or rather it has been advanced, but not by a full day.
Subscription sub_1RMUcBEHihjLdxhNU5ffO3Dp created yesterday 9.35 AM EDT and i set advanced time same day 10.40 AM EDT, but not renewed subscription on 10.40 AM EDT, why?
Because the subscription's cycle is 24 hours
And you only advanced it by an hour and five minutes
So, we can't test subscription renewal, subscription created same day, correct?
I'm not quite sure what you mean by that. The minimum length of a Stripe subscription is 1 day, you can't have subscriptions that cycle more often than that.
I need to test subscription renewal before current period end, is this possible?
The subscription period determines when the renewal happens
There are ways to interrupt a subscription cycle, but they can be more complicated. Before we get in to that, can you explain your usecase to me? Like can you give a simple example of what situation you are trying to simulate here? In production, when will you be trying to do this?
We need to test payment failed on renewal subscription for card decline
In sandbox or testmode,can we test subscription renewal failed for card decline, subscription created same day?
In that case, you can use our normal renewal process. To simulate that, all you need to do is send us a later date when you advance your test clock. The test clock can simulate times far out in to the future
using simulate can't test?
No, that is the opposite of what I said
Looking back, I think I might see where your confusion is around how this testing works
I think the easiest way to explain is to give steps of how to test what you want to test:
- Create a test clock, set the timestamp to May 1st
- Create a subscription and customer connected to the test clock
- Check the subscription's
current_period_endtimestamp, if you use your daily subscription price, this timestamp will be for May 2nd. - Advance your test clock to
current_period_end + 360, this will advance the simulated time to one hour after when the subscription would next cycle. In this case some time on May 2nd - When the test clock is done advancing, the subscription will be on its next cycle and there will be a new invoice for this cycle.
It is the number of seconds in an hour (60 seconds * 60 minutes). The timestamp that our API uses is a unix timestamp which counts in seconds
ok i will try this, thanks!