#atmb-jason-eligio_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
Yes so normally you would need to create a Test Clock first, then create a Customer using that Test Clock Id
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
No unfortunately. You can confirm at our API Reference
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yup, do you have other ways to advance a test clock to an already existing customer?
no it's not possible unfortunately