Working on the payfort payment api https://testfort.payfort.com/api/?#merchant-page I have got a problem with REST POST request using JSON after tokinization is performed. my code is
$requestParams=json_encode($requestParams);
$service_url = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, $requestParams);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($requestParams)));
$curl_response = curl_exec($curl);
$curl_response is always false
I was facing the same problem. You can use the below code. Its working fine.
This is return you the complete payfort response.
This one give the result
I don't have specific information about payfort but, you're sending JSON data in a wrong way (maybe).
You shuld try to add "json=" prefix and filter/encode some special characters using urlencode.