Invoice
in package
Tags
Table of Contents
Properties
- $acceptanceWindow : int|null
- $amountPaid : float|null
- $autoRedirect : bool
- $billId : string|null
- $bitpayIdRequired : bool|null
- $buyer : Buyer|null
- $buyerEmail : string|null
- $buyerProvidedEmail : string|null
- $buyerProvidedInfo : BuyerProvidedInfo|null
- $buyerSms : string|null
- $closeURL : string|null
- $currency : string|null
- $currentTime : int|null
- $displayAmountPaid : string|null
- $exceptionStatus : string|null
- $exchangeRates : array<string|int, mixed>|null
- $expirationTime : int|null
- $extendedNotifications : bool
- $forcedBuyerSelectedTransactionCurrency : string|null
- $forcedBuyerSelectedWallet : string|null
- $fullNotifications : bool
- $guid : string|null
- $id : string|null
- $invoiceTime : int|null
- $isCancelled : bool|null
- $itemCode : string|null
- $itemDesc : string|null
- $itemizedDetails : array<string|int, ItemizedDetails>
- $jsonPayProRequired : bool|null
- $lowFeeDetected : bool|null
- $merchantName : string|null
- $minerFees : MinerFees|null
- $nonPayProPaymentReceived : bool|null
- $notificationEmail : string|null
- $notificationURL : string|null
- $orderId : string|null
- $overpaidAmount : float|null
- $paymentCodes : array<string|int, mixed>|null
- $paymentCurrencies : array<string|int, mixed>|null
- $paymentDisplaySubTotals : array<string|int, mixed>|null
- $paymentDisplayTotals : array<string|int, mixed>|null
- $paymentSubtotals : array<string|int, mixed>|null
- $paymentTotals : array<string|int, mixed>|null
- $physical : bool
- $posData : string|null
- $price : float|null
- $redirectURL : string|null
- $refundAddresses : array<string|int, mixed>|null
- $refundAddressRequestPending : bool|null
- $refundInfo : RefundInfo|null
- $selectedTransactionCurrency : string|null
- $shopper : Shopper|null
- $status : string|null
- $supportedTransactionCurrencies : SupportedTransactionCurrencies|null
- $targetConfirmations : int|null
- $token : string|null
- $transactionCurrency : string|null
- $transactions : array<string|int, mixed>|null
- $transactionSpeed : string|null
- $underpaidAmount : float|null
- $universalCodes : UniversalCodes|null
- $url : string|null
Methods
- __construct() : mixed
- Constructor, create a minimal request Invoice object.
- getAcceptanceWindow() : int|null
- Gets acceptanceWindow
- getAmountPaid() : float|null
- Gets amountPaid
- getAutoRedirect() : bool|null
- Gets autoRedirect
- getBillId() : string|null
- Gets billId
- getBitpayIdRequired() : bool|null
- Gets bitpayIdRequired
- getBuyer() : Buyer|null
- Gets buyer
- getBuyerEmail() : string|null
- Gets buyerEmail
- getBuyerProvidedEmail() : string|null
- Gets buyerProvidedEmail
- getBuyerProvidedInfo() : BuyerProvidedInfo|null
- Gets buyerProvidedEmail
- getBuyerSms() : string|null
- Gets buyerSms
- getCloseURL() : string|null
- Gets closeURL
- getCurrency() : string|null
- Gets currency
- getCurrentTime() : int|null
- Gets currentTime - UNIX time of API call, in milliseconds
- getDisplayAmountPaid() : string|null
- Gets displayAmountPaid
- getExceptionStatus() : string|null
- Gets exceptionStatus
- getExchangeRates() : array<string|int, mixed>|null
- Gets exchangeRates
- getExpirationTime() : int|null
- Gets expirationTime - UNIX time when invoice is last available to be paid, in milliseconds
- getExtendedNotifications() : bool|null
- Gets extendedNotifications
- getForcedBuyerSelectedTransactionCurrency() : string|null
- Gets forcedBuyerSelectedWallet
- getForcedBuyerSelectedWallet() : string|null
- Gets forcedBuyerSelectedWallet
- getFullNotifications() : bool|null
- Gets fullNotifications
- getGuid() : string|null
- Gets guid
- getId() : string|null
- Gets invoice resource id
- getInvoiceTime() : int|null
- Gets invoiceTime - UNIX time of invoice creation, in milliseconds
- getIsCancelled() : bool|null
- Gets isCancelled
- getItemCode() : string|null
- Gets itemCode
- getItemDesc() : string|null
- Gets itemDesc
- getItemizedDetails() : array<string|int, ItemizedDetails>
- Gets itemizedDetails
- getJsonPayProRequired() : bool|null
- Gets jsonPayProRequired
- getLowFeeDetected() : bool|null
- Gets lowFeeDetected
- getMerchantName() : string|null
- Gets merchantName
- getMinerFees() : MinerFees|null
- Gets minerFees
- getNonPayProPaymentReceived() : bool|null
- Gets nonPayProPaymentReceived
- getNotificationEmail() : string|null
- Gets NotificationEmail
- getNotificationURL() : string|null
- Gets notificationURL
- getOrderId() : string|null
- Gets orderId
- getOverpaidAmount() : float|null
- Gets overpaidAmount
- getPaymentCodes() : array<string|int, mixed>|null
- Gets paymentCodes
- getPaymentCurrencies() : array<string|int, mixed>|null
- Gets paymentCurrencies
- getPaymentDisplaySubTotals() : array<string|int, mixed>|null
- Gets paymentDisplaySubtotals
- getPaymentDisplayTotals() : array<string|int, mixed>|null
- Gets paymentDisplayTotals
- getPaymentSubtotals() : array<string|int, mixed>|null
- Gets paymentSubtotals
- getPaymentTotals() : array<string|int, mixed>|null
- Gets paymentTotals
- getPhysical() : bool|null
- Gets physical.
- getPosData() : string|null
- Gets posData
- getPrice() : float|null
- Gets price
- getRedirectURL() : string|null
- Gets RedirectURL
- getRefundAddresses() : array<string|int, mixed>|null
- Gets refundAddresses
- getRefundAddressRequestPending() : bool|null
- Gets refundAddressRequestPending
- getRefundInfo() : RefundInfo|null
- Gets refundInfo
- getSelectedTransactionCurrency() : string|null
- Gets selectedTransactionCurrency
- getShopper() : Shopper|null
- Gets shopper
- getStatus() : string|null
- Gets status
- getSupportedTransactionCurrencies() : SupportedTransactionCurrencies|null
- Gets supportedTransactionCurrencies
- getTargetConfirmations() : int|null
- Gets targetConfirmations
- getToken() : string|null
- Gets token
- getTransactionCurrency() : string|null
- Gets transactionCurrency
- getTransactions() : array<string|int, mixed>|null
- Gets transactions
- getTransactionSpeed() : string|null
- Gets transactionSpeed.
- getUnderpaidAmount() : float|null
- Gets underpaidAmount
- getUniversalCodes() : UniversalCodes|null
- Gets universalCodes
- getUrl() : string|null
- Gets url
- setAcceptanceWindow() : void
- Sets acceptanceWindow
- setAmountPaid() : void
- Sets amountPaid
- setAutoRedirect() : void
- Sets autoRedirect
- setBillId() : void
- Sets billId
- setBitpayIdRequired() : void
- Sets bitpayIdRequired
- setBuyer() : void
- Sets buyer
- setBuyerEmail() : void
- Sets buyerEmail
- setBuyerProvidedEmail() : void
- Sets buyerProvidedEmail
- setBuyerProvidedInfo() : mixed
- Sets buyerProvidedEmail
- setBuyerSms() : void
- Sets buyerSms
- setCloseURL() : void
- Gets closeURL
- setCurrency() : void
- Sets currency
- setCurrentTime() : void
- Sets currentTime - UNIX time of API call, in milliseconds
- setDisplayAmountPaid() : void
- Sets displayAmountPaid
- setExceptionStatus() : void
- Sets exceptionStatus
- setExchangeRates() : void
- Sets exchangeRates
- setExpirationTime() : void
- Sets expirationTime - UNIX time when invoice is last available to be paid, in milliseconds
- setExtendedNotifications() : void
- Sets extendedNotifications
- setForcedBuyerSelectedTransactionCurrency() : mixed
- Sets forcedBuyerSelectedWallet
- setForcedBuyerSelectedWallet() : mixed
- Sets forcedBuyerSelectedWallet
- setFullNotifications() : void
- Sets fullNotifications
- setGuid() : void
- Sets guid
- setId() : void
- Sets invoice resource id
- setInvoiceTime() : mixed
- Sets invoiceTime - UNIX time of invoice creation, in milliseconds
- setIsCancelled() : void
- Sets isCancelled
- setItemCode() : void
- Sets itemCode
- setItemDesc() : void
- Sets itemDesc
- setItemizedDetails() : void
- Sets itemizedDetails
- setJsonPayProRequired() : void
- Sets jsonPayProRequired
- setLowFeeDetected() : mixed
- Sets lowFeeDetected
- setMerchantName() : void
- Sets merchantName
- setMinerFees() : void
- Sets minerFees
- setNonPayProPaymentReceived() : void
- Sets nonPayProPaymentReceived
- setNotificationEmail() : void
- Sets NotificationEmail
- setNotificationURL() : void
- Sets notificationURL
- setOrderId() : void
- Sets orderId
- setOverpaidAmount() : void
- Sets overpaidAmount
- setPaymentCodes() : mixed
- Sets paymentCodes
- setPaymentCurrencies() : void
- Sets paymentCurrencies
- setPaymentDisplaySubTotals() : mixed
- Sets paymentDisplaySubtotals
- setPaymentDisplayTotals() : mixed
- Sets paymentDisplayTotals
- setPaymentSubtotals() : mixed
- Sets paymentSubtotals
- setPaymentTotals() : mixed
- Sets paymentTotals
- setPhysical() : void
- Sets physical.
- setPosData() : void
- Sets posData
- setPrice() : void
- Sets price
- setRedirectURL() : void
- Sets RedirectURL
- setRefundAddresses() : void
- Sets refundAddresses
- setRefundAddressRequestPending() : void
- Sets refundAddressRequestPending
- setRefundInfo() : void
- Sets refundInfo
- setSelectedTransactionCurrency() : void
- Sets selectedTransactionCurrency
- setShopper() : mixed
- Sets shopper
- setStatus() : void
- Sets status
- setSupportedTransactionCurrencies() : void
- Sets supportedTransactionCurrencies
- setTargetConfirmations() : void
- Sets targetConfirmations
- setToken() : void
- Sets token
- setTransactionCurrency() : void
- Sets transactionCurrency
- setTransactions() : void
- Sets transactions
- setTransactionSpeed() : void
- Sets transactionSpeed.
- setUnderpaidAmount() : void
- Sets underpaidAmount
- setUniversalCodes() : mixed
- Sets universalCodes
- setUrl() : void
- Sets url
- toArray() : array<string|int, mixed>
- Returns the Invoice object as array
Properties
$acceptanceWindow
protected
int|null
$acceptanceWindow
= null
$amountPaid
protected
float|null
$amountPaid
= null
$autoRedirect
protected
bool
$autoRedirect
= false
$billId
protected
string|null
$billId
= null
$bitpayIdRequired
protected
bool|null
$bitpayIdRequired
= null
$buyer
protected
Buyer|null
$buyer
= null
$buyerEmail
protected
string|null
$buyerEmail
= null
$buyerProvidedEmail
protected
string|null
$buyerProvidedEmail
= null
$buyerProvidedInfo
protected
BuyerProvidedInfo|null
$buyerProvidedInfo
= null
$buyerSms
protected
string|null
$buyerSms
= null
$closeURL
protected
string|null
$closeURL
= null
$currency
protected
string|null
$currency
= null
$currentTime
protected
int|null
$currentTime
= null
$displayAmountPaid
protected
string|null
$displayAmountPaid
= null
$exceptionStatus
protected
string|null
$exceptionStatus
= null
$exchangeRates
protected
array<string|int, mixed>|null
$exchangeRates
= null
$expirationTime
protected
int|null
$expirationTime
= null
$extendedNotifications
protected
bool
$extendedNotifications
= false
$forcedBuyerSelectedTransactionCurrency
protected
string|null
$forcedBuyerSelectedTransactionCurrency
= null
$forcedBuyerSelectedWallet
protected
string|null
$forcedBuyerSelectedWallet
= null
$fullNotifications
protected
bool
$fullNotifications
= false
$guid
protected
string|null
$guid
= null
$id
protected
string|null
$id
= null
$invoiceTime
protected
int|null
$invoiceTime
= null
$isCancelled
protected
bool|null
$isCancelled
= null
$itemCode
protected
string|null
$itemCode
= null
$itemDesc
protected
string|null
$itemDesc
= null
$itemizedDetails
protected
array<string|int, ItemizedDetails>
$itemizedDetails
= []
$jsonPayProRequired
protected
bool|null
$jsonPayProRequired
= null
$lowFeeDetected
protected
bool|null
$lowFeeDetected
= null
$merchantName
protected
string|null
$merchantName
= null
$minerFees
protected
MinerFees|null
$minerFees
= null
$nonPayProPaymentReceived
protected
bool|null
$nonPayProPaymentReceived
= null
$notificationEmail
protected
string|null
$notificationEmail
= null
$notificationURL
protected
string|null
$notificationURL
= null
$orderId
protected
string|null
$orderId
= null
$overpaidAmount
protected
float|null
$overpaidAmount
= null
$paymentCodes
protected
array<string|int, mixed>|null
$paymentCodes
= null
$paymentCurrencies
protected
array<string|int, mixed>|null
$paymentCurrencies
= null
$paymentDisplaySubTotals
protected
array<string|int, mixed>|null
$paymentDisplaySubTotals
= null
$paymentDisplayTotals
protected
array<string|int, mixed>|null
$paymentDisplayTotals
= null
$paymentSubtotals
protected
array<string|int, mixed>|null
$paymentSubtotals
= null
$paymentTotals
protected
array<string|int, mixed>|null
$paymentTotals
= null
$physical
protected
bool
$physical
= false
$posData
protected
string|null
$posData
= null
$price
protected
float|null
$price
= null
$redirectURL
protected
string|null
$redirectURL
= null
$refundAddresses
protected
array<string|int, mixed>|null
$refundAddresses
= null
$refundAddressRequestPending
protected
bool|null
$refundAddressRequestPending
= null
$refundInfo
protected
RefundInfo|null
$refundInfo
= null
$selectedTransactionCurrency
protected
string|null
$selectedTransactionCurrency
= null
$shopper
protected
Shopper|null
$shopper
= null
$status
protected
string|null
$status
= null
$supportedTransactionCurrencies
protected
SupportedTransactionCurrencies|null
$supportedTransactionCurrencies
= null
$targetConfirmations
protected
int|null
$targetConfirmations
= null
$token
protected
string|null
$token
= null
$transactionCurrency
protected
string|null
$transactionCurrency
= null
$transactions
protected
array<string|int, mixed>|null
$transactions
= null
$transactionSpeed
protected
string|null
$transactionSpeed
= null
$underpaidAmount
protected
float|null
$underpaidAmount
= null
$universalCodes
protected
UniversalCodes|null
$universalCodes
= null
$url
protected
string|null
$url
= null
Methods
__construct()
Constructor, create a minimal request Invoice object.
public
__construct([float|null $price = null ][, string|null $currency = null ]) : mixed
Parameters
- $price : float|null = null
-
float The amount for which the invoice will be created.
- $currency : string|null = null
-
string three digit currency type used to compute the invoice bitcoin amount.
getAcceptanceWindow()
Gets acceptanceWindow
public
getAcceptanceWindow() : int|null
Number of milliseconds that a user has to pay an invoice before it expires (0-900000). If not set, invoice will default to the account acceptanceWindow. If account acceptanceWindow is not set, invoice will default to 15 minutes (900,000 milliseconds).
Return values
int|null —the acceptance window
getAmountPaid()
Gets amountPaid
public
getAmountPaid() : float|null
The total amount paid to the invoice in terms of the invoice transactionCurrency indicated in the smallest possible unit for the corresponding transactionCurrency (e.g satoshis for BTC and BCH)
Return values
float|nullgetAutoRedirect()
Gets autoRedirect
public
getAutoRedirect() : bool|null
Set to false by default, merchant can setup automatic redirect to their website by setting this parameter to true.
Return values
bool|null —the auto redirect
getBillId()
Gets billId
public
getBillId() : string|null
This field will be in the invoice object only if the invoice was generated from a bill,
Tags
Return values
string|nullgetBitpayIdRequired()
Gets bitpayIdRequired
public
getBitpayIdRequired() : bool|null
BitPay ID is a verification process that is required when a user is making payments or receiving a refund over a given threshold, which may vary by region. This Boolean forces the invoice to require BitPay ID regardless of the price.
Return values
bool|null —the Bitpay id required
getBuyer()
Gets buyer
public
getBuyer() : Buyer|null
Allows merchant to pass buyer related information in the invoice object
Return values
Buyer|null —the buyer
getBuyerEmail()
Gets buyerEmail
public
getBuyerEmail() : string|null
Buyer's email address. If provided during invoice creation, this will bypass the email prompt for the consumer when opening the invoice.
Return values
string|null —the buyer email
getBuyerProvidedEmail()
Gets buyerProvidedEmail
public
getBuyerProvidedEmail() : string|null
Populated with the buyer's email address if passed in the buyer object by the merchant, otherwise this field is not returned for newly created invoices. If the merchant does not pass the buyer email in the invoice request, the bitpay invoice UI will prompt the user to enter his email address and this field will be populated with the email submitted.
Return values
string|null —the buyer provided email
getBuyerProvidedInfo()
Gets buyerProvidedEmail
public
getBuyerProvidedInfo() : BuyerProvidedInfo|null
Information collected from the buyer during the process of paying an invoice. Initially this object is empty.
Return values
BuyerProvidedInfo|null —Information collected from the buyer
getBuyerSms()
Gets buyerSms
public
getBuyerSms() : string|null
SMS provided by user for communications. This is only used for instances where a buyers email (primary form of buyer communication) is can not be gathered.
Return values
string|null —the buyer sms
getCloseURL()
Gets closeURL
public
getCloseURL() : string|null
URL to redirect if the shopper does not pay the invoice and click on the Close button instead.
Return values
string|null —the close url
getCurrency()
Gets currency
public
getCurrency() : string|null
ISO 4217 3-character currency code. This is the currency associated with the price field, supported currencies are available via the Currencies resource
Return values
string|null —The currency
getCurrentTime()
Gets currentTime - UNIX time of API call, in milliseconds
public
getCurrentTime() : int|null
Return values
int|null —UNIX time
getDisplayAmountPaid()
Gets displayAmountPaid
public
getDisplayAmountPaid() : string|null
Initially set to "0" when creating the invoice. It will be updated with the total amount paid to the invoice indicated in the base unit for the corresponding transactionCurrency
Return values
string|nullgetExceptionStatus()
Gets exceptionStatus
public
getExceptionStatus() : string|null
Initially a boolean false, this parameter will indicate if the purchaser sent too much ("paidOver") or not enough funds ("paidPartial") in the transaction to pay the BitPay invoice. Possible values are: "false": default value unless an exception is triggered. "paidPartial": (string) if the consumer did not send enough funds when paying the invoice. "paidOver": (string) if the consumer sent to much funds when paying the invoice.
Return values
string|null —the exception status
getExchangeRates()
Gets exchangeRates
public
getExchangeRates() : array<string|int, mixed>|null
Exchange rates keyed by source and target currencies.
Return values
array<string|int, mixed>|nullgetExpirationTime()
Gets expirationTime - UNIX time when invoice is last available to be paid, in milliseconds
public
getExpirationTime() : int|null
Return values
int|null —the UNIX time
getExtendedNotifications()
Gets extendedNotifications
public
getExtendedNotifications() : bool|null
Allows merchants to get access to additional webhooks. For instance when an invoice expires without receiving a payment or when it is refunded. If set to true, then fullNotifications is automatically set to true. When using the extendedNotifications parameter, the webhook also have a payload slightly different from the standard webhooks.
Return values
bool|nullgetForcedBuyerSelectedTransactionCurrency()
Gets forcedBuyerSelectedWallet
public
getForcedBuyerSelectedTransactionCurrency() : string|null
Merchant pre-selects transaction currency on behalf of buyer.
Return values
string|null —Merchant pre-selects transaction currency
getForcedBuyerSelectedWallet()
Gets forcedBuyerSelectedWallet
public
getForcedBuyerSelectedWallet() : string|null
Merchant pre-selects transaction currency on behalf of buyer.
Return values
string|null —the forced buyer selected wallet
getFullNotifications()
Gets fullNotifications
public
getFullNotifications() : bool|null
This parameter is set to true by default, meaning all standard notifications are being sent for a payment made to an invoice. If you decide to set it to false instead, only 1 webhook will be sent for each invoice paid by the consumer. This webhook will be for the "confirmed" or "complete" invoice status, depending on the transactionSpeed selected.
Return values
bool|null —the full notification
getGuid()
Gets guid
public
getGuid() : string|null
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, which can be used as a lookup variable in Retrieve Invoice by GUID.
Return values
string|null —The guid
getId()
Gets invoice resource id
public
getId() : string|null
Return values
string|null —Invoice resource id
getInvoiceTime()
Gets invoiceTime - UNIX time of invoice creation, in milliseconds
public
getInvoiceTime() : int|null
Return values
int|null —UNIX time of invoice creation, in milliseconds
getIsCancelled()
Gets isCancelled
public
getIsCancelled() : bool|null
Indicates whether or not the invoice was cancelled.
Return values
bool|nullgetItemCode()
Gets itemCode
public
getItemCode() : string|null
"bitcoindonation" for donations, otherwise do not include the field in the request.
Return values
string|null —the item code
getItemDesc()
Gets itemDesc
public
getItemDesc() : string|null
Invoice description - will be added as a line item on the BitPay checkout page, under the merchant name.
Return values
string|null —the item desc
getItemizedDetails()
Gets itemizedDetails
public
getItemizedDetails() : array<string|int, ItemizedDetails>
Object containing line item details for display.
Return values
array<string|int, ItemizedDetails>getJsonPayProRequired()
Gets jsonPayProRequired
public
getJsonPayProRequired() : bool|null
Boolean set to false by default. If set to true, this means that the invoice will only accept payments from wallets which have implemented the BitPay JSON Payment Protocol
Return values
bool|null —the json pay pro required
getLowFeeDetected()
Gets lowFeeDetected
public
getLowFeeDetected() : bool|null
Flag to indicate if the miner fee used by the buyer is too low. Initially set to false when the invoice is created.
Return values
bool|null —Flag to indicate if the miner fee used by the buyer is too low
getMerchantName()
Gets merchantName
public
getMerchantName() : string|null
A display string for merchant identification (ex. Wal-Mart Store #1452, Bowling Green, KY).
Return values
string|null —the merchant name
getMinerFees()
Gets minerFees
public
getMinerFees() : MinerFees|null
The total amount of fees that the purchaser will pay to cover BitPay's UTXO sweep cost for an invoice. The key is the currency and the value is an object containing the satoshis per byte, the total fee, and the fiat amount. This is referenced as "Network Cost" on an invoice, see this support article for more information
Return values
MinerFees|nullgetNonPayProPaymentReceived()
Gets nonPayProPaymentReceived
public
getNonPayProPaymentReceived() : bool|null
This boolean will be available on an invoice object once an invoice is paid and indicate if the transaction was made with a wallet using the payment protocol (true) or peer to peer (false).
Return values
bool|nullgetNotificationEmail()
Gets NotificationEmail
public
getNotificationEmail() : string|null
Merchant email address for notification of payout status change.
Return values
string|null —the notification email
getNotificationURL()
Gets notificationURL
public
getNotificationURL() : string|null
Return values
string|null —- URL to which BitPay sends webhook notifications. HTTPS is mandatory.
getOrderId()
Gets orderId
public
getOrderId() : string|null
Can be used by the merchant to assign their own internal Id to an invoice. If used, there should be a direct match between an orderId and an invoice id.
Return values
string|nullgetOverpaidAmount()
Gets overpaidAmount
public
getOverpaidAmount() : float|null
This parameter will be returned on the invoice object if the invoice was overpaid ("exceptionStatus": "paidOver"). It equals to the absolute difference between amountPaid and paymentTotals for the corresponding transactionCurrency used.
Return values
float|nullgetPaymentCodes()
Gets paymentCodes
public
getPaymentCodes() : array<string|int, mixed>|null
The URIs for sending a transaction to the invoice. The first key is the transaction currency. The transaction currency maps to an object containing the payment URIs. The key of this object is the BIP number and the value is the payment URI. For "BTC", "BCH" and "DOGE" - BIP72b and BIP73 are supported. For "ETH", "GUSD", "PAX", "BUSD", "USDC", "DAI" and "WBTC"- EIP681 is supported For "XRP" - RIP681, BIP72b and BIP73 is supported
Return values
array<string|int, mixed>|nullgetPaymentCurrencies()
Gets paymentCurrencies
public
getPaymentCurrencies() : array<string|int, mixed>|null
Allow the merchant to select the cryptocurrencies available as payment option on the BitPay invoice. Possible values are currently "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC". For instance "paymentCurrencies": ["BTC"] will create an invoice with only XRP available as transaction currency, thus bypassing the currency selection step on the invoice.
Return values
array<string|int, mixed>|null —the payment currencies
getPaymentDisplaySubTotals()
Gets paymentDisplaySubtotals
public
getPaymentDisplaySubTotals() : array<string|int, mixed>|null
Equivalent to price for each supported transactionCurrency, excluding minerFees. The key is the currency and the value is an amount indicated in the base unit for each supported transactionCurrency.
Return values
array<string|int, mixed>|null —Equivalent to price for each supported transactionCurrency
getPaymentDisplayTotals()
Gets paymentDisplayTotals
public
getPaymentDisplayTotals() : array<string|int, mixed>|null
The total amount that the purchaser should pay as displayed on the invoice UI. This is like paymentDisplaySubTotals but with the minerFees included. The key is the currency and the value is an amount indicated in the base unit for each supported transactionCurrency.
Return values
array<string|int, mixed>|null —The total amount that the purchaser should pay
getPaymentSubtotals()
Gets paymentSubtotals
public
getPaymentSubtotals() : array<string|int, mixed>|null
For internal use. This field can be ignored in merchant implementations.
Return values
array<string|int, mixed>|null —the payment subtotals
getPaymentTotals()
Gets paymentTotals
public
getPaymentTotals() : array<string|int, mixed>|null
For internal use - This field can be ignored in merchant implementations.
Return values
array<string|int, mixed>|null —the payment totals
getPhysical()
Gets physical.
public
getPhysical() : bool|null
Indicates whether items are physical goods. Alternatives include digital goods and services.
Return values
bool|null —the physical
getPosData()
Gets posData
public
getPosData() : string|null
A passthru variable provided by the merchant during invoice creation and designed to be used by the merchant to correlate the invoice with an order or other object in their system. This passthru variable can be a serialized object.
Return values
string|null —The pos data
getPrice()
Gets price
public
getPrice() : float|null
Fixed price amount for the checkout, in the "currency" of the invoice object.
Return values
float|null —The price
getRedirectURL()
Gets RedirectURL
public
getRedirectURL() : string|null
The shopper will be redirected to this URL when clicking on the Return button after a successful payment or when clicking on the Close button if a separate closeURL is not specified.
Return values
string|null —the redirect url
getRefundAddresses()
Gets refundAddresses
public
getRefundAddresses() : array<string|int, mixed>|null
Initially empty when the invoice is created. This field will be populated with the refund address provided by the customer if you request a refund of the specific invoice.
Return values
array<string|int, mixed>|null —[[string, InvoiceRefundAddress]] Refund address provided by the customer
getRefundAddressRequestPending()
Gets refundAddressRequestPending
public
getRefundAddressRequestPending() : bool|null
Initially set to false when the invoice is created, this field will be set to true once a refund request has been issued by the merchant. This flag is here to indicate that the refund request is pending action from the buyer to provide an address for the refund, via the secure link which has been automatically emailed to him.
Return values
bool|null —the refund address request pending
getRefundInfo()
Gets refundInfo
public
getRefundInfo() : RefundInfo|null
For a refunded invoice, this object will contain the details of executed refunds for the corresponding invoice.
Return values
RefundInfo|nullgetSelectedTransactionCurrency()
Gets selectedTransactionCurrency
public
getSelectedTransactionCurrency() : string|null
This field will be populated with the cryptocurrency selected to pay the BitPay invoice, current supported values are "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC". If not yet selected, this field will not be returned.
Return values
string|null —the selected transaction currency
getShopper()
Gets shopper
public
getShopper() : Shopper|null
This object will be available on the invoice if a shopper signs in on an invoice using his BitPay ID.
Tags
Return values
Shopper|null —the shopper
getStatus()
Gets status
public
getStatus() : string|null
Detailed information about invoice status notifications can be found under the Instant Payment Notification (IPN) section.
Return values
string|null —InvoiceStatus const value
getSupportedTransactionCurrencies()
Gets supportedTransactionCurrencies
public
getSupportedTransactionCurrencies() : SupportedTransactionCurrencies|null
The currencies that may be used to pay this invoice. The object is keyed by currency code. The values are objects with an "enabled" boolean and option. An extra "reason" parameter is added in the object if a cryptocurrency is disabled on a specific invoice. If you disable a currency via the invoice parameter "paymentCurrencies", this parameter will be set to "merchantDisabledByParam"
Return values
SupportedTransactionCurrencies|null —The currencies that may be used to pay this invoice
getTargetConfirmations()
Gets targetConfirmations
public
getTargetConfirmations() : int|null
Indicates the number of block confirmation of the crypto currency transaction which are required to credit a paid invoice to the merchant account. Currently, the value set is set to 6 by default for BTC/BCH/XRP, 40 for DOGE and 50 for ETH/GUSD/PAX/USDC/BUSD/DAI/WBTC
Return values
int|null —the target confirmations
getToken()
Gets token
public
getToken() : string|null
Invoice resource token. This token is derived from the API token initially used to create the invoice and is tied to the specific resource id created.
Return values
string|null —- Invoice resource token.
getTransactionCurrency()
Gets transactionCurrency
public
getTransactionCurrency() : string|null
The cryptocurrency used to pay the invoice. This field will only be available after a transaction is applied to the invoice. Possible values are currently "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC".
Return values
string|nullgetTransactions()
Gets transactions
public
getTransactions() : array<string|int, mixed>|null
Contains the cryptocurrency transaction details for the executed payout.
Return values
array<string|int, mixed>|null —the transactions
getTransactionSpeed()
Gets transactionSpeed.
public
getTransactionSpeed() : string|null
This is a risk mitigation parameter for the merchant to configure how they want to fulfill orders depending on the number of block confirmations for the transaction made by the consumer on the selected cryptocurrency. If not set on the invoice, transactionSpeed will default to the account-level Order Settings. Note : orders are only credited to your BitPay Account Summary for settlement after the invoice reaches the status "complete" (regardless of this setting).
Return values
string|null —the transaction speed
getUnderpaidAmount()
Gets underpaidAmount
public
getUnderpaidAmount() : float|null
This parameter will be returned on the invoice object if the invoice was underpaid ("exceptionStatus": "paidPartial"). It equals to the absolute difference between amountPaid and paymentTotals for the corresponding transactionCurrency used.
Return values
float|nullgetUniversalCodes()
Gets universalCodes
public
getUniversalCodes() : UniversalCodes|null
Object containing wallet-specific URLs for payment protocol.
Return values
UniversalCodes|null —UniversalCodes
getUrl()
Gets url
public
getUrl() : string|null
Web address of invoice, expires at expirationTime
Return values
string|null —Web address of invoice
setAcceptanceWindow()
Sets acceptanceWindow
public
setAcceptanceWindow(int $acceptanceWindow) : void
Number of milliseconds that a user has to pay an invoice before it expires (0-900000). If not set, invoice will default to the account acceptanceWindow. If account acceptanceWindow is not set, invoice will default to 15 minutes (900,000 milliseconds).
Parameters
- $acceptanceWindow : int
-
Number of milliseconds that a user has to pay an invoice before it expire
setAmountPaid()
Sets amountPaid
public
setAmountPaid(float|null $amountPaid) : void
The total amount paid to the invoice in terms of the invoice transactionCurrency indicated in the smallest possible unit for the corresponding transactionCurrency (e.g satoshis for BTC and BCH)
Parameters
- $amountPaid : float|null
-
The total amount paid to the invoice
setAutoRedirect()
Sets autoRedirect
public
setAutoRedirect(bool $autoRedirect) : void
Set to false by default, merchant can setup automatic redirect to their website by setting this parameter to true.
Parameters
- $autoRedirect : bool
-
the auto redirect
setBillId()
Sets billId
public
setBillId(string $billId) : void
This field will be in the invoice object only if the invoice was generated from a bill,
Parameters
- $billId : string
-
the bill id
Tags
setBitpayIdRequired()
Sets bitpayIdRequired
public
setBitpayIdRequired(bool $bitpayIdRequired) : void
BitPay ID is a verification process that is required when a user is making payments or receiving a refund over a given threshold, which may vary by region. This Boolean forces the invoice to require BitPay ID regardless of the price.
Parameters
- $bitpayIdRequired : bool
-
the bitpay id required
setBuyer()
Sets buyer
public
setBuyer(Buyer $buyer) : void
Allows merchant to pass buyer related information in the invoice object
Parameters
- $buyer : Buyer
-
the buyer
setBuyerEmail()
Sets buyerEmail
public
setBuyerEmail(string $buyerEmail) : void
Buyer's email address. If provided during invoice creation, this will bypass the email prompt for the consumer when opening the invoice.
Parameters
- $buyerEmail : string
-
Buyer's email address
setBuyerProvidedEmail()
Sets buyerProvidedEmail
public
setBuyerProvidedEmail(string $buyerProvidedEmail) : void
Populated with the buyer's email address if passed in the buyer object by the merchant, otherwise this field is not returned for newly created invoices. If the merchant does not pass the buyer email in the invoice request, the bitpay invoice UI will prompt the user to enter his email address and this field will be populated with the email submitted.
Parameters
- $buyerProvidedEmail : string
-
Populated with the buyer's email address if passed in the buyer object by the merchant
setBuyerProvidedInfo()
Sets buyerProvidedEmail
public
setBuyerProvidedInfo(BuyerProvidedInfo $buyerProvidedInfo) : mixed
Information collected from the buyer during the process of paying an invoice. Initially this object is empty.
Parameters
- $buyerProvidedInfo : BuyerProvidedInfo
-
Information collected from the buyer during the process of paying an invoice
setBuyerSms()
Sets buyerSms
public
setBuyerSms(string $buyerSms) : void
SMS provided by user for communications. This is only used for instances where a buyers email (primary form of buyer communication) is can not be gathered.
Parameters
- $buyerSms : string
-
SMS provided by user for communication
setCloseURL()
Gets closeURL
public
setCloseURL(string $closeURL) : void
URL to redirect if the shopper does not pay the invoice and click on the Close button instead. Be sure to include "http://" or "https://" in the url.
Parameters
- $closeURL : string
-
URL to redirect if the shopper does not pay the invoice
setCurrency()
Sets currency
public
setCurrency(string $currency) : void
ISO 4217 3-character currency code. This is the currency associated with the price field, supported currencies are available via the Currencies resource
Parameters
- $currency : string
-
3-character currency code
Tags
setCurrentTime()
Sets currentTime - UNIX time of API call, in milliseconds
public
setCurrentTime(int|null $currentTime) : void
Parameters
- $currentTime : int|null
-
UNIX time of API call, in milliseconds
setDisplayAmountPaid()
Sets displayAmountPaid
public
setDisplayAmountPaid(string $displayAmountPaid) : void
Initially set to "0" when creating the invoice. It will be updated with the total amount paid to the invoice indicated in the base unit for the corresponding transactionCurrency
Parameters
- $displayAmountPaid : string
-
display amount paid
setExceptionStatus()
Sets exceptionStatus
public
setExceptionStatus(string|null $exceptionStatus) : void
Initially a boolean false, this parameter will indicate if the purchaser sent too much ("paidOver") or not enough funds ("paidPartial") in the transaction to pay the BitPay invoice. Possible values are: "false": default value (boolean) unless an exception is triggered. "paidPartial": (string) if the consumer did not send enough funds when paying the invoice. "paidOver": (string) if the consumer sent to much funds when paying the invoice.
Parameters
- $exceptionStatus : string|null
-
parameter will indicate if the purchaser sent too much or not enough funds
setExchangeRates()
Sets exchangeRates
public
setExchangeRates(array<string|int, mixed>|null $exchangeRates) : void
Exchange rates keyed by source and target currencies.
Parameters
- $exchangeRates : array<string|int, mixed>|null
-
Exchange rates keyed by source and target currencies.
setExpirationTime()
Sets expirationTime - UNIX time when invoice is last available to be paid, in milliseconds
public
setExpirationTime(int|null $expirationTime) : void
Parameters
- $expirationTime : int|null
-
UNIX time when invoice is last available to be paid, in milliseconds
setExtendedNotifications()
Sets extendedNotifications
public
setExtendedNotifications(bool $extendedNotifications) : void
Allows merchants to get access to additional webhooks. For instance when an invoice expires without receiving a payment or when it is refunded. If set to true, then fullNotifications is automatically set to true. When using the extendedNotifications parameter, the webhook also have a payload slightly different from the standard webhooks.
Parameters
- $extendedNotifications : bool
-
Allows merchants to get access to additional webhooks
setForcedBuyerSelectedTransactionCurrency()
Sets forcedBuyerSelectedWallet
public
setForcedBuyerSelectedTransactionCurrency(string $forcedBuyerSelectedTransactionCurrency) : mixed
Merchant pre-selects transaction currency on behalf of buyer.
Parameters
- $forcedBuyerSelectedTransactionCurrency : string
-
Merchant pre-selects transaction currency
setForcedBuyerSelectedWallet()
Sets forcedBuyerSelectedWallet
public
setForcedBuyerSelectedWallet(string $forcedBuyerSelectedWallet) : mixed
Merchant pre-selects transaction currency on behalf of buyer.
Parameters
- $forcedBuyerSelectedWallet : string
-
Merchant pre-selects wallet on behalf of buyer
setFullNotifications()
Sets fullNotifications
public
setFullNotifications(bool $fullNotifications) : void
This parameter is set to true by default, meaning all standard notifications are being sent for a payment made to an invoice. If you decide to set it to false instead, only 1 webhook will be sent for each invoice paid by the consumer. This webhook will be for the "confirmed" or "complete" invoice status, depending on the transactionSpeed selected.
Parameters
- $fullNotifications : bool
-
the full notification
setGuid()
Sets guid
public
setGuid(string $guid) : void
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, which can be used as a lookup variable in Retrieve Invoice by GUID.
Parameters
- $guid : string
-
The guid of the refund request being retrieved
setId()
Sets invoice resource id
public
setId(string $id) : void
Parameters
- $id : string
-
Invoice resource id
setInvoiceTime()
Sets invoiceTime - UNIX time of invoice creation, in milliseconds
public
setInvoiceTime(int $invoiceTime) : mixed
Parameters
- $invoiceTime : int
-
UNIX time of invoice creation, in milliseconds
setIsCancelled()
Sets isCancelled
public
setIsCancelled(bool $isCancelled) : void
Indicates whether or not the invoice was cancelled.
Parameters
- $isCancelled : bool
-
Indicates whether or not the invoice was cancelled.
setItemCode()
Sets itemCode
public
setItemCode(string $itemCode) : void
"bitcoindonation" for donations, otherwise do not include the field in the request.
Parameters
- $itemCode : string
-
"bitcoindonation" for donations, otherwise do not include the field in the request.
setItemDesc()
Sets itemDesc
public
setItemDesc(string $itemDesc) : void
Invoice description - will be added as a line item on the BitPay checkout page, under the merchant name.
Parameters
- $itemDesc : string
-
Invoice description
setItemizedDetails()
Sets itemizedDetails
public
setItemizedDetails(array<string|int, ItemizedDetails> $itemizedDetails) : void
Object containing line item details for display.
Parameters
- $itemizedDetails : array<string|int, ItemizedDetails>
Tags
setJsonPayProRequired()
Sets jsonPayProRequired
public
setJsonPayProRequired(bool $jsonPayProRequired) : void
Boolean set to false by default. If set to true, this means that the invoice will only accept payments from wallets which have implemented the BitPay JSON Payment Protocol
Parameters
- $jsonPayProRequired : bool
-
the json pay pro required
setLowFeeDetected()
Sets lowFeeDetected
public
setLowFeeDetected(bool $lowFeeDetected) : mixed
Flag to indicate if the miner fee used by the buyer is too low. Initially set to false when the invoice is created.
Parameters
- $lowFeeDetected : bool
-
Flag to indicate if the miner fee used by the buyer is too low
setMerchantName()
Sets merchantName
public
setMerchantName(string $merchantName) : void
A display string for merchant identification (ex. Wal-Mart Store #1452, Bowling Green, KY).
Parameters
- $merchantName : string
-
A display string for merchant identification
setMinerFees()
Sets minerFees
public
setMinerFees(MinerFees $minerFees) : void
The total amount of fees that the purchaser will pay to cover BitPay's UTXO sweep cost for an invoice. The key is the currency and the value is an object containing the satoshis per byte, the total fee, and the fiat amount. This is referenced as "Network Cost" on an invoice, see this support article for more information
Parameters
- $minerFees : MinerFees
-
The total amount of fees that the purchaser will pay to cover BitPay's UTXO sweep cost for an invoice
setNonPayProPaymentReceived()
Sets nonPayProPaymentReceived
public
setNonPayProPaymentReceived(bool $nonPayProPaymentReceived) : void
This boolean will be available on an invoice object once an invoice is paid and indicate if the transaction was made with a wallet using the payment protocol (true) or peer to peer (false).
Parameters
- $nonPayProPaymentReceived : bool
-
transaction was made with a wallet using the payment protocol
setNotificationEmail()
Sets NotificationEmail
public
setNotificationEmail(string $notificationEmail) : void
Merchant email address for notification of payout status change.
Parameters
- $notificationEmail : string
-
Merchant email address for notification of payout status change
setNotificationURL()
Sets notificationURL
public
setNotificationURL(string $notificationURL) : void
Parameters
- $notificationURL : string
-
- URL to which BitPay sends webhook notifications. HTTPS is mandatory.
setOrderId()
Sets orderId
public
setOrderId(string $orderId) : void
Can be used by the merchant to assign their own internal Id to an invoice. If used, there should be a direct match between an orderId and an invoice id.
Parameters
- $orderId : string
-
Invoice order id
setOverpaidAmount()
Sets overpaidAmount
public
setOverpaidAmount(float|null $overpaidAmount) : void
This parameter will be returned on the invoice object if the invoice was overpaid ("exceptionStatus": "paidOver"). It equals to the absolute difference between amountPaid and paymentTotals for the corresponding transactionCurrency used.
Parameters
- $overpaidAmount : float|null
-
the overpaid amount
setPaymentCodes()
Sets paymentCodes
public
setPaymentCodes(array<string|int, mixed>|null $paymentCodes) : mixed
The URIs for sending a transaction to the invoice. The first key is the transaction currency. The transaction currency maps to an object containing the payment URIs. The key of this object is the BIP number and the value is the payment URI. For "BTC", "BCH" and "DOGE" - BIP72b and BIP73 are supported. For "ETH", "GUSD", "PAX", "BUSD", "USDC", "DAI" and "WBTC"- EIP681 is supported For "XRP" - RIP681, BIP72b and BIP73 is supported
Parameters
- $paymentCodes : array<string|int, mixed>|null
setPaymentCurrencies()
Sets paymentCurrencies
public
setPaymentCurrencies(array<string|int, mixed> $paymentCurrencies) : void
Allow the merchant to select the cryptocurrencies available as payment option on the BitPay invoice. Possible values are currently "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC". For instance "paymentCurrencies": ["BTC"] will create an invoice with only XRP available as transaction currency, thus bypassing the currency selection step on the invoice.
Parameters
- $paymentCurrencies : array<string|int, mixed>
-
the payment currencies
setPaymentDisplaySubTotals()
Sets paymentDisplaySubtotals
public
setPaymentDisplaySubTotals(array<string|int, mixed>|null $paymentDisplaySubTotals) : mixed
Equivalent to price for each supported transactionCurrency, excluding minerFees. The key is the currency and the value is an amount indicated in the base unit for each supported transactionCurrency.
Parameters
- $paymentDisplaySubTotals : array<string|int, mixed>|null
-
Equivalent to price for each supported transactionCurrency
setPaymentDisplayTotals()
Sets paymentDisplayTotals
public
setPaymentDisplayTotals(array<string|int, mixed>|null $paymentDisplayTotals) : mixed
The total amount that the purchaser should pay as displayed on the invoice UI. This is like paymentDisplaySubTotals but with the minerFees included. The key is the currency and the value is an amount indicated in the base unit for each supported transactionCurrency.
Parameters
- $paymentDisplayTotals : array<string|int, mixed>|null
-
The total amount that the purchaser should pay
setPaymentSubtotals()
Sets paymentSubtotals
public
setPaymentSubtotals(array<string|int, mixed>|null $paymentSubtotals) : mixed
For internal use. This field can be ignored in merchant implementations.
Parameters
- $paymentSubtotals : array<string|int, mixed>|null
-
the payment subtotals
setPaymentTotals()
Sets paymentTotals
public
setPaymentTotals(array<string|int, mixed>|null $paymentTotals) : mixed
For internal use - This field can be ignored in merchant implementations.
Parameters
- $paymentTotals : array<string|int, mixed>|null
-
the payment totals
setPhysical()
Sets physical.
public
setPhysical(bool $physical) : void
Indicates whether items are physical goods. Alternatives include digital goods and services.
Parameters
- $physical : bool
-
the physical
setPosData()
Sets posData
public
setPosData(string $posData) : void
A passthru variable provided by the merchant during invoice creation and designed to be used by the merchant to correlate the invoice with an order or other object in their system. This passthru variable can be a serialized object.
Parameters
- $posData : string
-
the pos data
setPrice()
Sets price
public
setPrice(float $price) : void
Fixed price amount for the checkout, in the "currency" of the invoice object.
Parameters
- $price : float
-
Fixed price amount for the checkout, in the "currency" of the invoice object.
setRedirectURL()
Sets RedirectURL
public
setRedirectURL(string $redirectURL) : void
The shopper will be redirected to this URL when clicking on the Return button after a successful payment or when clicking on the Close button if a separate closeURL is not specified. Be sure to include "http://" or "https://" in the url.
Parameters
- $redirectURL : string
-
The shopper will be redirected to this URL
setRefundAddresses()
Sets refundAddresses
public
setRefundAddresses(array<string|int, mixed> $refundAddresses) : void
Initially empty when the invoice is created. This field will be populated with the refund address provided by the customer if you request a refund of the specific invoice.
Parameters
- $refundAddresses : array<string|int, mixed>
setRefundAddressRequestPending()
Sets refundAddressRequestPending
public
setRefundAddressRequestPending(bool $refundAddressRequestPending) : void
Initially set to false when the invoice is created, this field will be set to true once a refund request has been issued by the merchant. This flag is here to indicate that the refund request is pending action from the buyer to provide an address for the refund, via the secure link which has been automatically emailed to him.
Parameters
- $refundAddressRequestPending : bool
-
This flag is here to indicate that the refund request is pending action
setRefundInfo()
Sets refundInfo
public
setRefundInfo(RefundInfo $refundInfo) : void
For a refunded invoice, this object will contain the details of executed refunds for the corresponding invoice.
Parameters
- $refundInfo : RefundInfo
setSelectedTransactionCurrency()
Sets selectedTransactionCurrency
public
setSelectedTransactionCurrency(string $selectedTransactionCurrency) : void
This field will be populated with the cryptocurrency selected to pay the BitPay invoice, current supported values are "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC". If not yet selected, this field will not be returned.
Parameters
- $selectedTransactionCurrency : string
-
This field will be populated with the cryptocurrency selected to pay the BitPay invoice
setShopper()
Sets shopper
public
setShopper(Shopper $shopper) : mixed
This object will be available on the invoice if a shopper signs in on an invoice using his BitPay ID.
Parameters
- $shopper : Shopper
-
the shopper
Tags
setStatus()
Sets status
public
setStatus(string $status) : void
Detailed information about invoice status notifications can be found under the Instant Payment Notification (IPN) section. Use values from InvoiceStatus const.
Parameters
- $status : string
-
InvoiceStatus const value
setSupportedTransactionCurrencies()
Sets supportedTransactionCurrencies
public
setSupportedTransactionCurrencies(SupportedTransactionCurrencies $supportedTransactionCurrencies) : void
The currencies that may be used to pay this invoice. The object is keyed by currency code. The values are objects with an "enabled" boolean and option. An extra "reason" parameter is added in the object if a cryptocurrency is disabled on a specific invoice. If you disable a currency via the invoice parameter "paymentCurrencies", this parameter will be set to "merchantDisabledByParam"
Parameters
- $supportedTransactionCurrencies : SupportedTransactionCurrencies
-
The currencies that may be used to pay this invoice
setTargetConfirmations()
Sets targetConfirmations
public
setTargetConfirmations(int $targetConfirmations) : void
Indicates the number of block confirmation of the crypto currency transaction which are required to credit a paid invoice to the merchant account. Currently, the value set is set to 6 by default for BTC/BCH/XRP, 40 for DOGE and 50 for ETH/GUSD/PAX/USDC/BUSD/DAI/WBTC c
Parameters
- $targetConfirmations : int
-
Indicates the number of block confirmation of the crypto currency transaction which are required to credit a paid invoice to the merchant account
setToken()
Sets token
public
setToken(string $token) : void
Invoice resource token. This token is derived from the API token initially used to create the invoice and is tied to the specific resource id created.
Parameters
- $token : string
-
Invoice resource token
setTransactionCurrency()
Sets transactionCurrency
public
setTransactionCurrency(string $transactionCurrency) : void
The cryptocurrency used to pay the invoice. This field will only be available after a transaction is applied to the invoice. Possible values are currently "BTC", "BCH", "ETH", "GUSD", "PAX", "BUSD", "USDC", "XRP", "DOGE", "DAI" and "WBTC".
Parameters
- $transactionCurrency : string
-
The currency used for the invoice transaction.
setTransactions()
Sets transactions
public
setTransactions(array<string|int, mixed> $transactions) : void
Contains the cryptocurrency transaction details for the executed payout.
Parameters
- $transactions : array<string|int, mixed>
-
array with the crypto currency transaction hashes linked to the invoice
setTransactionSpeed()
Sets transactionSpeed.
public
setTransactionSpeed(string $transactionSpeed) : void
This is a risk mitigation parameter for the merchant to configure how they want to fulfill orders depending on the number of block confirmations for the transaction made by the consumer on the selected cryptocurrency. If not set on the invoice, transactionSpeed will default to the account-level Order Settings. Note : orders are only credited to your BitPay Account Summary for settlement after the invoice reaches the status "complete" (regardless of this setting).
Parameters
- $transactionSpeed : string
-
the transaction speed
setUnderpaidAmount()
Sets underpaidAmount
public
setUnderpaidAmount(float|null $underpaidAmount) : void
This parameter will be returned on the invoice object if the invoice was underpaid ("exceptionStatus": "paidPartial"). It equals to the absolute difference between amountPaid and paymentTotals for the corresponding transactionCurrency used.
Parameters
- $underpaidAmount : float|null
-
the underpaid amount
setUniversalCodes()
Sets universalCodes
public
setUniversalCodes(UniversalCodes $universalCodes) : mixed
Parameters
- $universalCodes : UniversalCodes
-
Object containing wallet-specific URLs for payment protocol.
setUrl()
Sets url
public
setUrl(string $url) : void
Web address of invoice, expires at expirationTime
Parameters
- $url : string
-
Web address of invoice
toArray()
Returns the Invoice object as array
public
toArray() : array<string|int, mixed>