From 4364e7a8c95fb2da33a5264b82051e6ea451cd75 Mon Sep 17 00:00:00 2001 From: Robert Date: Mon, 6 Feb 2023 19:45:37 +0100 Subject: [PATCH] Update README.md --- .gitignore | 4 ++++ README.md | 12 ++++++++++-- composer.json | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2bc033f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +vendor/ +composer.lock +.DS_Store +.idea/ diff --git a/README.md b/README.md index a4d8ef6..53e6667 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 +]); +``` \ No newline at end of file diff --git a/composer.json b/composer.json index d6a7518..7023e56 100644 --- a/composer.json +++ b/composer.json @@ -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" },