2022-07-28 07:07:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Tests\Feature\Bank;
|
|
|
|
|
|
|
|
use App\Helpers\Bank\Yodlee\Yodlee;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class YodleeApiTest extends TestCase
|
|
|
|
{
|
|
|
|
use DatabaseTransactions;
|
|
|
|
|
|
|
|
protected function setUp(): void
|
|
|
|
{
|
|
|
|
parent::setUp();
|
2022-07-28 09:33:47 +02:00
|
|
|
|
2022-07-30 03:43:24 +02:00
|
|
|
// $this->markTestSkipped('Skip test no company gateways installed');
|
2022-07-28 09:33:47 +02:00
|
|
|
|
2022-07-28 07:07:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testAccessTokenGeneration()
|
|
|
|
{
|
|
|
|
|
|
|
|
$yodlee = new Yodlee(true);
|
|
|
|
|
2022-07-28 09:33:47 +02:00
|
|
|
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
2022-07-28 07:07:35 +02:00
|
|
|
|
|
|
|
nlog($access_token);
|
|
|
|
|
|
|
|
$this->assertNotNull($access_token);
|
|
|
|
}
|
|
|
|
|
2022-07-30 04:10:42 +02:00
|
|
|
public function testGetCategories()
|
2022-07-28 08:29:42 +02:00
|
|
|
{
|
2022-07-28 09:33:47 +02:00
|
|
|
|
2022-07-30 04:10:42 +02:00
|
|
|
|
2022-07-28 08:29:42 +02:00
|
|
|
$yodlee = new Yodlee(true);
|
2022-07-30 04:10:42 +02:00
|
|
|
|
|
|
|
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
|
|
|
|
|
|
|
$transactions = $yodlee->getTransactionCategories($access_token);
|
|
|
|
|
|
|
|
// nlog($transactions);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetAccounts()
|
|
|
|
{
|
2022-07-28 08:29:42 +02:00
|
|
|
|
2022-07-30 04:10:42 +02:00
|
|
|
$yodlee = new Yodlee(true);
|
2022-07-28 09:33:47 +02:00
|
|
|
|
|
|
|
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
2022-07-28 08:29:42 +02:00
|
|
|
|
2022-07-28 09:33:47 +02:00
|
|
|
$accounts = $yodlee->getAccounts($access_token);
|
|
|
|
|
2022-07-30 04:10:42 +02:00
|
|
|
// nlog($accounts);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetTransactions()
|
|
|
|
{
|
|
|
|
|
|
|
|
$yodlee = new Yodlee(true);
|
|
|
|
|
|
|
|
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
|
|
|
|
|
|
|
$transactions = $yodlee->getTransactions($access_token);
|
|
|
|
|
|
|
|
nlog($transactions);
|
|
|
|
|
2022-07-28 08:29:42 +02:00
|
|
|
}
|
|
|
|
|
2022-07-28 09:33:47 +02:00
|
|
|
|
2022-07-28 07:07:35 +02:00
|
|
|
}
|