#ddbg-test clocks

1 messages ยท Page 1 of 1 (latest)

native viper
#

๐Ÿ‘‹ happy to help

#

it's a semi-new feature (a few months back)

#

that would give you the ability to test Subscriptions and Subscription Schedules

mighty ore
#

ohhh that's sick!!!

#

so basically, I can move in the futur???

native viper
#

yes indeed

#

just bare in mind that only 3 subscriptions/subscription schedules can be created per customer when a test clock is used on that customer

mighty ore
#

yes but once the schedule hit, I can do again right? When you said 3, it's 3 on the "same time" right?

native viper
#

let me try to do my job better this time ๐Ÿ˜›

mighty ore
#

so if I understood it correctly, for my schedule new phase, I have to create a testClock to "simulate" that we are one month later, then give the testClock id in the newPhase?

native viper
#

So in order to use the test clock, you need to create one and attach it to a customer

mighty ore
#

ah, I'm not sure to get the point on the test clock :/

native viper
#

from that point the subscriptions/schedules you will create for that customer would be subject to the test clock

mighty ore
#

but can't I just fill the new phase with a custom timestamp for the periodStart?

native viper
#

and you can go into the future to get the new invoices

#

you will still be able to create the schedules that you want

#

the only thing that the test clock would do for you is the ability to travel into the future in order to see what happens when that date arrives

#

e.g. a new invoice will be generated, the new phase will be active, etc.

mighty ore
#

oki, but will that fire the hook about the subscription update?

#

I assume yes then

#

may I explain to you what I understood and how I can implement that?

native viper
#

yes sure

mighty ore
#

thanks @native viper !

#

I have a question that just came when I was resuming you what I understood

#

the testClock I have to attach it to the customer right (you said that above)?

#

but my user is created already

#

how can I attach the testCLock to it?

native viper
#

it's not possible to attach a test clock to an existing customer

#

you need to create a new one

mighty ore
#

oh crap :/

#

it's pretty tough on my side (back side) to create a new test customer and attach to it credit card (on the front side) :/

#

is there another way to apply a "custom" timestamp to accelerate a subscription.schedule?

native viper
#

actually if it's a test customer you can automatically create the customer with a payment method

mighty ore
#

but thanks a lot for teaching me about testClock, really good to know!

native viper
#

what dev language are you using on the backend?

mighty ore
#

nodejs

native viper
#
  email: '...',
  test_clock: test_clock.id,
  payment_method: 'pm_card_visa',
  invoice_settings: {default_payment_method: 'pm_card_visa'}})```
mighty ore
#

thanks a lot for the info!

native viper
#

let me know if you need any more help

mighty ore
#

oki thank you very much @native viper !!!