
<?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='6C82FAD8-09A3-84BA-D772-E803157B4B1D';
$PNRef='96a343ab-cd83-4d9d-868f-2b931c3c6593';
$Amount='10.00';
$AuthCode='898989';
$AuthTime='2017-02-14+08%3A08%3A55';
$CardEaseReference='0220e919-4b69-e611-8e66-0050569228c2';
$CardHash='ExN%2FuBaDWTa6QkPRlU26rqfKuDU%3D';
$CardReference='98642dfd-6737-e411-a99d-001422187e37';
$NameOnCard='John+Doe';
$CardType='VISA+DEBIT';
$ExpireDate='1712';
 $MerchantName='Standard+Test+Merchant';
$PanMasked='476173%2A%2A%2A%2A%2A%2A0211';
$PanSequence='01';
$Result='0';
$SignatureCaptured='False';
$SignatureRequired='False';
$TransSource='ICC';
$TransType='Sale';
$TransVerification='PIN+VERIFIED';
$DeviceModel='Ingenico-iPP350-RBA';
$DeviceId='2214324PT012653';
$LinkedTran='343';
$TerminalID='99963246';
$LogKey='00012';
$Receipt='';



//echo httpGet("https://demo.paycertify.net/ws/encgateway2.asmx/ProcessCreditCard?ApiToken=".$ApiToken.

 
   echo httpGet("https://demo.paycertify.net/ws/trxdetail.asmx/CaptureReceipt?ApiToken=".$ApiToken.
"&PNRef=".$PNRef.
"&Amount=".$Amount.
"&AuthCode=".$AuthCode.
"&AuthTime=".$AuthTime.
"&CardEaseReference=".$CardEaseReference.
"&CardHash=".$CardHash.
"&CardReference=".$CardReference.
"&NameOnCard=".$NameOnCard.
"&CardType=".$CardType.
"&ExpireDate=".$ExpireDate.
"&MerchantName=".$MerchantName.
"&PanMasked=".$PanMasked.
"&PanSequence=".$PanSequence.
"&Result=".$Result.
"&SignatureCaptured=".$SignatureCaptured.
"&SignatureRequired=".$SignatureRequired.
"&TransSource=".$TransSource.
"&TransType=".$TransType.
"&TransVerification=".$TransVerification.
"&DeviceModel=".$DeviceModel.
"&DeviceId=".$DeviceId.
"&LinkedTran=".$LinkedTran.
"&TerminalID=".$TerminalID.
"&LogKey=".$LogKey.
"&Receipt=".$Receipt);





?>






