#pythonian
1 messages · Page 1 of 1 (latest)
We have a tool called Test Clocks that let you simulate time passage so that you don't have to wait. Not sure if the CLI can control them but I will check https://stripe.com/docs/api/test_clocks
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you. For the Test clocks, i will have to do all that on the dashboard yea? Will i be able to use existing subscribing customers that is on my local database, to test this out?
You need to create new customers on the test clocks themselves, they don't support existing customers unfortunately
You can do API and dashboard at least, quickly checking in to if CLI is possible as well
Stripe CLI can also create and manipulate test clocks https://stripe.com/docs/api/test_clocks/create?lang=cli
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay thank you. But then, if i should create the new customers on the dashboard, how will i be able to update my application with the renewal status to show that the webhook works? sorry for too much questions, but i am really confused, that is why
When you advance the webhook (fast-forward the simulated time), Stripe will automatically send out the test mode webhooks that would have been sent out for a normal test subscription
So as long as your webhook endpoint is listening for events, it should be able to receive and process these events like normal
And yes, you can create the customer via the dashboard, API, or CLI. For the API and CLI you pas in the test clock's ID to the test_clock parameter when creating the Customer https://site-admin.stripe.com/docs/api/customers/create#create_customer-test_clock
Alright, thank you so much. This should help me go some way.
I also will like to ask. For the hosted endpoints, there has been some difference between a webhook for connected accounts and webhook for personal accounts. The users who make the subscriptions are the connected accounts, how do i setup so that my connected webhook is being sent these events, do i need to do any speical configuration in my code to distinguish it?
The event object will have an account property if it is a connected account event and you can also have your webhooks point at slightly different URLs which would automatically differentiate them https://stripe.com/docs/api/events/object#event_object-account
We have this general doc on setting up and configuring these endpoints that I think you may find helpful https://stripe.com/docs/connect/webhooks