From b2cff485eb237488fcf8a0a75b6281021538f5d5 Mon Sep 17 00:00:00 2001 From: Priyansh61 <21bec080@iiitdmj.ac.in> Date: Wed, 24 Apr 2024 13:57:16 +0530 Subject: [PATCH] Fix : payment rollback issue on fail --- backend/tickets/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/tickets/views.py b/backend/tickets/views.py index 4e24793..e30c92e 100644 --- a/backend/tickets/views.py +++ b/backend/tickets/views.py @@ -102,6 +102,7 @@ def post(self, request, *args, **kwargs): order.save() return Response(response_data, status=status.HTTP_200_OK) else: + transaction.set_rollback(True) return Response({"error": "Failed to create UPI gateway", "data": response_data}, status=status.HTTP_400_BAD_REQUEST) def create_upi_data(account, txn_id, amount, phone_number, order_id):