mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
only report the paddle error if it's not 147
This commit is contained in:
parent
f16676e921
commit
a072d6c0cd
@ -91,15 +91,14 @@ def change_plan(subscription_id: str, plan_id) -> (bool, str):
|
|||||||
)
|
)
|
||||||
res = r.json()
|
res = r.json()
|
||||||
if not res["success"]:
|
if not res["success"]:
|
||||||
LOG.exception(
|
|
||||||
f"cannot change subscription {subscription_id} to {plan_id}, paddle response: {res}"
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
# "unable to complete the resubscription because we could not charge the customer for the resubscription"
|
# "unable to complete the resubscription because we could not charge the customer for the resubscription"
|
||||||
if res["error"]["code"] == 147:
|
if res["error"]["code"] == 147:
|
||||||
return False, "Your card cannot be charged"
|
return False, "Your card cannot be charged"
|
||||||
except:
|
except:
|
||||||
LOG.warning("Cannot parse error code from %s", res)
|
LOG.exception(
|
||||||
|
f"cannot change subscription {subscription_id} to {plan_id}, paddle response: {res}"
|
||||||
|
)
|
||||||
return False, ""
|
return False, ""
|
||||||
|
|
||||||
return False, ""
|
return False, ""
|
||||||
|
Loading…
Reference in New Issue
Block a user