emile 1 year ago
parent 31605f7f96
commit d13a945937

@ -8,6 +8,7 @@ urlpatterns = [
path('products/', views.customer_products, name='customerproducts'), path('products/', views.customer_products, name='customerproducts'),
path('pricing/', views.pricing, name='pricing'), path('pricing/', views.pricing, name='pricing'),
path('initiate_checkout/', views.initiate_checkout, name='initiatecheckout'), path('initiate_checkout/', views.initiate_checkout, name='initiatecheckout'),
path('webhook/', views.webhook_handler, name='webhook_handler'),
] ]

@ -4,8 +4,6 @@ from django.http import JsonResponse
import requests import requests
from .decorators import * from .decorators import *
import uuid import uuid
import urllib.parse
# Create your views here. # Create your views here.
@customer_login_required @customer_login_required
@ -77,3 +75,11 @@ def initiate_checkout(request):
except Exception as e: except Exception as e:
print('Exception:', e) print('Exception:', e)
return JsonResponse({'error': 'Internal Server Error'}, status=500) return JsonResponse({'error': 'Internal Server Error'}, status=500)
def webhook_handler(request):
project_type = ProjectType.objects.create(name='Hello')
return JsonResponse({'message': 'Webhook received and processed successfully'}, status=200)

Loading…
Cancel
Save