#atmb-jason-eligio_code

1 messages ¡ Page 1 of 1 (latest)

frosty tokenBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1373895476838928486

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

indigo sleet
#

for clarity my issue is - TestClock property not present on the CustomerUpdateOptions, as I want to Create and Advance a test clock to an already existing customer using .Net SDK. Thanks

noble bobcat
#

Yes so normally you would need to create a Test Clock first, then create a Customer using that Test Clock Id

indigo sleet
#

is there a way to associate a created Test Clock to an already existing customer?

#

// Step 1: Create a Test Clock
var testClockOptions = new Stripe.TestHelpers.TestClockCreateOptions
{
FrozenTime = DateTime.UtcNow
};
var testClockService = new Stripe.TestHelpers.TestClockService();
var testClock = testClockService.Create(testClockOptions);

// Step 2: Update a customer to associate the Test Clock
var existingCustomerId = "cus_SJreBFGgGU6Wp3";
var customerUpdateOptions = new CustomerUpdateOptions
{
TestClock = testClock.Id // property not exist in CustomerUpdateOptions
};
var customerService = new Stripe.CustomerService();
var updatedCustomer = customerService.Update(existingCustomerId, customerUpdateOptions);

// Step 3: Advance the Test Clock to simulate the passage of time
var advanceOptions = new Stripe.TestHelpers.TestClockAdvanceOptions
{
FrozenTime = DateTime.UtcNow.AddMonths(1)
};
testClock = testClockService.Advance(testClock.Id, advanceOptions);

#

this is what I'm trying to do but for CustomerUpdateOptions there's no property to add TestClock

noble bobcat
#

No unfortunately. You can confirm at our API Reference

indigo sleet
#

yup, do you have other ways to advance a test clock to an already existing customer?

noble bobcat
#

no it's not possible unfortunately