Private
Public Access
1
0

first version dummy webhook for braintree

This commit is contained in:
Sander Roosendaal
2021-02-02 20:28:36 +01:00
parent aa5b2c82f0
commit c41b7611ee
3 changed files with 16 additions and 0 deletions

View File

@@ -52,6 +52,17 @@ else:
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'])
# Example values for webhook notification properties
print(webhook_notification.kind) # "subscription_went_past_due"
print(webhook_notification.timestamp) # "Sun Jan 1 00:00:00 UTC 2012"
return Response(status=200)
def create_customer(rower,force=False):
if not rower.customer_id or force:
result = gateway.customer.create(