Reputation: 1
I am using PHP to check payment status but I am getting this error
{"message":"Bad Request - Api Mapping Not Found"}
function checkstatus() {
global $MID, $txnid, $baseUrl, $saltkey, $keyindex;
$merchantId = $MID;
$transactionId = $txnid;
$url = $baseUrl . '/v1/transaction/' . $merchantId . '/' . $transactionId . '/status';
// for Sha256 calculation
$api_saltkey = $saltkey;
$str_forSha256 = '/v1/transaction/' . $merchantId . '/' . $transactionId . '/status' . $api_saltkey;
$sha_value = hash('sha256', $str_forSha256);
$x_verify = $sha_value . '###' . $keyindex;
$headers = array(
"Content-Type: application/json",
"X-VERIFY: $x_verify"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
checkstatus()
I reviewed the PhonePe API documentation and developed the code accordingly. Now, I am looking to obtain the transaction status as the solution.
Upvotes: 0
Views: 783