Screen Order Integration

Screen an order transaction for payment fraud. This REST API will detects all possibles fraud traits based on the input parameters supplied. The more input parameter supplied, the higher accuracy of fraud detection.

PHP Code

 <?php
$private_key='PRIVATE_KEY';
$registered_email='Your_Email';

$hash='Generated_Hash';

$apiKey = 'PUBLIC_KEY';
$params['ip']               = $_SERVER['REMOTE_ADDR'];
$params['bill_city']        = 'Cleveland';
$params['bill_state']       = 'OH';
$params['bill_zip_code']    = '44115';
$params['bill_country']     = 'US';
$params['ship_addr']        = '4987 Bingamon Road';
$params['ship_city']        = 'Cleveland';
$params['ship_state']       = 'OH';
$params['ship_zip_code']    = '44115';
$params['ship_country']     = 'US';
$params['customer_email']     = 'Customer_Email';
$params['user_phone']       = '440-5551961';
$params['user_order_id']           = '558265';
$params['bank_name']        = 'Bank of Ocean View';
$params['bank_phone']       = '212-500-2489';
$params['avs_result']       = 'Y';
$params['cvv_result']       = 'M';
$params['user_order_id']    = '7893';
$params['amount']           = '99.95';
$params['sku_quantity']         = '1';	  

$query = '';

foreach($params as $key=>$value){
	$query .= '&' . $key . '=' . rawurlencode($value);
}	  
curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.i-encry.com/order/add_order",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "hash=".$hash.$qparams,
  CURLOPT_HTTPHEADER => array(
	"Auth-Key: ".$public_key,
	"cache-control: no-cache",
	"content-type: application/x-www-form-urlencoded",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}?>