Search code examples
phppaypalpaypal-sandboxpaypal-rest-sdk

php core paypal sdk


i integrate paypal sdks in php but as i excute payment sdks keeps giving me this error

Fatal error: Uncaught exception 'PayPal\Exception\PayPalConnectionException' with message 'error setting certificate verify locations: CAfile: C:\xampp\php\extras\ssl\cacert.pem CApath: none' in C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php:186 Stack trace: #0 C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(252): PayPal\Core\PayPalHttpConnection->execute('grant_type=clie...') #1 C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(280): PayPal\Auth\OAuthTokenCredential->getToken(Array, 'AZbU2vAMzPlnWKj...', 'EL2UKmfG-7Rl4QC...', 'grant_type=clie...') #2 C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(216): PayPal\Auth\OAuthTokenCredential->generateAccessToken(Array, NULL) #3 C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(166): PayPal\Auth\OAuthTokenC in C:\xampp\htdocs\PaypalPayments\vendor\paypal\rest-api-sdk-php\lib\PayPal\Core\PayPalHttpConnection.php on line 186


Solution

  • I also faced the same issue when I integrated Paypal SDK in PHP. I think you execute your code at localhost.

    Just push your code to a live server and it will work like a charm.