Fixes for bank transactions:

This commit is contained in:
David Bomba 2022-09-14 17:35:13 +10:00
parent f1efdb663e
commit 0cae4d0671

View File

@ -58,8 +58,13 @@ class ProcessBankTransactions implements ShouldQueue
$this->from_date = $this->from_date ?: '2021-01-01'; $this->from_date = $this->from_date ?: '2021-01-01';
$x = 0;
do{ do{
$x++;
nlog("Loop number {$x}");
$this->processTransactions(); $this->processTransactions();
} }
@ -70,6 +75,7 @@ class ProcessBankTransactions implements ShouldQueue
private function processTransactions() private function processTransactions()
{ {
$yodlee = new Yodlee($this->bank_integration_account_id); $yodlee = new Yodlee($this->bank_integration_account_id);
$data = [ $data = [
@ -87,6 +93,8 @@ nlog($data);
//Get int count //Get int count
$count = $transaction_count->transaction->TOTAL->count; $count = $transaction_count->transaction->TOTAL->count;
nlog("Number of transactions = {$count}");
//get transactions array //get transactions array
$transactions = $yodlee->getTransactions($data); $transactions = $yodlee->getTransactions($data);
@ -142,8 +150,10 @@ nlog("no transactions returning");
$this->bank_integration->save(); $this->bank_integration->save();
if($count < 500) if($count < 500){
$this->stop_loop = false; $this->stop_loop = false;
nlog("stopping while loop");
}
} }