PayPal App works perfectly as Sandbox, Client Authentication failed on Live: list of steps to check?
Asked Answered
C

2

1

I have created my PayPal App to get payments in my website build in a PHP framework. This is server-side and I'm using PayPal REST API and PayPal-PHP-SDK library.

Everything is perfect on Sandbox (tested localhost and online as well).

After then, I've switched to Live mode. I've changed ClientID and SecretID of course, but the Client Authentication failed.

The complete error is:

{"error":"invalid_client","error_description":"Client Authentication failed"} 

What I've verified is that

    $apiContext = new \PayPal\Rest\ApiContext(
        new \PayPal\Auth\OAuthTokenCredential(
            self::$configuration['ClientID'],
            self::$configuration['ClientSecret']
        )
    );

missed because I've got NULL.

So, I've tried again with a new SecretID (I've generated another one), but still got error.

My business paypal account is verified after linking my credit card, after submitting the 4-digit code and after having confirmation from PayPal support at the phone.

Other steps to check? Thanks!

Cherlycherlyn answered 14/4, 2018 at 9:39 Comment(1)
Hi! I have the exact same problem. Did you ever find the answer to this? #54512117Besotted
S
0

If you use php have a look at the function

public static function environment() in class PayPalClient

and change

return new SandboxEnvironment($clientId, $clientSecret);

to

return new ProductionEnvironment($clientId, $clientSecret); 
Skintight answered 21/7, 2020 at 16:33 Comment(0)
D
0

If you use php, then set live mode with it's config like this:

$apiContext->setConfig([
        'mode' => 'live'
    ]);
Dacoity answered 5/9 at 7:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.