i try to integration Hosted Checkout of mastercard by PHP
my code
<?php
$orderid = "45";
$merchant = "xxxxx_xxx";
$apipassword = "xxxxxxxxxxxxx";
$amount = "1.00";
$returnUrl = "http://www.google.com";
$currency = "USD";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "ttps://banquemisr.gateway.mastercard.com/api/nvp/version/61");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "
apiOperation=CREATE_CHECKOUT_SESSION &
apiPassword=$apipassword &
apiUsername=$merchant &
merchant=$merchant &
interaction.operation=PURCHASE &
order.id=$orderid &
order.amount=$amount &
order.currency=$currency
");
$headers = array();
$headers[] = 'content-type: application/x-www-form-urlencoded';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
curl_close($ch);
print_r(explode("&", $result));
?>
It does not show any errors But there is no data
result:
Array ( [0] => )
What is wrong with this code?