Skip to content

Commit 942f676

Browse files
authored
Merge pull request #304 from easytrans/add-state-to-connection
setState function added to connection
2 parents 3011a9e + ca39f07 commit 942f676

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Picqer/Financials/Moneybird/Connection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ class Connection
6868
*/
6969
private $redirectUrl;
7070

71+
/**
72+
* @var string|null
73+
*/
74+
private ?string $state = null;
75+
7176
/**
7277
* @var Client
7378
*/
@@ -349,6 +354,7 @@ public function getAuthUrl()
349354
'client_id' => $this->clientId,
350355
'redirect_uri' => $this->redirectUrl,
351356
'response_type' => 'code',
357+
'state' => $this->state,
352358
'scope' => $this->scopes ? implode(' ', $this->scopes) : 'sales_invoices documents estimates bank time_entries settings',
353359
]);
354360
}
@@ -403,6 +409,14 @@ public function setRedirectUrl($redirectUrl)
403409
$this->redirectUrl = $redirectUrl;
404410
}
405411

412+
/**
413+
* @param string $state
414+
*/
415+
public function setState(string $state): void
416+
{
417+
$this->state = $state;
418+
}
419+
406420
/**
407421
* @return bool
408422
*/

0 commit comments

Comments
 (0)