MCPcopy Create free account
hub / github.com/Roy3838/Observer / _cancel_active_subscriptions

Function _cancel_active_subscriptions

api/api.py:212–217  ·  view source on GitHub ↗
(customer_id: str, user_id: str)

Source from the content-addressed store, hash-verified

210# so delete_account runs each of these through asyncio.to_thread.
211
212def _cancel_active_subscriptions(customer_id: str, user_id: str) -> None:
213 subscriptions = stripe.Subscription.list(customer=customer_id, status='all', limit=100)
214 for sub in subscriptions.data:
215 if sub.status in ('active', 'trialing'):
216 stripe.Subscription.cancel(sub.id)
217 logger.info(f"Cancelled Stripe subscription {sub.id} for user {user_id}")
218
219
220def _redact_stripe_customers(email: str, user_id: str) -> None:

Callers 1

_redact_stripe_customersFunction · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected