mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Wrong Stripe exceptions.
This commit is contained in:
parent
57d37aa833
commit
f238bc7b5c
2 changed files with 4 additions and 4 deletions
|
@ -333,7 +333,7 @@ class Profile(models.Model):
|
|||
i += 1
|
||||
try:
|
||||
data = stripe.Charge.list(created={'gt': week}, count=limit, starting_after=starting_after)
|
||||
except stripe.APIConnectionError:
|
||||
except stripe.error.APIConnectionError:
|
||||
time.sleep(10)
|
||||
continue
|
||||
charges = data['data']
|
||||
|
@ -359,7 +359,7 @@ class Profile(models.Model):
|
|||
continue
|
||||
try:
|
||||
user.profile.setup_premium_history()
|
||||
except stripe.APIConnectionError:
|
||||
except stripe.error.APIConnectionError:
|
||||
logging.debug(" ***> Failed: %s" % user.username)
|
||||
failed.append(user.username)
|
||||
time.sleep(2)
|
||||
|
|
|
@ -389,7 +389,7 @@ def stripe_form(request):
|
|||
customer = stripe.Customer.retrieve(user.profile.stripe_id)
|
||||
try:
|
||||
card = customer.sources.create(source=zebra_form.cleaned_data['stripe_token'])
|
||||
except stripe.CardError:
|
||||
except stripe.error.CardError:
|
||||
error = "This card was declined."
|
||||
else:
|
||||
customer.default_card = card.id
|
||||
|
@ -406,7 +406,7 @@ def stripe_form(request):
|
|||
'email': user.email,
|
||||
'description': user.username,
|
||||
})
|
||||
except stripe.CardError:
|
||||
except stripe.error.CardError:
|
||||
error = "This card was declined."
|
||||
else:
|
||||
user.profile.strip_4_digits = zebra_form.cleaned_data['last_4_digits']
|
||||
|
|
Loading…
Add table
Reference in a new issue