Menu

## BillClient
in package

BillClient.php : 28

Handles interactions with the bill 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

create() : Bill
  Create a BitPay Bill.
deliver() : bool
  Deliver a BitPay Bill.
get() : Bill
  Retrieve a BitPay bill by bill id using the specified facade.
getBills() : array<string|int, Bill>
  Retrieve a collection of BitPay bills.
getInstance() : static
  Factory method for Bill Client.
update() : Bill
  Update a BitPay Bill.
__construct() : mixed
mapJsonToBillClass() : Bill

### Properties

#### $instance

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

#### $restCli

BillClient.php : 32
`private RESTcli $restCli`

#### $tokenCache

BillClient.php : 31
`private Tokens $tokenCache`

### Methods

#### create()

BillClient.php : 66

Create a BitPay Bill.

`public create(Bill $bill[, string $facade = Facade::MERCHANT ][, bool $signRequest = true ]) : Bill`

##### Parameters

$bill : Bill

  A Bill object with request parameters defined.

$facade : string = Facade::MERCHANT

  The facade used to create it.

$signRequest : bool = true

  Signed request.

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Bill

#### deliver()

BillClient.php : 171

Deliver a BitPay Bill.

`public deliver(string $billId, string $billToken[, bool $signRequest = true ]) : bool`

##### Parameters

$billId : string

  The id of the requested bill.

$billToken : string

  The token of the requested bill.

$signRequest : bool = true

  Allow unsigned request

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

bool

#### get()

BillClient.php : 89

Retrieve a BitPay bill by bill id using the specified facade.

`public get(mixed $billId[, mixed $facade = Facade::MERCHANT ][, mixed $signRequest = true ]) : Bill`

##### Parameters

$billId : mixed

  string The id of the bill to retrieve.

$facade : mixed = Facade::MERCHANT

  string The facade used to retrieve it.

$signRequest : mixed = true

  bool Signed request.

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Bill

#### getBills()

BillClient.php : 111

Retrieve a collection of BitPay bills.

`public getBills([string|null $status = null ]) : array<string|int, Bill>`

##### Parameters

$status : string|null = null

  The status to filter the bills.

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

array<string|int, Bill>

#### getInstance()

BillClient.php : 47

Factory method for Bill Client.

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

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

##### Return values

static

#### update()

BillClient.php : 142

Update a BitPay Bill.

`public update(Bill $bill, string $billId) : Bill`

##### Parameters

$bill : Bill

  A Bill object with the parameters to update defined.

$billId : string

  The Id of the Bill to update.

##### Tags

throws
  BitPayApiException
throws
  BitPayGenericException

##### Return values

Bill

#### __construct()

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

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

#### mapJsonToBillClass()

BillClient.php : 194
`private mapJsonToBillClass(string|null $responseJson) : Bill`

##### Parameters

$responseJson : string|null

##### Tags

throws
  JsonException
throws
  JsonMapper_Exception

##### Return values

Bill

## Search results