Skip to content

Instantly share code, notes, and snippets.

@jessenovotny
Last active May 6, 2024 08:00
Show Gist options
  • Save jessenovotny/8c8068a79312c3d6135efee3223c9bba to your computer and use it in GitHub Desktop.
Save jessenovotny/8c8068a79312c3d6135efee3223c9bba to your computer and use it in GitHub Desktop.
Copy production stripe data to sandbox
# connect to production
Stipe.api_key = production_key
plans = Stripe::Plan.all
# connect to sandbox
Stripe.api_key = test_key
plans.each do |plan|
Stripe::Plan.create(plan.attributes)
end
@mathiasgrimm
Copy link

TKS! Just used this to do the same with php

@rickychilcott
Copy link

FYI Line 2 has a typo Stipe -> Stripe

@Harm-Nullix
Copy link

Lol, such a small piece of code and then still a typo xD

@Harm-Nullix
Copy link

Loos nice though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment