#r3v3rb
1 messages · Page 1 of 1 (latest)
Hi there
If you are doing unit testing or any large amount of testing then you want to mock responses as opposed to actually hitting the API
That discusses how to handle automated testing
nope, just a single test rather than having to complete a checkout in a browser each time
Okay then using the CLI is going to be the easiest way to handle this but you can't use the same Checkout Session ID each time
You can use stripe trigger via the CLI to easily trigger a new checkout.session.completed event though
Why do you want the same ID each time?
the session id is stored against my user
If you are just doing a one-off test then that shouldn't matter and you should run through your entire flow and ensure you are handling the new ID and storing it correctly?
Otherwise, mocking is still the way to go here
So just simulate the response using the ID that you want
okay, i'll just have to keep entering details in checkout then
Why? That will create a new ID each time too?
how can I simulate the response with an id?
You just go through the flow once, look at the response, then create your own mock object for that response to use each time you run the test