diff --git a/app/Services/Import/Quickbooks/Auth.php b/app/Services/Import/Quickbooks/Auth.php new file mode 100644 index 000000000000..4fcb373775ec --- /dev/null +++ b/app/Services/Import/Quickbooks/Auth.php @@ -0,0 +1,37 @@ +sdk = $quickbooks; + } + + public function accessToken(string $code, string $realm ) : array + { + // TODO: Get or put token in Cache or DB? + return $this->sdk->accessToken($code, $realm); + } + + public function refreshToken() : array + { + // TODO: Get or put token in Cache or DB? + return $this->sdk->refreshToken(); + } + + public function getAuthorizationUrl(): string + { + return $this->sdk->getAuthorizationUrl(); + } + + public function getState() : string + { + return $this->sdk->getState(); + } +} \ No newline at end of file diff --git a/app/Services/Import/Quickbooks/Service.php b/app/Services/Import/Quickbooks/Service.php index 58461f4a4d25..2060c822ef64 100644 --- a/app/Services/Import/Quickbooks/Service.php +++ b/app/Services/Import/Quickbooks/Service.php @@ -3,6 +3,7 @@ namespace App\Services\Import\Quickbooks; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; +use App\Services\Import\Quickbooks\Auth; use App\Repositories\Import\Quickbooks\Contracts\RepositoryInterface; use App\Services\Import\QuickBooks\Contracts\SdkInterface as QuickbooksInterface; @@ -14,6 +15,11 @@ final class Service $this->sdk = $quickbooks; } + public function getOAuth() : Auth + { + return new Auth($this->sdk); + } + public function getAccessToken() : array { // TODO: Cache token and