feat: improved order payment lifecycle

This commit is contained in:
2025-01-16 18:17:53 +01:00
parent ebb6d5a5a5
commit 6c60df2da0
7 changed files with 108 additions and 13 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import csrf_exempt
from shop.models import Order
from shop.utils import pay_order, validate_payment_for_order
from shop.utils import validate_payment_for_order, add_payment_to_order
@csrf_exempt
@@ -12,7 +12,7 @@ def webhook(request, uuid):
try:
amount_paid = validate_payment_for_order(request, order)
pay_order(order, amount_paid)
add_payment_to_order(order, amount_paid)
return HttpResponse(status=200)
except Exception as e: