Add a 5 min trial period to subscriptions for test purposes iff
ADD_TRIAL_PERIOD_TO_SUBSCRIPTION is set to true
This commit is contained in:
parent
9b798b4376
commit
9b3e292598
5 changed files with 17 additions and 8 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import datetime
|
||||
import logging
|
||||
|
||||
from django import forms
|
||||
|
|
@ -785,7 +786,9 @@ class OrderConfirmationView(DetailView, FormView):
|
|||
subscription_result = stripe_utils.subscribe_customer_to_plan(
|
||||
stripe_api_cus_id,
|
||||
[{"plan": stripe_plan.get(
|
||||
'response_object').stripe_plan_id}])
|
||||
'response_object').stripe_plan_id}],
|
||||
int(datetime.datetime.now().timestamp()) + 300 if settings.ADD_5MIN_TRIAL_TO_SUBSCRIPTION else None
|
||||
)
|
||||
stripe_subscription_obj = subscription_result.get('response_object')
|
||||
# Check if the subscription was approved and is active
|
||||
if (stripe_subscription_obj is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue