#shainkey
1 messages ยท Page 1 of 1 (latest)
yes
Just now its cancelled
is there any way for auto payment after cancel
with the same account that have previously done
is there any way for auto payment after cancel
What do you mean?
for ex:
i buy any subs from mobile side correct and paid the required amount. It is working fine now after 1 hour(for testing purpose) it will be cancelled correct but after that it should be auto-renew tha subscription(for ex: after a month)
recurring payment
automated payment with-out filling the card details again
got it ?
or else need to explain again
I'm sorry I don't understand. If you cancel the subscription why do you want to auto-renew? Either you cancel the subscription and it will actually cancel. Or you don't cancel the subscription and it will auto-renew.
how can i test that auto-renew is working after an 1 hour of cancel the susbcription?
is there an any way to test until wait for an month
If you want to test subscriptions, you should use Test Clocks that allow you to move forward in time: https://stripe.com/docs/billing/testing/test-clocks
there is no option here to set 1 hour of time for auto-renew i already used that one but not getting exact result
the minimum billing period for a subscription is day.
start and end date
please suggest me how we can set there ?
lets say want to set for a day
today and tomm at the same time it should be auto-renew
Can you please clarify with a concrete example what exactly you are trying to do? What is your end goal here?
my goel is-
I want to buy one subs today and want to check after some time(lets say for an hour for 2 hour etc..) it should be auto-renew so i can test auto renewal is working fine or not that's it.
Hello soma had to step out but I can help. One moment as I catch up on this thread
sure
If you use test clocks, you can check how well your renewal logic works very quickly https://stripe.com/docs/billing/testing/test-clocks
can i test from code ?
You can simulate months or years going by in seconds. Stripe will send the proper webhook events when fast forwarding
Yes, the doc I linked to shows how to use test clocks in code
okay let me check all steps once
frozen_time=1635750000
what does it mean what i need to pass for an hour renewal
1635750000 is a unix timestamp https://www.unixtimestamp.com/
Epoch and unix timestamp converter for developers. Date and time function syntax reference for various programming languages.
So that means it represents the time that is 1,635,750,000 seconds after midnight Jan 1 UTC 1979
So 1635750000 = Mon Nov 01 2021 07:00:00 GMT+0000
So to get an hour after that, you add 60 seconds
stripe.test_helpers.TestClock.create(frozen_time=1635750000, name="Annual renewal")
it will create one simulation that name is Annual renewal correct ?
Yep you can name it whatever you want here
yes
stripe.Customer.create(
email="jenny.rosen@example.com",
test_clock="{{CLOCK_ID}}",
payment_method="pm_card_visa",
invoice_settings={"default_payment_method": "pm_card_visa"},
)
This will create a customer
Correct
okay
created one subs
subs_id= sub_1M43wIA1AvSnwwTvG8aEoM7v
when it will be auto renew ?
check once your side and let me know
Looks like Dec 14. If you go to the subscription's page on the dashboard, it will show you when the subscription's next renewal is https://dashboard.stripe.com/test/subscriptions/sub_1M43wIA1AvSnwwTvG8aEoM7v
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Also that customer is not on a test clock, so you can't fast forward time to test this subscription if that is what you are trying to do. You need to create subscriptions on the test clock customer
okay
sub_1M44JHA1AvSnwwTvc16JIt5B
is it active now correct ?
and auto renew tomm at the same time
Please confirm me once
Yes the subscription is active and has a renewal of 11/15. So if you fast forward the time it will show you what that renewal looks like
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can we do it manually and from api for an hour for testing ?
Yes, that link I just sent shows how to advance time with your test clock
Or you can do it from your dashboard on the page for the subscription
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
attached from dashboard
can you please let me know
It will auto renew at 9pm IST
with the same subs_id= sub_1M44JHA1AvSnwwTvc16JIt5B
?
Yes it does look like the subscription will renew then. The timestamp on your dashboard will be accurate here
But you need to advance time on the test clock for it to renew. The timestamp on that clock will stay the same until you move it. So if you advance time on that clock now, you can see the renewal now.
Also keep in mind that time only goes forward on a test clock when you tell the clock to go forward. So if you don't tell time to advance via the dashboard or API, time on that clock will stay stuck and not move forward.
ok
clock = stripe.test_helpers.TestClock.create(frozen_time=1668419500, name="test auto renewal")
need to change from here
?
Hi there ๐ I'm jumping in as my teammate needed to step away. That function is for creating a Test Clock, if you already have a Test Clock created and are trying to advance the time for it then you will want to use this function:
https://stripe.com/docs/api/test_clocks/advance
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.