diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index 4638a8ab..951fabd2 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/views.py b/osinaweb/customercore/views.py index 87788cf1..bfd60fdc 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -68,9 +68,11 @@ def initiate_checkout(request): print("Response Content:", response.content.decode()) # Print response content if response.status_code == 200: - response_data = response.json() - session_id = response_data.get("session.id") - return JsonResponse({"session_id": session_id}) + response_data = response.text + parsed_data = dict(item.split("=") for item in response_data.split("&")) + session_id = parsed_data.get("session.id") + success_indicator = parsed_data.get("successIndicator") + return JsonResponse({"session_id": session_id, "success_indicator": success_indicator}) else: print("Response Status Code:", response.status_code) # Print status code return JsonResponse({"error": "Failed to initiate checkout"}, status=500)