
<?php
	//http://stackoverflow.com/questions/18382740/cors-not-working-php
	if (isset($_SERVER['HTTP_ORIGIN'])) {
        header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
        header('Access-Control-Allow-Credentials: true');
        header('Access-Control-Max-Age: 86400');    // cache for 1 day
    }


function httpGet($url)
{
    $ch = curl_init();  
 
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//  curl_setopt($ch,CURLOPT_HEADER, false); 
 
    $output=curl_exec($ch);
 
    curl_close($ch);
    return $output;
}
 
$ApiToken='7E35FC46-C951-2D2F-FB42-7795F3D24C60';

$Amount='20';

$Currency='USD';
$TransType='Auth';
$CardNum='5454545454545454';
$ExpDate='1220';
$NameOnCard='Robert Cardholder';
$CVNum='123';
$InvNum='1485204599';
$Street='843+Holt+Street';
$City='Delray Beach';
 $State='FL';
$Zip='33483';
$Country='US';
$ShippingStreet='843 Holt Street';
$ShippingCity='Delray Beach';
$ShippingState='FL';
$ShippingZip='33483';
$ShippingCountry='US';
$MobilePhone='5612765522';
$Email='testing details';
$TipAmt='0.00';
$TaxAmt='0.00';
$SureChargeAmt='0.00';
$CashBackAmt='0.00';
$ServerID='74.217.87.232';
$PNRef='';
$MagData='';
$ExtData='%3Cforce%3ET%3C%2Fforce%3E';

echo httpGet("https://demo.paycertify.net/ws/encgateway2.asmx/ProcessCreditCard?ApiToken=".$ApiToken.
"&Amount=".$Amount.
"&Currency=".$Currency.
"&TransType=".$TransType.
"&CardNum=".$CardNum.
"&ExpDate=".$ExpDate.
"&NameOnCard=".$NameOnCard.
"&CVNum=".$CVNum.
"&InvNum=".$InvNum.
"&Street=".$Street.
"&City=".$City.
"&State=".$State.
"&Zip=".$Zip.
"&Country=".$Country.
"&ShippingStreet=".$ShippingStreet.
"&ShippingCity=".$ShippingCity.
"&ShippingState=".$ShippingState.
"&ShippingZip=".$ShippingZip.
"&ShippingCountry=".$ShippingCountry.
"&MobilePhone=".$MobilePhone.
"&Email=".$Email.
"&TipAmt=".$TipAmt.
"&TaxAmt=".$TaxAmt.
"&SureChargeAmt=".$SureChargeAmt.
"&CashBackAmt=".$CashBackAmt.
"&ServerID=".$ServerID.
"&PNRef=".$PNRef.
"&MagData=".$MagData.
"&ExtData=".$ExtData);


?>






