diff --git a/app/Helpers/Bank/Yodlee/Yodlee.php b/app/Helpers/Bank/Yodlee/Yodlee.php index c4a4b5e3eafc..a057d6033f16 100644 --- a/app/Helpers/Bank/Yodlee/Yodlee.php +++ b/app/Helpers/Bank/Yodlee/Yodlee.php @@ -81,8 +81,8 @@ class Yodlee public function getTransactions($token) { - // $response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->get($this->api_endpoint. "/transactions", ['categoryId' => '2']); - $response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->get($this->api_endpoint. "/transactions"); + $response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->get($this->api_endpoint. "/transactions", ['categoryId' => '2']); + // $response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->get($this->api_endpoint. "/transactions"); if($response->successful()) diff --git a/database/migrations/2022_08_05_023357_bank_integration.php b/database/migrations/2022_08_05_023357_bank_integration.php new file mode 100644 index 000000000000..65ae46ddd259 --- /dev/null +++ b/database/migrations/2022_08_05_023357_bank_integration.php @@ -0,0 +1,53 @@ +id(); + $table->unsignedInteger('account_id'); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('user_id'); + + $table->string('account_type')->nullable(); + // $table->bigInteger('bank_account_id'); //providerAccountId + // $table->bigInteger('bank_id'); //providerId + $table->text('bank_name'); //providerName + $table->text('account_name')->nullable(); //accountName + $table->text('account_number')->nullable(); //accountNumber + $table->text('account_status')->nullable(); //accountStatus + $table->text('account_type')->nullable(); //CONTAINER + $table->decimal('balance', 20, 6)->default(0); //currentBalance.amount + $table->text('currency')->nullable(); //currentBalance.currency + + $table-> + $table->timestamps(6); + $table->softDeletes('deleted_at', 6); + + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade')->onUpdate('cascade'); + $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; diff --git a/tests/Feature/Bank/YodleeApiTest.php b/tests/Feature/Bank/YodleeApiTest.php index 5b0e47f1210e..b1aa03cb14cd 100644 --- a/tests/Feature/Bank/YodleeApiTest.php +++ b/tests/Feature/Bank/YodleeApiTest.php @@ -277,6 +277,57 @@ class YodleeApiTest extends TestCase ) + ) + [1] => stdClass Object + ( + [CONTAINER] => bank + [providerAccountId] => 11308693 + [accountName] => Joint Savings - 7159 + [accountStatus] => ACTIVE + [accountNumber] => xxxx7159 + [aggregationSource] => USER + [isAsset] => 1 + [balance] => stdClass Object + ( + [currency] => USD + [amount] => 186277.45 + ) + + [id] => 12331860 + [includeInNetWorth] => 1 + [providerId] => 18769 + [providerName] => Dag Site Captcha + [isManual] => + [availableBalance] => stdClass Object + ( + [currency] => USD + [amount] => 186277.45 + ) + + [currentBalance] => stdClass Object + ( + [currency] => USD + [amount] => 186277.45 + ) + + [accountType] => SAVINGS + [displayedName] => LYDIA + [createdDate] => 2022-07-28T06:55:33Z + [classification] => PERSONAL + [lastUpdated] => 2022-07-28T06:56:09Z + [dataset] => Array + ( + [0] => stdClass Object + ( + [name] => BASIC_AGG_DATA + [additionalStatus] => AVAILABLE_DATA_RETRIEVED + [updateEligibility] => ALLOW_UPDATE + [lastUpdated] => 2022-07-28T06:55:50Z + [lastUpdateAttempt] => 2022-07-28T06:55:50Z + ) + + ) + ) */ public function testGetAccounts()