Add logger messages

This commit is contained in:
PCoder 2020-12-24 06:25:22 +05:30
parent eefabe45b6
commit 39c8e35eca

View file

@ -34,6 +34,7 @@ def handleStripeError(f):
logger.error(str(e)) logger.error(str(e))
return response return response
except stripe.error.RateLimitError as e: except stripe.error.RateLimitError as e:
logger.error(str(e))
response.update( response.update(
{'error': "Too many requests made to the API too quickly"}) {'error': "Too many requests made to the API too quickly"})
return response return response
@ -317,13 +318,16 @@ class StripeUtils(object):
] ]
:return: The subscription StripeObject :return: The subscription StripeObject
""" """
logger.debug("Subscribing %s to plan %s : coupon = %s" % (
customer, str(plans), str(coupon)
))
subscription_result = self.stripe.Subscription.create( subscription_result = self.stripe.Subscription.create(
customer=customer, items=plans, trial_end=trial_end, customer=customer, items=plans, trial_end=trial_end,
coupon=coupon, coupon=coupon,
default_tax_rates=tax_rates, default_tax_rates=tax_rates,
payment_behavior='allow_incomplete' payment_behavior='allow_incomplete'
) )
logger.debug("Done subscribing")
return subscription_result return subscription_result
@handleStripeError @handleStripeError