bank [id] => 103953585 [amount] => stdClass Object ( [amount] => 480.66 [currency] => USD ) [categoryType] => UNCATEGORIZE [categoryId] => 1 [category] => Uncategorized [categorySource] => SYSTEM [highLevelCategoryId] => 10000017 [createdDate] => 2022-08-04T21:50:17Z [lastUpdated] => 2022-08-04T21:50:17Z [description] => stdClass Object ( [original] => CHEROKEE NATION TAX TA TAHLEQUAH OK ) [isManual] => [sourceType] => AGGREGATED [date] => 2022-08-03 [transactionDate] => 2022-08-03 [postDate] => 2022-08-03 [status] => POSTED [accountId] => 12331794 [runningBalance] => stdClass Object ( [amount] => 480.66 [currency] => USD ) [checkNumber] => 998 ) */ class IncomeTransformer implements BankRevenueInterface { public function transform($transaction) { $data = []; if(!property_exists($transaction, 'transaction')) return $data; foreach($transaction->transaction as $transaction) { $data[] = $this->transformTransaction($transaction); } return $data; } public function transformTransaction($transaction) { return [ 'id' => $transaction->id, 'amount' => $transaction->amount->amount, 'currency' => $transaction->amount->currency, 'account_type' => $transaction->CONTAINER, 'category_id' => $transaction->categoryId, 'category_type' => $transaction->categoryType, 'date' => $transaction->date, 'account_id' => $transaction->accountId, 'description' => $transaction->description->original, 'invoice_id' => '', 'expense_id' => '', 'payment_id' => '', ]; } }