#shainkey

1 messages ยท Page 1 of 1 (latest)

edgy wadiBOT
normal loom
#

Hi there!

#

This subscription has status canceled.

dry sierra
#

yes
Just now its cancelled

#

is there any way for auto payment after cancel

#

with the same account that have previously done

normal loom
#

is there any way for auto payment after cancel
What do you mean?

dry sierra
#

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

normal loom
#

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.

dry sierra
#

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

normal loom
dry sierra
#

there is no option here to set 1 hour of time for auto-renew i already used that one but not getting exact result

normal loom
#

the minimum billing period for a subscription is day.

dry sierra
#

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

normal loom
#

Can you please clarify with a concrete example what exactly you are trying to do? What is your end goal here?

dry sierra
#

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.

crystal scroll
#

Hello soma had to step out but I can help. One moment as I catch up on this thread

dry sierra
#

sure

crystal scroll
dry sierra
#

can i test from code ?

crystal scroll
#

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

dry sierra
#

okay let me check all steps once

#

frozen_time=1635750000
what does it mean what i need to pass for an hour renewal

crystal scroll
#

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

dry sierra
#

stripe.test_helpers.TestClock.create(frozen_time=1635750000, name="Annual renewal")
it will create one simulation that name is Annual renewal correct ?

crystal scroll
#

Yep you can name it whatever you want here

dry sierra
#

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

crystal scroll
#

Correct

dry sierra
#

okay

#

created one subs
subs_id= sub_1M43wIA1AvSnwwTvG8aEoM7v
when it will be auto renew ?

#

check once your side and let me know

crystal scroll
#

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

dry sierra
#

okay

#

sub_1M44JHA1AvSnwwTvc16JIt5B
is it active now correct ?

#

and auto renew tomm at the same time

#

Please confirm me once

crystal scroll
#

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

dry sierra
#

can we do it manually and from api for an hour for testing ?

crystal scroll
#

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

dry sierra
#

attached from dashboard

#

can you please let me know
It will auto renew at 9pm IST

#

with the same subs_id= sub_1M44JHA1AvSnwwTvc16JIt5B

#

?

crystal scroll
#

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.

dry sierra
#

ok

#

clock = stripe.test_helpers.TestClock.create(frozen_time=1668419500, name="test auto renewal")
need to change from here

#

?

craggy wind
#

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