Payment Gateway Integration To access the URL, I’m using PHP’s cURL function. Please refer to the code.
The code answer is 200 OK. However, it is not the intended answer. I reviewed the request headers in the developer tool and found that the Origin value is null.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://test.sbiepay.sbi/secure/AggregatorHostedListener");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'EncryptTrans' => $EncryptTrans,
'merchIdVal' => $sbimerchantid
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Origin: https://daa12.in',
'Referer: https://daa12.in/',
'Content-Type: application/x-www-form-urlencoded',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if ($response === false) {
echo "cURL Error: " . curl_error($ch);
}
else
{
echo $response;
}
curl_close($ch);
Please provide the solution for this issue. If the proper URL is passed by the origin variable, I will receive the anticipated response. I don’t know; the origin value is null.
This is the request headers value
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-encoding: gzip, deflate, br, zstd
accept-language: en-US,en;q=0.9,ar;q=0.8
cache-control: max-age=0
connection: keep-alive
content-length: 318
content-type: application/x-www-form-urlencoded
cookie: PHPSESSID=07s6sja3dqlllmrl9n82kq46ob
host: daa12.in
origin: null