Merge branch 'release/v15.35'
This commit is contained in:
@@ -55,10 +55,11 @@ from rowers.models import Rower,PaidPlan, CoachingGroup
|
|||||||
from rowers.utils import ProcessorCustomerError
|
from rowers.utils import ProcessorCustomerError
|
||||||
|
|
||||||
def process_webhook(notification):
|
def process_webhook(notification):
|
||||||
|
print(notification.kind,notification.subscription.id)
|
||||||
if notification.kind == 'subscription_charged_successfully':
|
if notification.kind == 'subscription_charged_successfully':
|
||||||
subscription_id = notification.subscription.id
|
subscription_id = notification.subscription.id
|
||||||
rs = Rower.objects.filter(subscription_id=subscription_id)
|
rs = Rower.objects.filter(subscription_id=subscription_id)
|
||||||
if rs.count == 0:
|
if rs.count() == 0:
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
r = rs[0]
|
r = rs[0]
|
||||||
@@ -293,6 +294,8 @@ def create_subscription(rower,data):
|
|||||||
"payment_method_nonce": nonce_from_the_client
|
"payment_method_nonce": nonce_from_the_client
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if result.is_success:
|
if result.is_success:
|
||||||
payment_method_token = result.payment_method.token
|
payment_method_token = result.payment_method.token
|
||||||
else:
|
else:
|
||||||
@@ -304,7 +307,6 @@ def create_subscription(rower,data):
|
|||||||
# "merchant_account_id": BRAINTREE_MERCHANT_ACCOUNT_ID,
|
# "merchant_account_id": BRAINTREE_MERCHANT_ACCOUNT_ID,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
if result.is_success:
|
if result.is_success:
|
||||||
yesterday = (timezone.now()-datetime.timedelta(days=1)).date()
|
yesterday = (timezone.now()-datetime.timedelta(days=1)).date()
|
||||||
rower.paidplan = plan
|
rower.paidplan = plan
|
||||||
|
|||||||
Reference in New Issue
Block a user