Skip to content

Commit

Permalink
Ability to set scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephangroen committed Nov 20, 2015
1 parent 435f0eb commit 9a5df5d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Picqer/Financials/Moneybird/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ class Connection
*/
private $testing = false;

/**
* @var array
*/
private $scopes = [];

/**
* @return Client
*/
Expand Down Expand Up @@ -239,7 +244,7 @@ private function getAuthUrl()
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUrl,
'response_type' => 'code',
'scope' => 'sales_invoices documents estimates bank settings'
'scope' => $this->scopes ? implode(' ', $this->scopes) : 'sales_invoices documents estimates bank settings'
));
}

Expand Down Expand Up @@ -440,5 +445,13 @@ public function getTokenUrl()
return $this->tokenUrl;
}

/**
* @param array $scopes
*/
public function setScopes($scopes)
{
$this->scopes = $scopes;
}

}

0 comments on commit 9a5df5d

Please sign in to comment.