### Background payment gateway calling - paymentMethod=7 (Bank transfer)
### paramaters dependent by project
$projectID=142;
$paymentMethod=7;
$paymentAmountID=39;
$TID=0; # affiliate partner identification (must be "0" if not used)
$TID1=0; # affiliate partner identification (must be "0" if not used)
$TID2=0; # affiliate partner identification (must be "0" if not used)
$amount=123400; # 1234.00 CZK
$description="Very nice things for 1234 CZK only."; # description of transaction
### CRC creation
$crc=$projectID.$paymentMethod.$paymentAmountID.$TID.$TID1.$TID2.$amount.$description;
$crc=md5($crc);
### Payment gateway URL
$url="http://gate.xpay.cz/hidden/";
### GET paramaters construction
$paramater="";
$parameter.="?projectID=".$projectID;
$parameter.="&paymentMethod=".$paymentMethod;
$parameter.="&paymentAmountID=".$paymentAmountID;
$parameter.="&tarifAmount=".$amount;
$parameter.="&tarifDescription=".urlencode($description);
$parameter.="&tarifCRC=".$crc;
$parameter.="&P1=";
$parameter.="&P2=";
$parameter.="&P3=";
$parameter.="&TID=0";
$parameter.="&TID1=0";
$parameter.="&TID2=0";
$parameter.="&TEST=0";
### Call the gateway (PHP module CURL needed)
# if(!extension_loaded("curl")){dl("curl.so");}
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url.$parameter);
curl_setopt($ch,CURLOPT_TIMEOUT,300);
curl_setopt($ch,CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$res=explode("\n",curl_exec($ch));
curl_close($ch);
### Parse output (look for PSV line and parse information)
$phonenumber=$amount=$currency=$prefix=$pin="";
for($i=0;$i\n";
for($i=0;$i\n";
}
echo $url.$parameter."
\n";
}else{
### print information about SMS payment to customer
echo "Make a bank money transfer to account number ".$accountnumber."/".$bankcode."";
echo " in amount of ".$amount." ".$currency." with identification code ".$pin."
\n";
if($address!=""){
echo "Account owner is: ".$address."
\n";
}
}
?>