diff --git a/subscriptions/urls.py b/subscriptions/urls.py index 12e0e20..f8a5c4c 100644 --- a/subscriptions/urls.py +++ b/subscriptions/urls.py @@ -5,5 +5,6 @@ from . import views urlpatterns = [ path("", views.index, name="index"), path('app-store-webhook/', views.app_store_webhook, name='app_store_webhook'), + path('app-store-webhook-prod/', views.app_store_webhook_prod, name='app_store_webhook_prod'), path('test/', views.test, name='test'), ] diff --git a/subscriptions/views.py b/subscriptions/views.py index e76069d..c3dcf67 100644 --- a/subscriptions/views.py +++ b/subscriptions/views.py @@ -43,6 +43,17 @@ def test(request): return HttpResponse(string) +@csrf_exempt +def app_store_webhook_prod(request): + + decoded = request.body.decode('utf-8') + + notification = ASSNotification( + content=decoded, + ) + notification.save() + + return JsonResponse({'status': 'success'}) @csrf_exempt def app_store_webhook(request):