diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index cf441a50..5d9deed6 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 bfd60fdc..39d5bd23 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -48,22 +48,22 @@ def initiate_checkout(request): order_id = str(uuid.uuid4())[:8] # Data for Initiate Checkout operation - data = { - "apiOperation": "INITIATE_CHECKOUT", - "apiUsername": api_username, - "apiPassword": api_password, - "merchant": merchant_id, - "interaction.operation": "PURCHASE", - "interaction.merchant.name": merchant_name, - "order.id": order_id, - "order.amount": "100.00", - "order.currency": "USD", - "order.description": "description_of_order" + payload = { + 'apiOperation': 'INITIATE_CHECKOUT', + 'apiUsername': api_username, + 'apiPassword': api_password, + 'merchant': merchant_id, + 'interaction.operation': 'PURCHASE', + 'interaction.merchant.name': merchant_name, + 'order.id': order_id, + 'order.amount': '100.00', + 'order.currency': 'USD', + 'order.description': 'description_of_order' } try: - response = requests.post("https://creditlibanais-netcommerce.gateway.mastercard.com/api/nvp/version/72", data=data) + response = requests.post('https://creditlibanais-netcommerce.gateway.mastercard.com/api/nvp/version/72', json=payload) print("Response Content:", response.content.decode()) # Print response content