Menu

## Refund
in package

Refund.php : 19

Class Refund

##### Tags

author

  BitPay Integrations integrations@bitpay.com

license

  http://www.opensource.org/licenses/mit-license.php MIT

see
  https://bitpay.readme.io/reference/invoices

  REST API Invoices

### Table of Contents

#### Properties

$amount : float
$buyerPaysRefundFee : bool|null
$currency : string
$guid : string|null
$id : string|null
$immediate : bool|null
$invoice : string|null
$invoiceId : string|null
$lastRefundNotification : string|null
$notificationURL : string|null
$preview : bool|null
$reference : string|null
$refundAddress : string|null
$refundFee : float|null
$requestDate : string|null
$status : string|null
$supportRequest : string|null
$token : string
$transactionAmount : float|null
$transactionCurrency : string|null
$transactionRefundFee : float|null
$txid : string|null
$type : string|null

#### Methods

__construct() : mixed
  Constructor, create Refund object
getAmount() : float
  Gets amount to be refunded in the invoice currency
getBuyerPaysRefundFee() : bool|null
  Gets whether the buyer should pay the refund fee rather than the merchant
getCurrency() : string
  Gets reference currency used for the refund, the same as the currency used to create the invoice
getGuid() : string|null
  Gets a passthru variable provided by the merchant and designed to be used by the merchant to correlate the invoice with an order ID in their system
getId() : string|null
  Gets the ID of the refund
getImmediate() : bool|null
  Gets whether the funds should be removed from merchant ledger immediately on submission or at the time of processing
getInvoice() : string|null
  Gets the ID of the invoice being refunded
getInvoiceId() : string|null
  Gets the ID of the invoice to refund
getLastRefundNotification() : string|null
  Gets the last time notification of buyer was attempted
getNotificationURL() : string|null
  Gets URL to which BitPay sends webhook notifications. HTTPS is mandatory.
getPreview() : bool|null
  Whether to create the refund request as a preview
getReference() : string|null
  Present only if specified in the request to create the refund. This is your reference label for this refund.
getRefundAddress() : string|null
  Gets the wallet address that the refund will return the funds to, added by the customer.
getRefundFee() : float|null
  Gets the amount of refund fee expressed in terms of pricing currency
getRequestDate() : string|null
  Gets the date the refund was requested
getStatus() : string|null
  Gets the refund lifecycle status of the request
getSupportRequest() : string|null
  Gets the ID of the associated support request for the refund.
getToken() : string
  Gets API token
getTransactionAmount() : float|null
  Gets amount to be refunded in terms of the transaction currency.
getTransactionCurrency() : string|null
  Gets the currency used for the invoice transaction.
getTransactionRefundFee() : float|null
  Gets the refund fee expressed in terms of transaction currency.
getTxid() : string|null
  Gets the transaction ID of the refund once executed.
getType() : string|null
  <p>Gets the type of refund.</p> <ul> <li>full (current rate): A full refund of the amount paid at the current rate.</li> <li>full (fixed rate): A full refund of the amount paid at the fixed rate.
setAmount() : void
  Sets amount to be refunded
setBuyerPaysRefundFee() : void
  Sets whether the buyer should pay the refund fee rather
setCurrency() : void
  Sets currency used for the refund
setGuid() : void
  Sets guid
setId() : void
  Sets id of the refund
setImmediate() : void
  Sets immediate value
setInvoice() : void
  Sets the id of the invoice being refunded
setInvoiceId() : void
  Sets invoice id
setLastRefundNotification() : void
  Sets last refund notification
setNotificationURL() : void
  Sets URL to which BitPay sends webhook notifications. HTTPS is mandatory.
setPreview() : void
  Sets preview
setReference() : void
  Sets reference label for refund
setRefundAddress() : void
  Sets the wallet address that the refund will return the funds to, added by the customer.
setRefundFee() : void
  Sets amount of the refund fee
setRequestDate() : void
  Sets request date
