Menu

## BillClient
in package

BillClient.php : 30

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() : mixed

### Properties

#### $instance

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

#### $restCli

BillClient.php : 34
`private RESTcli $restCli`

#### $tokenCache

BillClient.php : 33
`private Tokens $tokenCache`

### Methods

#### create()

BillClient.php : 67

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
  BitPayException

##### Return values

Bill

#### deliver()

BillClient.php : 224

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
  BitPayException

##### Return values

bool

#### get()

BillClient.php : 103

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

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

##### Parameters

$billId :

  string The id of the bill to retrieve.

$facade : = Facade::MERCHANT

  string The facade used to retrieve it.

$signRequest : = true

  bool Signed request.

##### Tags

throws
  BitPayException

##### Return values

Bill

#### getBills()

BillClient.php : 138

Retrieve a collection of BitPay bills.

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

##### Parameters

$status : string = null

##### Tags

throws
  BitPayException

##### Return values

array<string|int, Bill>

#### getInstance()

BillClient.php : 49

Factory method for Bill Client.

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

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

##### Return values

static

#### update()

BillClient.php : 184

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
  BitPayException

##### Return values

Bill

#### __construct()

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

##### Parameters

$tokenCache : Tokens
$restCli : RESTcli

#### mapJsonToBillClass()

BillClient.php : 261
`private mapJsonToBillClass(string|null $responseJson) : mixed`

##### Parameters

$responseJson : string|null

##### Tags

throws
  JsonException
throws
  JsonMapper_Exception

## Search results