### Background payment gateway calling - paymentMethod=11 (SMS Micropayment)
### paramaters dependent by project
$projectID=142;
$paymentMethod=11;
$paymentAmountID=204;
### Payment gateway URL
$url="http://gate.xpay.cz/hidden/";
### GET paramaters contruction
$paramater="";
$parameter.="?projectID=".$projectID;
$parameter.="&paymentMethod=".$paymentMethod;
$parameter.="&paymentAmountID=".$paymentAmountID;
$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";
for($i=0;$i\n";;
}
echo $url.$parameter."
\n";
}else{
### print information about SMS payment to customer
echo "Send ";
if($smsdual<2){echo "one message";}else{echo $smsdual." messages";}
echo " with text ".$prefix." ".$pin." to phonenumber ".$phonenumber."
\n";
echo "The price per SMS is ".$amount." ".$currency."
\n";
if($smsdual>0){
echo "The price for whole payment is ".($smsdual*$amount)." ".$currency."
\n";
}
}
?>