#Ritchie
1 messages · Page 1 of 1 (latest)
Hi, can you reword this bit please 'I want to reapply the products after I reset test mode data'? I'd like to make sure that I fully understand your question so I can provide the best support
Hi. So I am using test mode to test my subscription system. I have a set of products and prices for this testing. Every time I reset test data (through the dashboard), I create the same products and prices ready to use for testing again.
A fixture can help me apply these products and price objects through the CLI. This will save some time after I reset the test data
I'm asking how can I create a fixture
This is what I'm referring to
I'm unsure if a fixture is the best way to go about this, but I remember seeing a video by the stripe youtube channel - they applied a fixture with prices and products so you can follow along
Once you delete your test data, you won't be able to access these objects. Can I ask why you keep deleting and then re-creating these test objects?
For example, while I'm testing, I create many customers, subscriptions, and other types of objects. Occasionally, I clear my test data, so I can continue testing but with a clean account to make sure everything is working on my end. Every time I delete the test data, obviously the products and prices are also deleted.
So, I have to go through the dashboard to create new products and prices and use those new objects in my next stages of testing. I was wondering if there's a quicker way to recreate these objects - i.e. using stripe CLI's fixtures to automate the creation process
You can use the Stripe CLI, https://stripe.com/docs/stripe-cli with fixtures here: https://stripe.com/docs/stripe-cli
https://github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/price.created.json
For instance, to create a price you'd have stripe trigger price.created on your Terminal.
But yeah, here is the library you're looking for
I do not think you need to keep deleting your data every time, to confirm if things are working correctly, you can look at your logs, https://dashboard.stripe.com/test/logs in the Dashboard and look at the time stamps: https://dashboard.stripe.com/test/logs
Thank you