From 0cae4d06715e4ee53470fdc3cc3ff39ca32284c2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 14 Sep 2022 17:35:13 +1000 Subject: [PATCH] Fixes for bank transactions: --- app/Jobs/Bank/ProcessBankTransactions.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Bank/ProcessBankTransactions.php b/app/Jobs/Bank/ProcessBankTransactions.php index 5f75a2959b89..68f535fb31e6 100644 --- a/app/Jobs/Bank/ProcessBankTransactions.php +++ b/app/Jobs/Bank/ProcessBankTransactions.php @@ -58,8 +58,13 @@ class ProcessBankTransactions implements ShouldQueue $this->from_date = $this->from_date ?: '2021-01-01'; + $x = 0; + do{ + $x++; + nlog("Loop number {$x}"); + $this->processTransactions(); } @@ -70,6 +75,7 @@ class ProcessBankTransactions implements ShouldQueue private function processTransactions() { + $yodlee = new Yodlee($this->bank_integration_account_id); $data = [ @@ -87,6 +93,8 @@ nlog($data); //Get int count $count = $transaction_count->transaction->TOTAL->count; +nlog("Number of transactions = {$count}"); + //get transactions array $transactions = $yodlee->getTransactions($data); @@ -142,8 +150,10 @@ nlog("no transactions returning"); $this->bank_integration->save(); - if($count < 500) + if($count < 500){ $this->stop_loop = false; + nlog("stopping while loop"); + } }