<?php
if(isset($_POST['pay']))
{
	// The URL to POST to
	$url = "http://192.168.0.10/w/Default.aspx";
	$action = "My.Soap.Action";
	$mySOAP = <<<EOD
	<?xml version="1.0" encoding="utf-8" ?>
	<soap:Envelope>
	<!-- SOAP goes here, irrelevant so wont bother writing it out -->
	</soap:Envelope>
EOD;
	$headers = array(
	'Content-Type: text/xml; charset=utf-8',
	'Content-Length: '.strlen($mySOAP),
	'SOAPAction: '.$action
	);
	$amount=$_POST['amount'];
	$invoiceNumber=rand(0,1000);
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url."?invoiceNumber=$invoiceNumber&amount=$amount");
	curl_setopt($ch, CURLOPT_POST, false);
	curl_setopt($ch, CURLOPT_HTTPGET, true);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	//curl_setopt($ch,CURLOPT_POSTFIELDS,"invoiceNumber=$invoiceNumber&amount=$amount");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

	// Send the request and check the response
	if (($result = curl_exec($ch)) === FALSE)
	{
		die('cURL error: '.curl_error($ch)."<br />\n");
	}
	else
	{
		echo "Success!<br />\n";
	}
	curl_close($ch);

	// Handle the response from a successful request
	echo $result;
}


?>
<!DOCTYPE html>
<html>
<head>
	<title>Payment</title>
	<meta charset="utf-8">
</head>
<body>
<form action="" method="post">
	Amount: <input type="text" name="amount"><br>
	<input type="submit" value="Pay!" name="pay">
</form>
</body>
</html>