setStatus() : void
  Sets refund status
setSupportRequest() : void
  Sets the ID of the associated support request for the refund.
setToken() : void
  Sets API token
setTransactionAmount() : void
  Sets amount to be refunded in terms of the transaction currency.
setTransactionCurrency() : void
  Sets the currency used for the invoice transaction.
setTransactionRefundFee() : void
  Sets the refund fee expressed in terms of transaction currency.
setTxid() : void
  Sets the transaction ID of the refund once executed.
setType() : void
  <p>Sets the type of refund.</p> <ul> <li>full (current rate): A full refund of the amount paid at the current rate.</li> <li>full (fixed rate): A full refund of the amount paid at the fixed rate.
toArray() : array<string|int, mixed>
  Return Refund values as array

### Properties

#### $amount

Refund.php : 22
`protected float $amount`

#### $buyerPaysRefundFee

Refund.php : 31
`protected bool|null $buyerPaysRefundFee = null`

#### $currency

Refund.php : 23
`protected string $currency`

#### $guid

Refund.php : 21
`protected string|null $guid = null`

#### $id

Refund.php : 25
`protected string|null $id = null`

#### $immediate

Refund.php : 30
`protected bool|null $immediate = null`

#### $invoice

Refund.php : 35
`protected string|null $invoice = null`

#### $invoiceId

Refund.php : 28
`protected string|null $invoiceId = null`

#### $lastRefundNotification

Refund.php : 34
`protected string|null $lastRefundNotification = null`

#### $notificationURL

Refund.php : 36
`protected string|null $notificationURL = null`

#### $preview

Refund.php : 29
`protected bool|null $preview = null`

#### $reference

Refund.php : 33
`protected string|null $reference = null`

#### $refundAddress

Refund.php : 37
`protected string|null $refundAddress = null`

#### $refundFee

Refund.php : 32
`protected float|null $refundFee = null`

#### $requestDate

Refund.php : 26
`protected string|null $requestDate = null`

#### $status

Refund.php : 27
`protected string|null $status = null`

#### $supportRequest

Refund.php : 38
`protected string|null $supportRequest = null`

#### $token

Refund.php : 24
`protected string $token`

#### $transactionAmount

Refund.php : 39
`protected float|null $transactionAmount = null`

#### $transactionCurrency

Refund.php : 40
`protected string|null $transactionCurrency = null`

#### $transactionRefundFee

Refund.php : 41
`protected float|null $transactionRefundFee = null`

#### $txid

Refund.php : 42
`protected string|null $txid = null`

#### $type

Refund.php : 43
`protected string|null $type = null`

### Methods

#### __construct()

Refund.php : 52

Constructor, create Refund object

`public __construct([float $amount = 0.0 ][, string $currency = "" ][, string $token = "" ]) : mixed`

##### Parameters

$amount : float = 0.0
$currency : string = ""
$token : string = ""

#### getAmount()

Refund.php : 113

Gets amount to be refunded in the invoice currency

`public getAmount() : float`

##### Return values

float

#### getBuyerPaysRefundFee()

Refund.php : 358

Gets whether the buyer should pay the refund fee rather than the merchant

`public getBuyerPaysRefundFee() : bool|null`

##### Return values

bool|null

#### getCurrency()

Refund.php : 153

Gets reference currency used for the refund, the same as the currency used to create the invoice

`public getCurrency() : string`

##### Return values

string

#### getGuid()

Refund.php : 71

Gets a passthru variable provided by the merchant and designed to be used by the merchant to correlate the invoice with an order ID in their system

`public getGuid() : string|null`

##### Return values

string|null

#### getId()

Refund.php : 216

Gets the ID of the refund

`public getId() : string|null`

##### Return values

string|null

#### getImmediate()

Refund.php : 277

Gets whether the funds should be removed from merchant ledger immediately on submission or at the time of processing

`public getImmediate() : bool|null`

##### Return values

bool|null

#### getInvoice()

