mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 03:07:01 +00:00
Merge pull request #11594 from turbo124/v5-develop
Fixes for qb imports without direction access to QB API
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Import\Providers;
|
|||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
|
use App\Import\Providers\BaseImport;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use App\Services\Quickbooks\QuickbooksService;
|
use App\Services\Quickbooks\QuickbooksService;
|
||||||
use App\Services\Quickbooks\Transformers\ClientTransformer;
|
use App\Services\Quickbooks\Transformers\ClientTransformer;
|
||||||
|
|||||||
@@ -62,25 +62,28 @@ class QuickbooksService
|
|||||||
private function init(): self
|
private function init(): self
|
||||||
{
|
{
|
||||||
|
|
||||||
$config = [
|
if(config('services.quickbooks.client_id'))
|
||||||
'ClientID' => config('services.quickbooks.client_id'),
|
{
|
||||||
'ClientSecret' => config('services.quickbooks.client_secret'),
|
$config = [
|
||||||
'auth_mode' => 'oauth2',
|
'ClientID' => config('services.quickbooks.client_id'),
|
||||||
'scope' => "com.intuit.quickbooks.accounting",
|
'ClientSecret' => config('services.quickbooks.client_secret'),
|
||||||
'RedirectURI' => $this->testMode ? 'https://grok.romulus.com.au/quickbooks/authorized' : 'https://invoicing.co/quickbooks/authorized',
|
'auth_mode' => 'oauth2',
|
||||||
'baseUrl' => $this->testMode ? CoreConstants::SANDBOX_DEVELOPMENT : CoreConstants::QBO_BASEURL,
|
'scope' => "com.intuit.quickbooks.accounting",
|
||||||
];
|
'RedirectURI' => $this->testMode ? 'https://grok.romulus.com.au/quickbooks/authorized' : 'https://invoicing.co/quickbooks/authorized',
|
||||||
|
'baseUrl' => $this->testMode ? CoreConstants::SANDBOX_DEVELOPMENT : CoreConstants::QBO_BASEURL,
|
||||||
|
];
|
||||||
|
|
||||||
$merged = array_merge($config, $this->ninjaAccessToken());
|
$merged = array_merge($config, $this->ninjaAccessToken());
|
||||||
|
|
||||||
$this->sdk = DataService::Configure($merged);
|
$this->sdk = DataService::Configure($merged);
|
||||||
|
|
||||||
$this->sdk->enableLog();
|
|
||||||
$this->sdk->setMinorVersion("75");
|
|
||||||
$this->sdk->throwExceptionOnError(true);
|
|
||||||
|
|
||||||
$this->checkToken();
|
|
||||||
|
|
||||||
|
$this->sdk->enableLog();
|
||||||
|
$this->sdk->setMinorVersion("75");
|
||||||
|
$this->sdk->throwExceptionOnError(true);
|
||||||
|
|
||||||
|
$this->checkToken();
|
||||||
|
}
|
||||||
|
|
||||||
$this->invoice = new QbInvoice($this);
|
$this->invoice = new QbInvoice($this);
|
||||||
|
|
||||||
$this->quote = new QbQuote($this);
|
$this->quote = new QbQuote($this);
|
||||||
|
|||||||
Reference in New Issue
Block a user