$api_url =
'https://yourSubDomain.payfull.com/integration/api/v1';
$merchantPassword = 'your merchant password';
$params = array(
"merchant" => 'your merchant name',
"type" => 'Set',
"get_param" => 'ErpTrx',
"language" => 'tr',
"client_ip" => '192.168.1.1
"transaction_id" => 'P_F_dcb57c356e_43266fe08
"sync_status" => '1',
"sync_message" => 'success',
"remote_id" => '12',
);
ksort($params);
$hashString = "";
foreach ($params as $key=>$val) {
$l = mb_strlen($val);
if($l) $hashString .= $l . $val;
}
$params["hash"] = hash_hmac("sha256", $hashString, $merchantPassword);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
$response = curl_exec($ch);
$curlerrcode = curl_errno($ch);
$curlerr = curl_error($ch);
var_dump(json_decode($response));