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
|
i += 1
|
||||||
try:
|
try:
|
||||||
data = stripe.Charge.list(created={'gt': week}, count=limit, starting_after=starting_after)
|
data = stripe.Charge.list(created={'gt': week}, count=limit, starting_after=starting_after)
|
||||||
except stripe.APIConnectionError:
|
except stripe.error.APIConnectionError:
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
continue
|
continue
|
||||||
charges = data['data']
|
charges = data['data']
|
||||||
|
@ -359,7 +359,7 @@ class Profile(models.Model):
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
user.profile.setup_premium_history()
|
user.profile.setup_premium_history()
|
||||||
except stripe.APIConnectionError:
|
except stripe.error.APIConnectionError:
|
||||||
logging.debug(" ***> Failed: %s" % user.username)
|
logging.debug(" ***> Failed: %s" % user.username)
|
||||||
failed.append(user.username)
|
failed.append(user.username)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
|
@ -389,7 +389,7 @@ def stripe_form(request):
|
||||||
customer = stripe.Customer.retrieve(user.profile.stripe_id)
|
customer = stripe.Customer.retrieve(user.profile.stripe_id)
|
||||||
try:
|
try:
|
||||||
card = customer.sources.create(source=zebra_form.cleaned_data['stripe_token'])
|
card = customer.sources.create(source=zebra_form.cleaned_data['stripe_token'])
|
||||||
except stripe.CardError:
|
except stripe.error.CardError:
|
||||||
error = "This card was declined."
|
error = "This card was declined."
|
||||||
else:
|
else:
|
||||||
customer.default_card = card.id
|
customer.default_card = card.id
|
||||||
|
@ -406,7 +406,7 @@ def stripe_form(request):
|
||||||
'email': user.email,
|
'email': user.email,
|
||||||
'description': user.username,
|
'description': user.username,
|
||||||
})
|
})
|
||||||
except stripe.CardError:
|
except stripe.error.CardError:
|
||||||
error = "This card was declined."
|
error = "This card was declined."
|
||||||
else:
|
else:
|
||||||
user.profile.strip_4_digits = zebra_form.cleaned_data['last_4_digits']
|
user.profile.strip_4_digits = zebra_form.cleaned_data['last_4_digits']
|
||||||
|
|
Loading…
Add table
Reference in a new issue