Menu

## LedgerClient
in package

LedgerClient.php : 28

Handles interactions with the ledger endpoints.

##### Tags

author

  BitPay Integrations integrations@bitpay.com

license

  http://www.opensource.org/licenses/mit-license.php MIT

### Table of Contents

#### Properties

$instance : self|null
$restCli : RESTcli
$tokenCache : Tokens

#### Methods

get() : array<string|int, LedgerEntry>
  Retrieve a list of ledgers by date range using the merchant facade.
getInstance() : static
  Factory method for Ledger Client.
getLedgers() : array<string|int, Ledger>
  Retrieve a list of ledgers using the merchant facade.
__construct() : mixed

### Properties

#### $instance

LedgerClient.php : 30
`private static self|null $instance = null`

#### $restCli

LedgerClient.php : 32
`private RESTcli $restCli`

#### $tokenCache

LedgerClient.php : 31
`private Tokens $tokenCache`

### Methods

#### get()

LedgerClient.php : 65

Retrieve a list of ledgers by date range using the merchant facade.

`public get(string $currency, string $startDate, string $endDate) : array<string|int, LedgerEntry>`

##### Parameters

$currency : string

  The three digit currency string for the ledger to retrieve.

$startDate : string

  The first date for the query filter.

$endDate : string

  The last date for the query filter.

##### Tags

throws
  LedgerQueryException

##### Return values

array<string|int, LedgerEntry> —

A Ledger object populated with the BitPay ledger entries list.

#### getInstance()

LedgerClient.php : 47

Factory method for Ledger Client.

`public static getInstance(Tokens $tokenCache, RESTcli $restCli) : static`

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

##### Return values

static

#### getLedgers()

LedgerClient.php : 115

Retrieve a list of ledgers using the merchant facade.

`public getLedgers() : array<string|int, Ledger>`

##### Tags

throws
  BitPayException

##### Return values

array<string|int, Ledger> —

A list of Ledger objects populated with the currency and current balance of each one.

#### __construct()

LedgerClient.php : 34
`private __construct(Tokens $tokenCache, RESTcli $restCli) : mixed`

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

## Search results