#chirp
1 messages · Page 1 of 1 (latest)
Hi, this document walks through the Test Clocks workflow: https://stripe.com/docs/billing/testing/test-clocks
When you create the customer, you pass the test clocks: https://stripe.com/docs/billing/testing/test-clocks?dashboard-or-api=api#setup-simulation
yeah I went through that. i dont get how to ...
wait what?
I went through the steps of the first doc . didnt show me what I needed.
ahhh thats what i was missing.
so adding something like
test_clock: '{{CLOCK_ID}}',
to the creation of the checkout link will give me what I need right?
oh wait thats about creating a customer.
I have to create a customer to use checkout?
It's not a requirement to create a Customer before using Checkout in general, but it is a requirement if you want to use Test Clocks
i see.
does that mean I also have to create subscriptions the same way? In the context of a test clock?
So if you need to use test clocks you need to first create a Customer w/ the Test Clock and that pass that Customer ID in when you created the session (https://stripe.com/docs/api/checkout/sessions/create?event_types-payment_intent.payment_failed#create_checkout_session-customer)
and no, you shouldn't have to pass the test clock anywhere else - it's just something you set on the customer
but when you create a subscription you pass in a customer, and that's how we konw which test clock to use
I see. Ok. So i must create the customer first and associate the test clock, the when creating the checkout link associate the customer id.
yup!
Ok. Thanks a lot for clarifying. I was thinking I was going crazy trying to figure out how to link the two in the web portal.
Begs the question - why not allow the association of the test clock with an existing user in the portal while in test mode?
It's just not something we support yet - right now, you can only add a test clock to a customer upon creation. You can't add one after the fact (it's something that's on our radar as a possible improvement, but hasn't been fixed yet)
Got it. Ok. Thanks Karbi. Have a good weekend.
👍 you too! glad we could help