Created
February 27, 2015 07:38
-
-
Save erikpukinskis/42cbee4612eb61bcaf3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'stripe' | |
Stripe.api_key = "yr key heer" | |
# This will cancel all of the subscriptions in your Stripe account. Money corrupts. | |
$start_at | |
$found_one = true | |
while $found_one | |
puts 'Batch after ' + ($start_at ? $start_at : 'no one') | |
$found_one = false | |
Stripe::Customer.all(starting_after: $start_at).each do |customer| | |
$found_one = true | |
if !!customer['subscription'] | |
customer.subscription.delete | |
puts ' xxx cancelling ' + customer.subscription.id | |
else | |
puts ' ' + customer.id + ' has none' | |
end | |
$start_at = customer.id | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment