diff --git a/app/Helpers/Bank/Yodlee/Yodlee.php b/app/Helpers/Bank/Yodlee/Yodlee.php index c6f58df515ee..cbab6f997410 100644 --- a/app/Helpers/Bank/Yodlee/Yodlee.php +++ b/app/Helpers/Bank/Yodlee/Yodlee.php @@ -65,7 +65,47 @@ class Yodlee 'loginName' => 'test123', ]; - return $this->bankRequest('/user/register', 'post', $user, ['Authorization' => $token]); +/* +{ + "user": { + "preferences": { + "dateFormat": "string", + "timeZone": "string", + "currency": "USD", + "locale": "en_US" + }, + "address": { + "zip": "string", + "country": "string", + "address3": "string", + "address2": "string", + "city": "string", + "address1": "string", + "state": "string" + }, + "loginName": "string", + "name": { + "middle": "string", + "last": "string", + "fullName": "string", + "first": "string" + }, + "email": "string", + "segmentName": "string" + } +} +*/ + + $response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->post($this->api_endpoint. "/user/register", $user); + + if($response->successful()) + return $response->object(); + + if($response->failed()) + return $response->body(); + + + return $response; } diff --git a/database/migrations/2022_08_05_023357_bank_integration.php b/database/migrations/2022_08_05_023357_bank_integration.php index 650ae4354b4d..e3f0c326930e 100644 --- a/database/migrations/2022_08_05_023357_bank_integration.php +++ b/database/migrations/2022_08_05_023357_bank_integration.php @@ -36,6 +36,10 @@ return new class extends Migration $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade')->onUpdate('cascade'); $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); }); + + Schema::table('accounts', function (Blueprint $table) { + $table->text('bank_integration_account_id')->nullable(); + }); } /** diff --git a/resources/views/bank/yodlee/auth.blade.php b/resources/views/bank/yodlee/auth.blade.php index 66002fffdcec..ffc005d53d95 100644 --- a/resources/views/bank/yodlee/auth.blade.php +++ b/resources/views/bank/yodlee/auth.blade.php @@ -27,6 +27,7 @@ 'click', function() { window.fastlink.open({ + flow: 'edit',//flow changes depending on what we are doing sometimes it could be add/edit etc etc fastLinkURL: '{{ $fasttrack_url }}', accessToken: 'Bearer {{ $access_token }}', params: { diff --git a/tests/Feature/Bank/YodleeApiTest.php b/tests/Feature/Bank/YodleeApiTest.php index 61fea12fb02b..9267bead54d1 100644 --- a/tests/Feature/Bank/YodleeApiTest.php +++ b/tests/Feature/Bank/YodleeApiTest.php @@ -28,6 +28,17 @@ class YodleeApiTest extends TestCase } + public function testCreateUser() + { + + $yodlee = new Yodlee(true); + + $user = $yodlee->createUser(); + + nlog($user); + + } + public function testAccessTokenGeneration() {