From 52d1fb6a0eb402a00c3536446dbf4c7f713516de Mon Sep 17 00:00:00 2001 From: PCoder Date: Thu, 31 Dec 2020 16:27:12 +0530 Subject: [PATCH] Add logger + return 200 on success of webhook --- datacenterlight/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/datacenterlight/views.py b/datacenterlight/views.py index fe98645a..5b67d87c 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -8,7 +8,8 @@ from django.contrib import messages from django.contrib.auth import login, authenticate from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse -from django.http import HttpResponseRedirect, JsonResponse, Http404 +from django.http import HttpResponseRedirect, JsonResponse, Http404, \ + HttpResponse from django.shortcuts import render from django.utils.translation import get_language, ugettext_lazy as _ from django.views.decorators.cache import cache_control @@ -1239,12 +1240,15 @@ def do_provisioning_generic( logger.debug("generic_payment_type case") custom_user, new_user = get_or_create_custom_user( request, stripe_api_cus_id) + logger.debug("%s %s" % (custom_user.email, custom_user.id)) card_id = request.get('card_id', None) card_details_dict = set_user_card(card_id, stripe_api_cus_id, custom_user, card_details_response) + logger.debug("After card details dict %s" % str(card_details_dict)) + # Save billing address billing_address_data.update({ 'user': custom_user.id @@ -1367,7 +1371,7 @@ def do_provisioning_generic( } logger.debug("after response") logger.debug(str(response)) - return {'response': JsonResponse(response), 'user': new_user} + return HttpResponse(status=200) def do_provisioning(request, stripe_api_cus_id, card_details_response,