I'm using Paypal Express Checkout for my shopping chart. i have created my API certificate file as below.
i have downloaed the api certificate file cert_key_pem.txt
and used for api credential as below.
$API_UserName = $paypal->username;
$API_Password = $paypal->password;
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
$PAYPAL_URL = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
$version="64";
$currencyCodeType = "USD";
$paymentType = "Sale";
$methodName = "DoExpressCheckoutPayment";
$certFile = 'C:\xampp\htdocs\project-name\cert_key.txt';//forlocalhost
//$certFile = '/home/cpanel-username/public_html/cert_key_pem.txt'; //for live server
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSLCERT, $certFile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
$nvpreq="METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode);
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
$response = curl_exec($ch);
if(curl_exec($ch) === false)
{
$message = curl_error($ch);
}
else
{
$message = 'Operation completed without any errors';
}
curl_close($ch);
echo $message;
but i got the error message as below.
unable to use client certificate (no key found or wrong pass phrase?)
if you have any idea on solving such type of errors then please help me. thanks