BillClient
in package
Handles interactions with the bill endpoints.
Tags
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
private
static self|null
$instance
= null
$restCli
private
RESTcli
$restCli
$tokenCache
private
Tokens
$tokenCache
Methods
create()
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
Return values
Billdeliver()
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
Return values
boolget()
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
Return values
BillgetBills()
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
Return values
array<string|int, Bill>getInstance()
Factory method for Bill Client.
public
static getInstance(Tokens $tokenCache, RESTcli $restCli) : static
Parameters
Return values
staticupdate()
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
Return values
Bill__construct()
private
__construct(Tokens $tokenCache, RESTcli $restCli) : mixed
Parameters
mapJsonToBillClass()
private
mapJsonToBillClass(string|null $responseJson) : Bill
Parameters
- $responseJson : string|null