Refund.php : 337

Gets the ID of the invoice being refunded

`public getInvoice() : string|null`

##### Return values

string|null

#### getInvoiceId()

Refund.php : 193

Gets the ID of the invoice to refund

`public getInvoiceId() : string|null`

##### Return values

string|null

#### getLastRefundNotification()

Refund.php : 317

Gets the last time notification of buyer was attempted

`public getLastRefundNotification() : string|null`

##### Return values

string|null

#### getNotificationURL()

Refund.php : 378

Gets URL to which BitPay sends webhook notifications. HTTPS is mandatory.

`public getNotificationURL() : string|null`

##### Return values

string|null

#### getPreview()

Refund.php : 173

Whether to create the refund request as a preview

`public getPreview() : bool|null`

##### Return values

bool|null

#### getReference()

Refund.php : 93

Present only if specified in the request to create the refund. This is your reference label for this refund.

`public getReference() : string|null`

It will be passed-through on each response for you to identify the refund in your system. Maximum string length is 100 characters

##### Return values

string|null

#### getRefundAddress()

Refund.php : 398

Gets the wallet address that the refund will return the funds to, added by the customer.

`public getRefundAddress() : string|null`

##### Return values

string|null

#### getRefundFee()

Refund.php : 297

Gets the amount of refund fee expressed in terms of pricing currency

`public getRefundFee() : float|null`

##### Return values

float|null

#### getRequestDate()

Refund.php : 236

Gets the date the refund was requested

`public getRequestDate() : string|null`

##### Return values

string|null

#### getStatus()

Refund.php : 256

Gets the refund lifecycle status of the request

`public getStatus() : string|null`

##### Return values

string|null

#### getSupportRequest()

Refund.php : 418

Gets the ID of the associated support request for the refund.

`public getSupportRequest() : string|null`

##### Return values

string|null

#### getToken()

Refund.php : 133

Gets API token

`public getToken() : string`

##### Return values

string

#### getTransactionAmount()

Refund.php : 438

Gets amount to be refunded in terms of the transaction currency.

`public getTransactionAmount() : float|null`

##### Return values

float|null

#### getTransactionCurrency()

Refund.php : 458

Gets the currency used for the invoice transaction.

`public getTransactionCurrency() : string|null`

##### Return values

string|null

#### getTransactionRefundFee()

Refund.php : 478

Gets the refund fee expressed in terms of transaction currency.

`public getTransactionRefundFee() : float|null`

##### Return values

float|null

#### getTxid()

Refund.php : 498

Gets the transaction ID of the refund once executed.

`public getTxid() : string|null`

##### Return values

string|null

#### getType()

Refund.php : 528

<p>Gets the type of refund.</p> <ul> <li>full (current rate): A full refund of the amount paid at the current rate.</li> <li>full (fixed rate): A full refund of the amount paid at the fixed rate.

`public getType() : string|null`

Note: deprecated refund implementation only.

- partial: Part of the invoice is being refunded, rather than the full invoie amount.
- underpayment: The payment was underpaid, a refund in the amount paid will be executed.
- overpayment: The payment was overpaid, a refund in the amount that was overpaid from the invoice price will be executed.
- declined: The payment was declined, a refund in the full amount paid will be excuted.

##### Return values

string|null

#### setAmount()

Refund.php : 123

Sets amount to be refunded

`public setAmount(float $amount) : void`

##### Parameters

$amount : float

#### setBuyerPaysRefundFee()

Refund.php : 368

Sets whether the buyer should pay the refund fee rather

`public setBuyerPaysRefundFee(bool $buyerPaysRefundFee) : void`

##### Parameters

$buyerPaysRefundFee : bool

#### setCurrency()

Refund.php : 163

Sets currency used for the refund

`public setCurrency(string $currency) : void`

##### Parameters

$currency : string

#### setGuid()

Refund.php : 81

Sets guid

`public setGuid(string $guid) : void`

##### Parameters

