fix paddle refund (#1213)

This commit is contained in:
Son Nguyen Kim 2022-08-02 12:43:48 +02:00 committed by GitHub
parent d72226aa19
commit 69d5de8d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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)