#deputycheese

1 messages ยท Page 1 of 1 (latest)

tulip edgeBOT
grand root
#

Hi there!

#

You have a few options.
For example you could replace the default payment method of the subscription by a test card that will fail, and then use Test clocks to move time forward

misty flax
#

I tried using test clocks but how can I "run" them? I created one, but nothing happens

#

clock_1NkmrEClDK2O5WMjjgTGrkKL

#

I would like all webhooks to get called that would run until september 30th

grand root
#

It's a multi step process:

  1. Create the test clock
  2. Attach it to a customer
  3. Then move the time forward
misty flax
#

It's not possible to use this in combination with a customer that I created via our system (cus_OXse7Dl0XgNNMf)?

#

Basically I only want those webhooks for his subscription to run to be able to test it

#

If I create a new one via stripe dashboard we cannot test anything because we havent got the data in our system (subscription etc.)

grand root
#

It's not possible to use this in combination with a customer that I created via our system (cus_OXse7Dl0XgNNMf)?
You can only attach a test clock to a customer while you are creating the customer.

#

However note that there's another option to test a failed renewal, without Test Clocks:

#

Create a subsciption with a very short trial period, like a couple seconds. As soon as the trial ends, the subscription will try to charge the customer; But if the customer has no default payment method or the payment method is one that will fail, then the payment will fail.

misty flax
#

Ah cool

#

How can I do that?

#

I thought "day" was the least I could define there

#

I am using price_data >recurring > interval

grand root
#

How are you creating the Subscription? With the Subscription endpoint directly?

misty flax
#

Yes

grand root
#

So set the trial directly on the Subscriptoin itself with the trial_end parameter

misty flax
#

Thats how we currently create our subscriptions and Id rather have it as close to the live implementation as possible

grand root
#

I don't understand. You can use both price_data and trial_end.

misty flax
#

trial_end will override the interval I specify in price_data?

grand root
#

There are two completely different things.

  • interval is how frenquently you charge the user (daily, weekly, etc.)
  • free trial is how long the subscription will be free
misty flax
#

Ah ok so he wont be charged at first and then only with what i defined at trial_end, right?

grand root
#

Yes. For example if you set the trial_end 2 seconds in the future, then the first 2 seconds of the subscription will be free, and then after 2 seconds Stripe will try to charge the customer, which will fail (assuming they don't have a default payment method or you set one that will fail).

misty flax
#

Perfect, thanks

grand root
#

Happy to help ๐Ÿ™‚

misty flax
#

Thanks

#

I could also just cancel via stripe dashboard, that will call the same event right?

grand root
#

Yes you can cancel a subscription from the API or the Stripe dashboard, it's the same.