简体   繁体   English

贝宝(PHP):无法使用客户端证书(找不到密钥或密码错误?)

[英]Paypal(PHP): unable to use client certificate (no key found or wrong pass phrase?)

I'm using Paypal Express Checkout for my shopping chart. 我正在将Paypal Express Checkout用于我的购物图表。 i have created my API certificate file as below. 我创建了我的API证书文件,如下所示。 在此处输入图片说明

i have downloaed the api certificate file cert_key_pem.txt and used for api credential as below. 我下载了api证书文件cert_key_pem.txt并用于api凭据,如下所示。

  $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 谢谢

If you are using certificate to auth the API, you may want to change the endpoint to https://api.sandbox.paypal.com/nvp 如果您使用证书来认证API,则可能需要将端点更改为https://api.sandbox.paypal.com/nvp

The https://api-3t.sandbox.paypal.com/nvp , and all "-3t" surffixed endpoints are for signature auth API calls (3T means 3 token: username/password/signature) https://api-3t.sandbox.paypal.com/nvp和所有“ -3t”后缀的终结点均用于签名Auth API调用(3T表示3个令牌:用户名/密码/签名)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 cURL无法使用客户端证书(找不到密钥或错误的密码?) - cURL unable to use client certificate (no key found or wrong pass phrase?) 无法使用客户端证书(找不到密钥或密码错误?) - unable to use client certificate(no key found or wrong pass phrase?) PHP CURL错误:无法使用客户端证书(找不到密钥或密码短语错误?) - PHP CURL error: unable to use client certificate (no key found or wrong pass phrase?) 卷曲失败,并显示错误#58:无法使用客户端证书(找不到密钥或密码短语错误?) - Curl failed with error #58: unable to use client certificate (no key found or wrong pass phrase?) NSS:找不到带有CURL的Paypal的客户端证书(未指定昵称) - NSS: client certificate not found (nickname not specified) with Paypal with CURL cURL无法在本地服务器中使用客户端证书 - cURL is unable to use client certificate , in local server 如何在php laravel 8中通过HTTP Client传递客户端证书 - How to pass client certificate through HTTP Client in php laravel 8 如何将PHP变量值传递给Paypal客户代码 - How can I pass PHP variables value to Client Code for Paypal PHP CURL“ NSS:找不到客户端证书(未指定昵称)”问题 - PHP CURL “NSS: client certificate not found (nickname not specified)” Issue 在PHP中使用curl和客户端证书以及单独文件中的私钥 - Using curl in php with client certificate and private key in separate files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM