Skip to content

Commit

Permalink
only set access token when it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Anderson committed Oct 2, 2023
1 parent 4bb34fc commit 2ad5566
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Models/Paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2ad5566

Please sign in to comment.