<?php
extract($_POST);
if (isset($price)){
$xml = "<?xml version='1.0' encoding='UTF-8'?>
<TKKPG>
<Request>
<Operation>CreateOrder</Operation>
<Language>EN</Language>
<Order>
<Merchant>WAYTELL</Merchant>
<Amount>".$amt."</Amount>
<Currency>566</Currency>
<Description>".$prot."</Description>
<ApproveURL>http://localhost/integration/approved.php</ApproveURL>
<CancelURL>http://localhost/integration/declined.php</CancelURL>
<DeclineURL>http://localhost/integration/declined.php</DeclineURL>
</Order>
</Request>
</TKKPG>";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://196.46.20.36:5443/Exec");
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_VERBOSE, '1');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 5000);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CAINFO, getcwd().'/cert/CAcert.crt');
curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/cert/waytell.pem');
curl_setopt($ch, CURLOPT_SSLKEY, getcwd().'/cert/waytell.key');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$response = curl_exec($ch);
if(!(curl_errno($ch)>0)){
$parsedxml = simplexml_load_string($response);
foreach($parsedxml->children() as $RESPONSENODE)
{
foreach($RESPONSENODE->children() as $ORDERNODE)
{
foreach($ORDERNODE->children() as $child)
{
if ($child->getName() == "OrderID")
$orderid = $child;
if ($child->getName() == "SessionID")
$sessionid = $child;
if ($child->getName() == "URL")
$url = $child;
}
}
}//end all loop
$gateway_url = $url."?ORDERID=".$orderid."&SESSIONID=".$sessionid;
header("location: ".$gateway_url);
}
}
?>
Can someone help me out