From 69d5de8d41de50ee4341e87d78aa5780c110ac70 Mon Sep 17 00:00:00 2001 From: Son Nguyen Kim Date: Tue, 2 Aug 2022 12:43:48 +0200 Subject: [PATCH] fix paddle refund (#1213) --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index bdf74b34..613ee258 100644 --- a/server.py +++ b/server.py @@ -601,9 +601,9 @@ def setup_paddle_callback(app: Flask): ) return "No such subscription" - plan_id = request.form["subscription_plan_id"] + plan_id = int(request.form["subscription_plan_id"]) if request.form["refund_type"] == "full": - if plan_id == PADDLE_MONTHLY_PRODUCT_ID: + if plan_id in PADDLE_MONTHLY_PRODUCT_IDS: LOG.d("subtract 1 month from next_bill_date %s", sub.next_bill_date) sub.next_bill_date = sub.next_bill_date - relativedelta(months=1) LOG.d("next_bill_date is %s", sub.next_bill_date)