mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Transactions
This commit is contained in:
parent
3e84dbc357
commit
a2b89d1476
@ -78,6 +78,31 @@ class Yodlee
|
||||
|
||||
}
|
||||
|
||||
public function getTransactions($token)
|
||||
{
|
||||
|
||||
//$response = $this->bankRequest('/transactions', 'get', ['categoryId' => '2xx', 'fromDate' => '20xx22-07-29'], );
|
||||
|
||||
$response = Http::withHeaders($this->getHeaders(["Authorization" => "Bearer {$token}"]))->get($this->api_endpoint. "/transactions", ['categoryId' => '2']);
|
||||
|
||||
|
||||
if($response->successful())
|
||||
return $response->object();
|
||||
|
||||
if($response->failed())
|
||||
return $response->body();
|
||||
|
||||
}
|
||||
|
||||
public function getTransactionCategories($token)
|
||||
{
|
||||
|
||||
$response = $this->bankRequest('/transactions/categories', 'get', [], ["Authorization" => "Bearer {$token}"]);
|
||||
|
||||
return $response;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function bankRequest(string $uri, string $verb, array $data = [], array $headers = [])
|
||||
{
|
||||
|
@ -40,20 +40,43 @@ class YodleeApiTest extends TestCase
|
||||
$this->assertNotNull($access_token);
|
||||
}
|
||||
|
||||
public function testGetCategories()
|
||||
{
|
||||
|
||||
|
||||
$yodlee = new Yodlee(true);
|
||||
|
||||
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
||||
|
||||
$transactions = $yodlee->getTransactionCategories($access_token);
|
||||
|
||||
// nlog($transactions);
|
||||
|
||||
}
|
||||
|
||||
public function testGetAccounts()
|
||||
{
|
||||
|
||||
$yodlee = new Yodlee(true);
|
||||
|
||||
// $data = [
|
||||
// 'providerAccountId' => 11308693,
|
||||
// ];
|
||||
|
||||
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
||||
|
||||
$accounts = $yodlee->getAccounts($access_token);
|
||||
|
||||
nlog($accounts);
|
||||
// nlog($accounts);
|
||||
}
|
||||
|
||||
public function testGetTransactions()
|
||||
{
|
||||
|
||||
$yodlee = new Yodlee(true);
|
||||
|
||||
$access_token = $yodlee->getAccessToken('sbMem62e1e69547bfb1');
|
||||
|
||||
$transactions = $yodlee->getTransactions($access_token);
|
||||
|
||||
nlog($transactions);
|
||||
|
||||
}
|
||||
|
||||
// public function testCreateUser()
|
||||
|
Loading…
Reference in New Issue
Block a user