#GastonLifschitz
1 messages · Page 1 of 1 (latest)
For instance I have a workflow where I check for the status of the payment method, if its about to expire before the renewal. Therefore I evaluate the expiration date with Date.now() ("present"). But in terms of the test clock that's future.
Okay so when you are using the test clock you would want to track the state of the "time" you are advanced to. You can retrieve the test clock and use the frozen_time attribute to calculate what would be the current time for those checks.
https://stripe.com/docs/api/test_clocks/object#test_clock_object-frozen_time
Okay, I get an idea of how can I change the code to implement this, so how could I retrieve the test clock of a given customer? Or using the customer object check if it has a test clock?
IF you have the customer object it has the ID of the test clock associated with it: https://stripe.com/docs/api/customers/create
Great, I see it's expandable so that's awesome! Thanks!