mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
cleanup
This commit is contained in:
parent
5b4dfe38fe
commit
54a8d13e28
@ -55,7 +55,6 @@ class ConnectNordigenBankIntegrationRequest extends Request
|
|||||||
$input["redirect"] = isset($context['is_react']) && $context['is_react'] ? config('ninja.react_url') : config('ninja.app_url');
|
$input["redirect"] = isset($context['is_react']) && $context['is_react'] ? config('ninja.react_url') : config('ninja.app_url');
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function getTokenContent()
|
public function getTokenContent()
|
||||||
@ -74,15 +73,12 @@ class ConnectNordigenBankIntegrationRequest extends Request
|
|||||||
MultiDB::findAndSetDbByCompanyKey($this->getTokenContent()['company_key']);
|
MultiDB::findAndSetDbByCompanyKey($this->getTokenContent()['company_key']);
|
||||||
|
|
||||||
return User::findOrFail($this->getTokenContent()['user_id']);
|
return User::findOrFail($this->getTokenContent()['user_id']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany()
|
public function getCompany()
|
||||||
{
|
{
|
||||||
|
|
||||||
MultiDB::findAndSetDbByCompanyKey($this->getTokenContent()['company_key']);
|
MultiDB::findAndSetDbByCompanyKey($this->getTokenContent()['company_key']);
|
||||||
|
|
||||||
return Company::where('company_key', $this->getTokenContent()['company_key'])->firstOrFail();
|
return Company::where('company_key', $this->getTokenContent()['company_key'])->firstOrFail();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,6 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->bank_integration->integration_type != BankIntegration::INTEGRATION_TYPE_NORDIGEN)
|
if ($this->bank_integration->integration_type != BankIntegration::INTEGRATION_TYPE_NORDIGEN)
|
||||||
throw new \Exception("Invalid BankIntegration Type");
|
throw new \Exception("Invalid BankIntegration Type");
|
||||||
|
|
||||||
@ -111,7 +110,6 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
|||||||
|
|
||||||
// Perform Matching
|
// Perform Matching
|
||||||
BankMatchingService::dispatch($this->company->id, $this->company->db);
|
BankMatchingService::dispatch($this->company->id, $this->company->db);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateAccount()
|
private function updateAccount()
|
||||||
@ -132,12 +130,10 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
|||||||
$this->bank_integration->balance = $this->nordigen_account['current_balance'];
|
$this->bank_integration->balance = $this->nordigen_account['current_balance'];
|
||||||
|
|
||||||
$this->bank_integration->save();
|
$this->bank_integration->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function processTransactions()
|
private function processTransactions()
|
||||||
{
|
{
|
||||||
|
|
||||||
//Get transaction count object
|
//Get transaction count object
|
||||||
$transactions = $this->nordigen->getTransactions($this->bank_integration->nordigen_account_id, $this->from_date);
|
$transactions = $this->nordigen->getTransactions($this->bank_integration->nordigen_account_id, $this->from_date);
|
||||||
|
|
||||||
@ -183,6 +179,5 @@ class ProcessBankTransactionsNordigen implements ShouldQueue
|
|||||||
|
|
||||||
$this->bank_integration->from_date = now()->subDays(5);
|
$this->bank_integration->from_date = now()->subDays(5);
|
||||||
$this->bank_integration->save();
|
$this->bank_integration->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,6 @@ class ProcessBankTransactionsYodlee implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->bank_integration->integration_type != BankIntegration::INTEGRATION_TYPE_YODLEE)
|
if ($this->bank_integration->integration_type != BankIntegration::INTEGRATION_TYPE_YODLEE)
|
||||||
throw new \Exception("Invalid BankIntegration Type");
|
throw new \Exception("Invalid BankIntegration Type");
|
||||||
|
|
||||||
@ -96,7 +95,6 @@ class ProcessBankTransactionsYodlee implements ShouldQueue
|
|||||||
|
|
||||||
private function processTransactions()
|
private function processTransactions()
|
||||||
{
|
{
|
||||||
|
|
||||||
$yodlee = new Yodlee($this->account->bank_integration_account_id);
|
$yodlee = new Yodlee($this->account->bank_integration_account_id);
|
||||||
|
|
||||||
if (!$yodlee->getAccount($this->bank_integration->bank_account_id)) {
|
if (!$yodlee->getAccount($this->bank_integration->bank_account_id)) {
|
||||||
|
@ -45,7 +45,7 @@ class BankTransactionSync implements ShouldQueue
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
//multiDB environment, need to
|
// multiDB environment, need to @turbo124 do we need any changes here for selfhosted non-multidb envs
|
||||||
foreach (MultiDB::$dbs as $db) {
|
foreach (MultiDB::$dbs as $db) {
|
||||||
MultiDB::setDB($db);
|
MultiDB::setDB($db);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user