2013-07-22

I am creating a small website in which I implemented PayPal REST API to process Credit Card checkouts.

Now the problem is that it is working fine using Sandbox Credentials... but it gives following error when I switch to Live Credentials:

Fatal error: Uncaught exception 'PayPal\Exception\PPConnectionException' with message 'Got Http response code 401 when accessing https://api.paypal.com/v1/payments/payment. Retried 0 times.' in C:\xampp\htdocs\rest_api_sdk_php\sample\vendor\paypal\sdk-core-php\lib\PayPal\Core\PPHttpConnection.php:99 Stack trace: #0 C:\xampp\htdocs\rest_api_sdk_php\sample\vendor\paypal\sdk-core-php\lib\PayPal\Transport\PPRestCall.php(44): PayPal\Core\PPHttpConnection->execute('{"intent":"sale...') #1 C:\xampp\htdocs\rest_api_sdk_php\sample\vendor\paypal\rest-api-sdk-php\lib\PayPal\Api\Payment.php(246): PayPal\Transport\PPRestCall->execute(Array, '/v1/payments/pa...', 'POST', '{"intent":"sale...') #2 C:\xampp\htdocs\rest_api_sdk_php\sample\payments\CreatePayment.php(89): PayPal\Api\Payment->create(Object(PayPal\Rest\ApiContext)) #3 {main} thrown in C:\xampp\htdocs\rest_api_sdk_php\sample\vendor\paypal\sdk-core-php\lib\PayPal\Core\PPHttpConnection.php on line 99

Quite frankly I have no idea what is causing this error. I made changes in two places when switching to PayPal Live. i.e.

1st in "bootstrap.php":

Gave Live Client-ID and Secret. And the other file in which I made change is "sdk_config.ini":

Changed "mode" from "sandbox" to "live"

Is there any other file also in which I have to make changes?

Show more