From f421aac44ebda3bec57089c4a647c97b53a356a9 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 14 Nov 2014 14:47:09 -0500 Subject: [PATCH] fixing error when recurrence_period is not present --- backend/handlers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/handlers.py b/backend/handlers.py index 7d8a9a1..abf1cd7 100644 --- a/backend/handlers.py +++ b/backend/handlers.py @@ -88,7 +88,7 @@ def Subscribe(self, email, first_name, last_name, amount_cents, ip_addr, time, _STR = dict(type='string') _STR_optional = dict(type='string', required=False) -valid_recurrence_periods = ["monthly", "weekly", "yearly", ""] +valid_recurrence_periods = ["monthly", "weekly", ""] PLEDGE_SCHEMA = dict( type='object', properties=dict( @@ -312,10 +312,11 @@ def post(self): # Do any server-side processing the payment processor needs. stripe_customer_id = None stripe_charge_id = None - print type(data.get('recurring', None)) if 'STRIPE' in data['payment'] and data.get('recurring', '') == True: try: logging.info('Trying to create a stripe customer enrolled in a plan with recurring subscription') + if data.get('recurrence_period', None) == None: + data['recurrence_period'] = 'monthly' stripe_customer = env.stripe_backend.CreateCustomerWithPlan( email=data['email'], card_token=data['payment']['STRIPE']['token'],