Balance   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A balance() 0 6 1
1
<?php
2
3
namespace JulianBustamante\Plaid\Resources;
4
5
use GuzzleHttp\ClientInterface;
6
7
/**
8
 * The balance endpoint returns the real-time balance of a user's accounts. It
9
 * may be used for existing users that were added via any of Plaid's products.
10
 * The Current Balance is the total amount of funds in the account.
11
 * The Available Balance is the Current Balance less any outstanding hold or
12
 * debits that have not yet posted to the account. Note that not all
13
 * institutions calculate the Available Balance. In the case that Available
14
 * Balance is unavailable from the institution, Plaid will either return an
15
 * Available Balance value of null or only return a Current Balance.
16
 *
17
 * https://plaid.com/docs/api/#balance
18
 */
19
class Balance extends ResourceAbstract
20
{
21
    public function balance($access_token, array $account_ids = [])
22
    {
23
        return $this->handleRequest(function (ClientInterface $client) use ($access_token, $account_ids) {
24
            $data = $this->getBaseDataWithAccounts($access_token, $account_ids);
25
26
            return $client->post('/accounts/balance/get', $data);
27
        });
28
    }
29
}
30