Hi, I have a site that is running Opencart and makes payment for the Paybras, testing locally worked 100%, but in Digital Ocean Json return of payment is always null. The Firewall is empty and already installed Curl and Json, etc-http://126.96.36.199/info.php. The code used is as follows:
$ch = curl_init ($url); $data _ string = json_encode ($data);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, “POST”); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data _ string); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_HTTPHEADER, array ( ’ Content-Type: application/json ', ’ Content-Length: '. strlen ($data _ string)) ); $resultado = curl_exec ($ch); curl_close ($ch); return $resultado;
Log data: It returns the following steps: 2/3/2014 13:44:04-Paybras = 1 validation 2/3/2014 13:44:04-Calling the Curl Paybras 2/3/2014 13:44:05-Return the Json (wave) 2/3/2014 13:44:05-if non-success
Being the return of Json (Curl) was to return a variable of success, but as the return is empty does not return anything. The Curl is running normal with other mode of payment, so that’s not a problem with him. The function is called by Ajax Post type and Json data and before you go to the Log data is converted into PHP with json_decode and only after I test the Log. Does anyone have any idea what can be the problem?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.