first version dummy webhook for braintree
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user