mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05:00 
			
		
		
		
	Merge pull request #9406 from paulwer/fix-nordigen-disabled-account-email
FIX: missing nordigen account disabled email on BankIntegrationController
This commit is contained in:
		
						commit
						9fea05a3bf
					
				@ -271,11 +271,14 @@ class BankIntegrationController extends BaseController
 | 
				
			|||||||
        $nordigen = new Nordigen();
 | 
					        $nordigen = new Nordigen();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BankIntegration::where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->whereNotNull('nordigen_account_id')->each(function (BankIntegration $bank_integration) use ($nordigen) {
 | 
					        BankIntegration::where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->whereNotNull('nordigen_account_id')->each(function (BankIntegration $bank_integration) use ($nordigen) {
 | 
				
			||||||
 | 
					            $is_account_active = $nordigen->isAccountActive($bank_integration->nordigen_account_id);
 | 
				
			||||||
            $account = $nordigen->getAccount($bank_integration->nordigen_account_id);
 | 
					            $account = $nordigen->getAccount($bank_integration->nordigen_account_id);
 | 
				
			||||||
            if (!$account) {
 | 
					 | 
				
			||||||
                $bank_integration->disabled_upstream = true;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!$is_account_active || !$account) {
 | 
				
			||||||
 | 
					                $bank_integration->disabled_upstream = true;
 | 
				
			||||||
                $bank_integration->save();
 | 
					                $bank_integration->save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                $nordigen->disabledAccountEmail($bank_integration);
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -304,10 +307,10 @@ class BankIntegrationController extends BaseController
 | 
				
			|||||||
        $account = $user->account;
 | 
					        $account = $user->account;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $bank_integration = BankIntegration::withTrashed()
 | 
					        $bank_integration = BankIntegration::withTrashed()
 | 
				
			||||||
                                        ->where('bank_account_id', $acc_id)
 | 
					            ->where('bank_account_id', $acc_id)
 | 
				
			||||||
                                        ->orWhere('nordigen_account_id', $acc_id)
 | 
					            ->orWhere('nordigen_account_id', $acc_id)
 | 
				
			||||||
                                        ->company()
 | 
					            ->company()
 | 
				
			||||||
                                        ->firstOrFail();
 | 
					            ->firstOrFail();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($bank_integration->integration_type == BankIntegration::INTEGRATION_TYPE_YODLEE) {
 | 
					        if ($bank_integration->integration_type == BankIntegration::INTEGRATION_TYPE_YODLEE) {
 | 
				
			||||||
            $this->removeAccountYodlee($account, $bank_integration);
 | 
					            $this->removeAccountYodlee($account, $bank_integration);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user