From d6575f22b76d9d15d73a462adcb838fed251eb70 Mon Sep 17 00:00:00 2001 From: Ryan Verner Date: Wed, 19 Apr 2017 14:09:03 +1000 Subject: [PATCH 1/2] Don't set a quantity if no DEFAULT_PLAN is set --- pinax/stripe/actions/customers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pinax/stripe/actions/customers.py b/pinax/stripe/actions/customers.py index 6f9ae16b8..471ecdc68 100644 --- a/pinax/stripe/actions/customers.py +++ b/pinax/stripe/actions/customers.py @@ -27,7 +27,7 @@ def can_charge(customer): return False -def create(user, card=None, plan=settings.PINAX_STRIPE_DEFAULT_PLAN, charge_immediately=True, quantity=1): +def create(user, card=None, plan=settings.PINAX_STRIPE_DEFAULT_PLAN, charge_immediately=True, quantity=None): """ Creates a Stripe customer. @@ -46,6 +46,9 @@ def create(user, card=None, plan=settings.PINAX_STRIPE_DEFAULT_PLAN, charge_imme """ trial_end = hooks.hookset.trial_period(user, plan) + if plan and not quantity: + quantity = 1 # if there's a default plan, set a default quantity + stripe_customer = stripe.Customer.create( email=user.email, source=card, From 8a65bdbb20cec704cdeeb8810704d10557fbcc0d Mon Sep 17 00:00:00 2001 From: Ryan Verner Date: Wed, 19 Apr 2017 14:34:43 +1000 Subject: [PATCH 2/2] Remove conditional default; the API does this anyway. --- pinax/stripe/actions/customers.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pinax/stripe/actions/customers.py b/pinax/stripe/actions/customers.py index 471ecdc68..5606200bb 100644 --- a/pinax/stripe/actions/customers.py +++ b/pinax/stripe/actions/customers.py @@ -46,9 +46,6 @@ def create(user, card=None, plan=settings.PINAX_STRIPE_DEFAULT_PLAN, charge_imme """ trial_end = hooks.hookset.trial_period(user, plan) - if plan and not quantity: - quantity = 1 # if there's a default plan, set a default quantity - stripe_customer = stripe.Customer.create( email=user.email, source=card,