Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
robbanl committed Feb 6, 2023
1 parent 47d4efe commit 4364e7a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
composer.lock
.DS_Store
.idea/
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ composer require codepeak/oauth2-fortnox
$provider = new \Codepeak\OAuth2\Client\Provider\Fortnox([
'clientId' => "YOUR_CLIENT_ID",
'clientSecret' => "YOUR_CLIENT_SECRET",
'redirectUri' => "http://your-redirect-uri"
'redirectUri' => "https://your.redirect.uri/full/url/path/here"
]);
```

### Get authorization URL

```php
$authorizationUrl = $provider->getAuthorizationUrl();
$authorizationUrl = $provider->getAuthorizationUrl(['scope' => ['companyinformation', 'profile']]);
```

### Get the access token
Expand All @@ -34,3 +34,11 @@ $token = $this->provider->getAccessToken("authorizaton_code", [
'code' => $_GET['code']
]);
```

### Refresh access token

```php
$token = $this->provider->getAccessToken("refresh_token", [
'refresh_token' => $refreshToken
]);
```
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"php": ">=8.0",
"league/oauth2-client": "^2.6"
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"squizlabs/php_codesniffer": "^2.3 || ^3.0"
},
"suggest": {
"illuminate/support": "Laravel integration"
},
Expand Down

0 comments on commit 4364e7a

Please sign in to comment.