From 39c8e35eca86ec4db33aed04af9ec1b093255151 Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 24 Dec 2020 06:25:22 +0530 Subject: [PATCH] Add logger messages --- utils/stripe_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index b8667a40..e25e736f 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -34,6 +34,7 @@ def handleStripeError(f): logger.error(str(e)) return response except stripe.error.RateLimitError as e: + logger.error(str(e)) response.update( {'error': "Too many requests made to the API too quickly"}) return response @@ -317,13 +318,16 @@ class StripeUtils(object): ] :return: The subscription StripeObject """ - + logger.debug("Subscribing %s to plan %s : coupon = %s" % ( + customer, str(plans), str(coupon) + )) subscription_result = self.stripe.Subscription.create( customer=customer, items=plans, trial_end=trial_end, coupon=coupon, default_tax_rates=tax_rates, payment_behavior='allow_incomplete' ) + logger.debug("Done subscribing") return subscription_result @handleStripeError