From ffea067512c4d2b6056c1375608be956c3098189 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Wed, 15 Jun 2022 17:41:51 -0500 Subject: [PATCH 1/2] Subscriptions: log subscription id when canceling --- readthedocs/payments/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readthedocs/payments/utils.py b/readthedocs/payments/utils.py index b2781e595d1..8b6dd5af827 100644 --- a/readthedocs/payments/utils.py +++ b/readthedocs/payments/utils.py @@ -29,6 +29,10 @@ def delete_customer(customer_id): def cancel_subscription(subscription_id): """Cancel Stripe subscription, if it exists.""" try: + log.info( + "Canceling stripe subscription.", + stripe_subscription=subscription_id, + ) return stripe.Subscription.delete(subscription_id) except stripe.error.StripeError: log.exception( From 92e8778e79ccfc710bb3409b7f7964b31c3c3c56 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 16 Jun 2022 10:18:29 -0500 Subject: [PATCH 2/2] Log when deleting customer --- readthedocs/payments/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readthedocs/payments/utils.py b/readthedocs/payments/utils.py index 8b6dd5af827..4331dbe7508 100644 --- a/readthedocs/payments/utils.py +++ b/readthedocs/payments/utils.py @@ -17,6 +17,10 @@ def delete_customer(customer_id): """Delete customer from Stripe, cancelling subscriptions.""" try: + log.info( + "Deleting stripe customer.", + stripe_customer=customer_id, + ) customer = stripe.Customer.retrieve(customer_id) return customer.delete() except stripe.error.InvalidRequestError: