I am trying to get response from server using HTTP context:
$cparams = array(
"ssl"=>array(
"verify_peer"=>true,
"verify_peer_name"=>true,
),
'http' => $request['httpOptions']
);
$context = stream_context_create($cparams);
$fp = fopen($request['url'], 'rb', false, $context);
But it showing
Error in exception handler: fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
This is the URL:
$url = EZPAY_SERVER . "/hps/webservice/ezpay/CreateSessionKey";
ie,
https://psp.stg.transactium.com/hps/webservice/ezpay/CreateSessionKey?privateMerchantKey=********************
So i want to try it with Curl,
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Length: 0'));
curl_setopt($ch, CURLOPT_URL,$request['url']);
curl_setopt($ch, CURLOPT_POST, 1);
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);
But now I'am getting this error.
A public action method 'CreateSessionKey' was not found on controller 'Transactium.HostedPayment.Controllers.EZPayController'. Notice: Trying to get property of non-object in /var/www/html/ezpay/library/EZPay.php on line 12