error catching
This commit is contained in:
@@ -53,9 +53,12 @@ from rowers.models import Rower,PaidPlan, CoachingGroup
|
||||
from rowers.utils import ProcessorCustomerError
|
||||
|
||||
def webhook(request):
|
||||
webhook_notification = gateway.webhook_notification.parse(
|
||||
str(request.POST['bt_signature']),
|
||||
request.POST['bt_payload'])
|
||||
try:
|
||||
webhook_notification = gateway.webhook_notification.parse(
|
||||
str(request.POST['bt_signature']),
|
||||
request.POST['bt_payload'])
|
||||
except:
|
||||
print(sys.exc_info())
|
||||
|
||||
# Example values for webhook notification properties
|
||||
print(webhook_notification.kind) # "subscription_went_past_due"
|
||||
|
||||
@@ -6,7 +6,8 @@ from __future__ import unicode_literals
|
||||
from rowers.views.statements import *
|
||||
|
||||
def braintree_webhook_view(request):
|
||||
braintreestuff.webhook(request)
|
||||
if request.method == 'POST':
|
||||
braintreestuff.webhook(request)
|
||||
return JsonResponse(status=200)
|
||||
|
||||
def paidplans_view(request):
|
||||
|
||||
Reference in New Issue
Block a user