Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe: can I copy production data to test?

I'm working on a script that uses the Strip REST api with the PHP SDK. I was hoping to be able to replicate the production data in the test environment. Is this possible?

Thanks,

Andrew

like image 599
Andrew Hughes Avatar asked Nov 08 '16 19:11

Andrew Hughes


2 Answers

To my knowledge there's no way to directly port production data into the test data. However a simple script can be constructed to iterate over production data, grab the necessary attributes, switch to test API credentials, and create the necessary records.

I've done this in an idempotent way so that it can be done anytime we add something to Stripe in production, we can create a mirror of this object in our own data model for both production, development, staging, and make sure the item exists in Stripe's test environment.

like image 189
Jesse Novotny Avatar answered Sep 29 '22 05:09

Jesse Novotny


As I found, you need to write the script and change flag "livemode" to false. That might convert production data to test data. Stripe does not offer to this directly. You can see the flag desciption in below image.

enter image description here

like image 42
Girish Avatar answered Sep 29 '22 07:09

Girish