fix
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user