Private
Public Access
1
0

Merge branch 'release/v15.30'

This commit is contained in:
Sander Roosendaal
2021-02-02 20:42:19 +01:00
2 changed files with 8 additions and 4 deletions

View File

@@ -53,9 +53,12 @@ from rowers.models import Rower,PaidPlan, CoachingGroup
from rowers.utils import ProcessorCustomerError from rowers.utils import ProcessorCustomerError
def webhook(request): def webhook(request):
try:
webhook_notification = gateway.webhook_notification.parse( webhook_notification = gateway.webhook_notification.parse(
str(request.POST['bt_signature']), str(request.POST['bt_signature']),
request.POST['bt_payload']) request.POST['bt_payload'])
except:
print(sys.exc_info())
# Example values for webhook notification properties # Example values for webhook notification properties
print(webhook_notification.kind) # "subscription_went_past_due" print(webhook_notification.kind) # "subscription_went_past_due"

View File

@@ -6,6 +6,7 @@ from __future__ import unicode_literals
from rowers.views.statements import * from rowers.views.statements import *
def braintree_webhook_view(request): def braintree_webhook_view(request):
if request.method == 'POST':
braintreestuff.webhook(request) braintreestuff.webhook(request)
return JsonResponse(status=200) return JsonResponse(status=200)