Here is a simple example of a PHP script source code to help developers integrate with our Transparent Database Engine.
Use of this source code requires intermediate to advanced PHP programming language as well as having PHP+Curl installed on the webserver.
The values in the $POSTFIELDS are hardcoded values. They will need to be replaced, most of these with values prompted by your customers.
If you wish access to our test account please use the Request Test Account Access form from the Developers Page.
<?php
$url="https://secure.quantumgateway.com/cgi/tqgwdbe.php";
$LOGINURL = "$url";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (affgrabber)";
$POSTFIELDS =
"&gwlogin=gwtest". #required
"&ccnum=5454 5454 5454 5454". #required
"&ccmo=12". #required
"&ccyr=10". #required
"&amount=19.95". #required
"&BADDR1=120 First St ". #required
"&BZIP1=77985". #required
"&BCUST_EMAIL=test@quantumgateway.com". #required
"&BNAME=John Doe ".
"&Dsep=Pipe".
"&CVVtype=1".
"&CVV2=998".
"&customer_ip=127.0.0.1".
"&MAXMIND=1" ;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, $reffer);
$result = curl_exec ($ch);
curl_close ($ch);
$mytest = $result;
$passback_exp=explode("|", $mytest); #break result into pieces.
$auth=trim($passback_exp[0]); # take the first component
$auth=str_replace("\"", "", "$auth"); # get rid of the wrapping Quotes " "
if(preg_match("/APPROVED/i","$auth")) {
#do your approved routine
} else {
#do your declined routine
}
?>