diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index de8cf338..0a017929 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 7928f656..3bd77ac1 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -4,6 +4,8 @@ from django.http import JsonResponse import requests from .decorators import * import uuid +import json + # Create your views here. @customer_login_required @@ -60,11 +62,13 @@ def initiate_checkout(request): "order.description": "description_of_order" } + json_data = json.dumps(data) + # Set up Basic HTTP authentication auth = (api_username, api_password) try: - response = requests.post("https://creditlibanais-netcommerce.gateway.mastercard.com/api/rest/version/78/merchant/TEST06127800/session", data=data, auth=auth) + response = requests.post("https://creditlibanais-netcommerce.gateway.mastercard.com/api/rest/version/78/merchant/TEST06127800/session", json=json_data, auth=auth) print("Response Content:", response.content.decode()) # Print response content