From 7844281a00bc79e03c1f861d3607538b8aab8e2c Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 26 Jun 2023 21:07:15 -0400 Subject: [PATCH 1/5] Fix #1150 adding Next button to free plan and enforcing the free logic --- .gitignore | 2 +- subscribie/blueprints/checkout/__init__.py | 2 +- .../blueprints/checkout/templates/new_customer.html | 8 +++++++- ...ubscriber_order_free_plan_with_terms_and_conditions.js | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 10bf35871..17ad7c3e6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,4 @@ package-lock.json test-results tests/browser-automated-tests-playwright/index.spec.js-snapshots/* tests/browser-automated-tests-playwright/worker* - +tests/browser-automated-tests-playwright/tests/*spec.js-snapshots diff --git a/subscribie/blueprints/checkout/__init__.py b/subscribie/blueprints/checkout/__init__.py index e443aa2aa..14d72f799 100644 --- a/subscribie/blueprints/checkout/__init__.py +++ b/subscribie/blueprints/checkout/__init__.py @@ -200,7 +200,7 @@ def order_summary(): if is_donation is False: plan = Plan.query.filter_by(uuid=session["plan"]).first() # if plan is free, skip Stripe checkout and store subscription right away - if plan.is_free(): + if plan.is_free() or (plan.interval_amount == 0 and plan.sell_price == 0): log.info("Plan is free, so skipping Stripe checkout") chosen_option_ids = session.get("chosen_option_ids", None) diff --git a/subscribie/blueprints/checkout/templates/new_customer.html b/subscribie/blueprints/checkout/templates/new_customer.html index 54f790b3c..d13ba83c4 100644 --- a/subscribie/blueprints/checkout/templates/new_customer.html +++ b/subscribie/blueprints/checkout/templates/new_customer.html @@ -166,7 +166,13 @@

{{ _('Choices') }}

- +