From ce2d16af4da00568ea77608de92d1250263da7fe Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 2 Feb 2021 22:19:08 +0100 Subject: [PATCH] fix --- rowers/braintreestuff.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py index 37ebd44d..67b9af75 100644 --- a/rowers/braintreestuff.py +++ b/rowers/braintreestuff.py @@ -55,14 +55,16 @@ from rowers.models import Rower,PaidPlan, CoachingGroup from rowers.utils import ProcessorCustomerError def process_webhook(notification): - print(notification.kind,notification.subscription.id) + print(notification.kind) if notification.kind == 'subscription_charged_successfully': subscription_id = notification.subscription.id + print(subscription_id) rs = Rower.objects.filter(subscription_id=subscription_id) if rs.count() == 0: return 0 else: r = rs[0] + print(r) fakturoid_contact_id = fakturoid.get_contacts(r) if not fakturoid_contact_id: fakturoid_contact_id = fakturoid.create_contact(rower) @@ -82,6 +84,8 @@ def webhook(request): except InvalidSignatureError: return 4 + print(webhook_notification.kind) + result = process_webhook(webhook_notification)