RefundClient
in package
Handles interactions with the refund endpoints.
Tags
Table of Contents
Properties
- $instance : self|null
- $restCli : RESTcli
- $tokenCache : Tokens
Methods
- cancel() : Refund
- Cancel a previously submitted refund request on a BitPay invoice.
- cancelByGuid() : Refund
- Cancel a previously submitted refund request on a BitPay invoice.
- create() : Refund
- Create a refund for a BitPay invoice.
- get() : Refund
- Retrieve a previously made refund request on a BitPay invoice.
- getByGuid() : Refund
- Retrieve a previously made refund request on a BitPay invoice by guid.
- getInstance() : static
- Factory method for Bill Client.
- getRefunds() : array<string|int, Refund>
- Retrieve all refund requests on a BitPay invoice.
- sendNotification() : bool
- Send a refund notification.
- update() : Refund
- Update the status of a BitPay invoice.
- updateByGuid() : Refund
- Update the status of a BitPay invoice.
- __construct() : mixed
Properties
$instance
private
static self|null
$instance
= null
$restCli
private
RESTcli
$restCli
$tokenCache
private
Tokens
$tokenCache
Methods
cancel()
Cancel a previously submitted refund request on a BitPay invoice.
public
cancel(string $refundId) : Refund
Parameters
- $refundId : string
-
The refund Id for the refund to be canceled.
Tags
Return values
Refund —$refund Cancelled refund Object.
cancelByGuid()
Cancel a previously submitted refund request on a BitPay invoice.
public
cancelByGuid(string $guid) : Refund
Parameters
- $guid : string
-
The refund Guid for the refund to be canceled.
Tags
Return values
Refund —$refund Cancelled refund Object.
create()
Create a refund for a BitPay invoice.
public
create(string $invoiceId, float $amount, string $currency[, bool $preview = false ][, bool $immediate = false ][, bool $buyerPaysRefundFee = false ][, string|null $guid = null ]) : Refund
Parameters
- $invoiceId : string
-
The BitPay invoice Id having the associated refund to be created.
- $amount : float
-
Amount to be refunded in the currency indicated.
- $currency : string
-
Reference currency used for the refund, usually the same as the currency used to create the invoice.
- $preview : bool = false
-
Whether to create the refund request as a preview (which will not be acted on until status is updated)
- $immediate : bool = false
-
Whether funds should be removed from merchant ledger immediately on submission or at time of processing
- $buyerPaysRefundFee : bool = false
-
Whether the buyer should pay the refund fee (default is merchant)
- $guid : string|null = null
-
Variable provided by the merchant and designed to be used by the merchant to correlate the refund with a refund ID in their system
Tags
Return values
Refund —$refund An updated Refund Object
get()
Retrieve a previously made refund request on a BitPay invoice.
public
get(string $refundId) : Refund
Parameters
- $refundId : string
-
The BitPay refund ID.
Tags
Return values
Refund —$refund BitPay Refund object with the associated Refund object.
getByGuid()
Retrieve a previously made refund request on a BitPay invoice by guid.
public
getByGuid(string $guid) : Refund
Parameters
- $guid : string
-
The BitPay refund Guid.
Tags
Return values
Refund —$refund BitPay Refund object with the associated Refund object.
getInstance()
Factory method for Bill Client.
public
static getInstance(Tokens $tokenCache, RESTcli $restCli) : static
Parameters
Return values
staticgetRefunds()
Retrieve all refund requests on a BitPay invoice.
public
getRefunds(string $invoiceId) : array<string|int, Refund>
Parameters
- $invoiceId : string
-
The BitPay invoice object having the associated refunds.
Tags
Return values
array<string|int, Refund>sendNotification()
Send a refund notification.
public
sendNotification(string $refundId) : bool
Parameters
- $refundId : string
-
A BitPay refund ID.
Tags
Return values
bool —$result An updated Refund Object
update()
Update the status of a BitPay invoice.
public
update(string $refundId, string $status) : Refund
Parameters
- $refundId : string
-
BitPay refund ID.
- $status : string
-
The new status for the refund to be updated.
Tags
Return values
Refund —$refund Refund A BitPay generated Refund object.
updateByGuid()
Update the status of a BitPay invoice.
public
updateByGuid(string $guid, string $status) : Refund
Parameters
- $guid : string
-
BitPay refund Guid.
- $status : string
-
The new status for the refund to be updated.
Tags
Return values
Refund —$refund Refund A BitPay generated Refund object.
__construct()
private
__construct(Tokens $tokenCache, RESTcli $restCli) : mixed