Merge pull request #964 from simple-login/paddle-fix

Improve paddle handling
This commit is contained in:
Adrià Casajús 2022-05-11 14:24:49 +02:00 committed by GitHub
commit dc51ad4f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -513,7 +513,9 @@ def setup_paddle_callback(app: Flask):
) )
else: else:
return "No such subscription", 400 # user might have deleted their account
LOG.i(f"Cancel non-exist subscription {subscription_id}")
return "OK"
elif request.form.get("alert_name") == "subscription_updated": elif request.form.get("alert_name") == "subscription_updated":
subscription_id = request.form.get("subscription_id") subscription_id = request.form.get("subscription_id")
@ -547,6 +549,9 @@ def setup_paddle_callback(app: Flask):
Session.commit() Session.commit()
else: else:
LOG.w(
f"update non-exist subscription {subscription_id}. {request.form}"
)
return "No such subscription", 400 return "No such subscription", 400
elif request.form.get("alert_name") == "payment_refunded": elif request.form.get("alert_name") == "payment_refunded":
subscription_id = request.form.get("subscription_id") subscription_id = request.form.get("subscription_id")