emile 1 year ago
parent 2f02e614fe
commit d8528b4558

@ -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

Loading…
Cancel
Save