got a little further - still failing
This commit is contained in:
@@ -43,6 +43,7 @@ else:
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
from rowers.models import Rower,PaidPlan
|
||||
from rowers.utils import ProcessorCustomerError
|
||||
|
||||
@@ -208,6 +209,9 @@ def update_subscription(rower,data,method='up'):
|
||||
def create_subscription(rower,data):
|
||||
planid = data['plan']
|
||||
plan = PaidPlan.objects.get(id=planid)
|
||||
print plan
|
||||
print data
|
||||
raise ValueError
|
||||
nonce_from_the_client = data['payment_method_nonce']
|
||||
amount = data['amount']
|
||||
|
||||
@@ -217,22 +221,18 @@ def create_subscription(rower,data):
|
||||
"payment_method_nonce": nonce_from_the_client
|
||||
})
|
||||
|
||||
print 'aap'
|
||||
|
||||
if result.is_success:
|
||||
payment_method_token = result.payment_method.token
|
||||
else:
|
||||
return False,0
|
||||
|
||||
print 'noot'
|
||||
|
||||
result = gateway.subscription.create({
|
||||
"payment_method_token": payment_method_token,
|
||||
"plan_id": plan.external_id
|
||||
})
|
||||
|
||||
if result.is_success:
|
||||
print 'mies'
|
||||
rower.paidplan = plan
|
||||
rower.planexpires = result.subscription.billing_period_end_date
|
||||
rower.teamplanexpires = result.subscription.billing_period_end_date
|
||||
|
||||
Reference in New Issue
Block a user