$guid : string

#### setId()

Refund.php : 226

Sets id of the refund

`public setId(string $id) : void`

##### Parameters

$id : string

#### setImmediate()

Refund.php : 287

Sets immediate value

`public setImmediate(bool $immediate) : void`

##### Parameters

$immediate : bool

#### setInvoice()

Refund.php : 347

Sets the id of the invoice being refunded

`public setInvoice(string $invoice) : void`

##### Parameters

$invoice : string

#### setInvoiceId()

Refund.php : 203

Sets invoice id

`public setInvoiceId(string $invoiceId) : void`

##### Parameters

$invoiceId : string

#### setLastRefundNotification()

Refund.php : 327

Sets last refund notification

`public setLastRefundNotification(string $lastRefundNotification) : void`

##### Parameters

$lastRefundNotification : string

#### setNotificationURL()

Refund.php : 388

Sets URL to which BitPay sends webhook notifications. HTTPS is mandatory.

`public setNotificationURL(string|null $notificationURL) : void`

##### Parameters

$notificationURL : string|null

#### setPreview()

Refund.php : 183

Sets preview

`public setPreview(bool $preview) : void`

##### Parameters

$preview : bool

#### setReference()

Refund.php : 103

Sets reference label for refund

`public setReference(string $reference) : void`

##### Parameters

$reference : string

#### setRefundAddress()

Refund.php : 408

Sets the wallet address that the refund will return the funds to, added by the customer.

`public setRefundAddress(string|null $refundAddress) : void`

##### Parameters

$refundAddress : string|null

#### setRefundFee()

Refund.php : 307

Sets amount of the refund fee

`public setRefundFee(float $refundFee) : void`

##### Parameters

$refundFee : float

#### setRequestDate()

Refund.php : 246

Sets request date

`public setRequestDate(string $requestDate) : void`

##### Parameters

$requestDate : string

#### setStatus()

Refund.php : 266

Sets refund status

`public setStatus(string $status) : void`

##### Parameters

$status : string

#### setSupportRequest()

Refund.php : 428

Sets the ID of the associated support request for the refund.

`public setSupportRequest(string|null $supportRequest) : void`

##### Parameters

$supportRequest : string|null

#### setToken()

Refund.php : 143

Sets API token

`public setToken(string $token) : void`

##### Parameters

$token : string

#### setTransactionAmount()

Refund.php : 448

Sets amount to be refunded in terms of the transaction currency.

`public setTransactionAmount(float|null $transactionAmount) : void`

##### Parameters

$transactionAmount : float|null

#### setTransactionCurrency()

Refund.php : 468

Sets the currency used for the invoice transaction.

`public setTransactionCurrency(string|null $transactionCurrency) : void`

##### Parameters

$transactionCurrency : string|null

#### setTransactionRefundFee()

Refund.php : 488

Sets the refund fee expressed in terms of transaction currency.

`public setTransactionRefundFee(float|null $transactionRefundFee) : void`

##### Parameters

$transactionRefundFee : float|null

#### setTxid()

Refund.php : 508

Sets the transaction ID of the refund once executed.

`public setTxid(string|null $txid) : void`

##### Parameters

$txid : string|null

#### setType()

Refund.php : 548

<p>Sets the type of refund.</p> <ul> <li>full (current rate): A full refund of the amount paid at the current rate.</li> <li>full (fixed rate): A full refund of the amount paid at the fixed rate.

`public setType(string|null $type) : void`

Note: deprecated refund implementation only.

- partial: Part of the invoice is being refunded, rather than the full invoie amount.
- underpayment: The payment was underpaid, a refund in the amount paid will be executed.
- overpayment: The payment was overpaid, a refund in the amount that was overpaid from the invoice price will be executed.
- declined: The payment was declined, a refund in the full amount paid will be excuted.

##### Parameters

$type : string|null

#### toArray()

Refund.php : 558

Return Refund values as array

`public toArray() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

## Search results