diff --git a/src/Models/Paypal.php b/src/Models/Paypal.php index 2f9f7fa..e9626e9 100644 --- a/src/Models/Paypal.php +++ b/src/Models/Paypal.php @@ -18,7 +18,10 @@ public function __construct() { $this->client = new PayPalClient(); $this->client->setApiCredentials(config('paypal')); - $this->client->setAccessToken($this->cacheAccessToken()); + + if (array_keys($this->cacheAccessToken()['access_token'])) { + $this->client->setAccessToken($this->cacheAccessToken()); + } $mode = config('paypal.mode'); $this->clientId = config("paypal.{$mode}.client_id");