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