Artimal
Artimal

Reputation: 661

PayPal REST PHP SDK API is still accessing Sandbox, even with Live credentials

I have a problem with switching to Live. I had changed my credentials to that ones from a Live Tab at https://developer.paypal.com app panel. I can see following error:

Got Http response code 401 when accessing https://api.sandbox.paypal.com/v1/oauth2/token.

Same code with sandbox credentials is working very well. So it is still trying to access sandbox and get reject because of course live credentials are not correct at sandbox.

Strange problem, please for help.

Upvotes: 2

Views: 302

Answers (1)

Rishiraj Purohit
Rishiraj Purohit

Reputation: 457

Assuming you are using PayPal PHP SDK, It is pretty simple, all you have to do is set up some configurations for your apiContext object.

according to this url here : Setting PayPal configuration

you can use below code for php.

$apiContext->setConfig(
      array(
        ...
        'mode' => 'live',
        ...
      )
);

hope this helps.

Upvotes: 3

Related Questions