mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 23:08:22 -05:00
StripeController: handle exception when customer isn't found.
This commit is contained in:
@@ -767,8 +767,11 @@ class StripeController(GoldPaymentController):
|
||||
# there's no associated account - delete the subscription
|
||||
# to cancel the charge
|
||||
g.log.error('no account for stripe invoice: %s', invoice)
|
||||
customer = stripe.Customer.retrieve(customer_id)
|
||||
customer.delete()
|
||||
try:
|
||||
customer = stripe.Customer.retrieve(customer_id)
|
||||
customer.delete()
|
||||
except stripe.InvalidRequestError:
|
||||
pass
|
||||
elif status == 'invoice.payment_failed':
|
||||
invoice = event.data.object
|
||||
customer_id = invoice.customer
|
||||
|
||||
Reference in New Issue
Block a user