PHP Class Bitpay\Client\Client

Inheritance: implements Bitpay\Client\ClientInterface
Show file Open project: bitpay/php-client Class Usage Examples

Protected Properties

Property Type Description
$adapter Bitpay\Client\Adapter\AdapterInterface
$network Bitpay\Network\NetworkInterface
$privateKey Bitpay\PrivateKey
$publicKey Bitpay\PublicKey
$request Bitpay\Client\RequestInterface
$response Bitpay\Client\ResponseInterface
$token Bitpay\TokenInterface

Public Methods

Method Description
createInvoice ( Bitpay\InvoiceInterface $invoice )
createPayout ( Bitpay\PayoutInterface $payout )
createToken ( array $payload = [] )
deletePayout ( Bitpay\PayoutInterface $payout )
getCurrencies ( )
getInvoice ( $invoiceId )
getPayout ( $payoutId )
getPayouts ( $status = null )
getRequest ( ) : Bitpay\Client\RequestInterface Returns the request object that was sent to BitPay
getResponse ( ) : Bitpay\Client\ResponseInterface Returns the Response object that BitPay returned from the request that was sent
getTokens ( )
sendRequest ( Bitpay\Client\RequestInterface $request ) : Bitpay\Client\ResponseInterface
setAdapter ( Bitpay\Client\Adapter\AdapterInterface $adapter )
setNetwork ( Bitpay\Network\NetworkInterface $network ) The network is either livenet or testnet and tells the client where to send the requests.
setPrivateKey ( PrivateKey $key ) Set the Private Key to use, this is used when signing request strings
setPublicKey ( PublicKey $key ) Set the Public Key to use to help identify who you are to BitPay. Please note that you must first pair your keys and get a token in return to use.
setToken ( Bitpay\TokenInterface $token ) : Bitpay\Client\ClientInterface

Protected Methods

Method Description
addIdentityHeader ( Bitpay\Client\RequestInterface $request )
addSignatureHeader ( Bitpay\Client\RequestInterface $request )
checkPriceAndCurrency ( $price, $currency )
createNewRequest ( ) : Bitpay\Client\RequestInterface
prepareRequestHeaders ( Bitpay\Client\RequestInterface $request ) Prepares the request object by adding additional headers

Method Details

addIdentityHeader() protected method

protected addIdentityHeader ( Bitpay\Client\RequestInterface $request )
$request Bitpay\Client\RequestInterface

addSignatureHeader() protected method

protected addSignatureHeader ( Bitpay\Client\RequestInterface $request )
$request Bitpay\Client\RequestInterface

checkPriceAndCurrency() protected method

protected checkPriceAndCurrency ( $price, $currency )

createInvoice() public method

public createInvoice ( Bitpay\InvoiceInterface $invoice )
$invoice Bitpay\InvoiceInterface

createNewRequest() protected method

protected createNewRequest ( ) : Bitpay\Client\RequestInterface
return Bitpay\Client\RequestInterface

createPayout() public method

public createPayout ( Bitpay\PayoutInterface $payout )
$payout Bitpay\PayoutInterface

createToken() public method

public createToken ( array $payload = [] )
$payload array

deletePayout() public method

public deletePayout ( Bitpay\PayoutInterface $payout )
$payout Bitpay\PayoutInterface

getCurrencies() public method

public getCurrencies ( )

getInvoice() public method

public getInvoice ( $invoiceId )

getPayout() public method

public getPayout ( $payoutId )

getPayouts() public method

public getPayouts ( $status = null )

getRequest() public method

Returns the request object that was sent to BitPay
public getRequest ( ) : Bitpay\Client\RequestInterface
return Bitpay\Client\RequestInterface

getResponse() public method

Returns the Response object that BitPay returned from the request that was sent
public getResponse ( ) : Bitpay\Client\ResponseInterface
return Bitpay\Client\ResponseInterface

getTokens() public method

public getTokens ( )

prepareRequestHeaders() protected method

Prepares the request object by adding additional headers
protected prepareRequestHeaders ( Bitpay\Client\RequestInterface $request )
$request Bitpay\Client\RequestInterface

sendRequest() public method

public sendRequest ( Bitpay\Client\RequestInterface $request ) : Bitpay\Client\ResponseInterface
$request Bitpay\Client\RequestInterface
return Bitpay\Client\ResponseInterface

setAdapter() public method

public setAdapter ( Bitpay\Client\Adapter\AdapterInterface $adapter )
$adapter Bitpay\Client\Adapter\AdapterInterface

setNetwork() public method

The network is either livenet or testnet and tells the client where to send the requests.
public setNetwork ( Bitpay\Network\NetworkInterface $network )
$network Bitpay\Network\NetworkInterface

setPrivateKey() public method

Set the Private Key to use, this is used when signing request strings
public setPrivateKey ( PrivateKey $key )
$key Bitpay\PrivateKey

setPublicKey() public method

Set the Public Key to use to help identify who you are to BitPay. Please note that you must first pair your keys and get a token in return to use.
public setPublicKey ( PublicKey $key )
$key Bitpay\PublicKey

setToken() public method

public setToken ( Bitpay\TokenInterface $token ) : Bitpay\Client\ClientInterface
$token Bitpay\TokenInterface
return Bitpay\Client\ClientInterface

Property Details

$adapter protected property

protected AdapterInterface,Bitpay\Client\Adapter $adapter
return Bitpay\Client\Adapter\AdapterInterface

$network protected property

protected NetworkInterface,Bitpay\Network $network
return Bitpay\Network\NetworkInterface

$privateKey protected property

protected PrivateKey,Bitpay $privateKey
return Bitpay\PrivateKey

$publicKey protected property

protected PublicKey,Bitpay $publicKey
return Bitpay\PublicKey

$request protected property

protected RequestInterface,Bitpay\Client $request
return Bitpay\Client\RequestInterface

$response protected property

protected ResponseInterface,Bitpay\Client $response
return Bitpay\Client\ResponseInterface

$token protected property

protected TokenInterface,Bitpay $token
return Bitpay\TokenInterface