Skip to content

Instantly share code, notes, and snippets.

@chrisjsimpson
Created February 19, 2022 00:28
Show Gist options
  • Save chrisjsimpson/910ea43a5bf85cade5a51a2ae652828c to your computer and use it in GitHub Desktop.
Save chrisjsimpson/910ea43a5bf85cade5a51a2ae652828c to your computer and use it in GitHub Desktop.
import stripe
import os
STRIPE_API_KEY = os.getenv("STRIPE_API_KEY")
stripe.api_key = STRIPE_API_KEY
accounts = stripe.Account.list(limit=3)
for account in accounts.auto_paging_iter():
if (
"Soap Subscription" in account.business_profile.name
or "Business Name" in account.business_profile.name
):
# If we get here, then it's a test Stripe account
# which we can safley delete
result = stripe.Account.delete(account.id)
print(result)
print("All test shops deleted")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment