$certStore=dirname(__FILE__)."/cert/cert.pem";
$caStore=dirname(__FILE__)."/cert/ca.pem";
$keyStore=dirname(__FILE__)."/cert/key.pem";
$keyPass=$this->session->data['key'];
$keyStoreType= "PEM";
$ch= curl_init();
curl_setopt($ch, CURLOPT_URL, $gateway_url);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);
curl_setopt($ch, CURLOPT_PORT, 443);
curl_setopt($ch, CURLOPT_CAINFO,$caStore);
curl_setopt($ch, CURLOPT_SSLCERT,$certStore);
curl_setopt($ch, CURLOPT_SSLKEY,$keyStore);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $keyPass);
curl_setopt($ch, CURLOPT_SSLKEYTYPE,$keyStoreType);
$headers = array();
array_push($headers, "Content-Type: text/xml; charset=utf-8");
array_push($headers, "SOAPAction: sii:RB_OLP_INITIATE_PAYMENT");
array_push($headers, "Host:b2brbtest.riyadbank.com");
if($request_string != null) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_string);
array_push($headers, "Content-Length: " . strlen($request_string));
}
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_POST, true);