BitPay PHP SDK

Settlement

Settlement data object.

Tags
author

BitPay Integrations integrations@bitpay.com

license

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

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

Settlements

Table of Contents

Properties

$accountId  : string|null
$closingDate  : string|null
$currency  : string|null
$dateCompleted  : string|null
$dateCreated  : string|null
$dateExecuted  : string|null
$id  : string|null
$ledgerEntries  : array<string|int, mixed>
$ledgerEntriesSum  : float|null
$openingBalance  : float|null
$openingDate  : string|null
$payoutInfo  : PayoutInfo|null
$status  : string|null
$token  : string|null
$totalAmount  : float|null
$withHoldings  : array<string|int, mixed>
$withHoldingsSum  : float|null

Methods

__construct()  : mixed
getAccountId()  : string|null
Gets account id
getClosingDate()  : string|null
Gets closing date.
getCurrency()  : string|null
Gets currency
getDateCompleted()  : string|null
Gets date completed
getDateCreated()  : string|null
Gets date created
getDateExecuted()  : string|null
Gets date executed
getId()  : string|null
Gets id
getLedgerEntries()  : array<string|int, SettlementLedgerEntry>
Gets Array of ledger entries listing the various debits and credits which are settled in the report.
getLedgerEntriesSum()  : float|null
Gets ledger entries sum.
getOpeningBalance()  : float|null
Gets Balance of the ledger at the openingDate
getOpeningDate()  : string|null
Gets opening date
getPayoutInfo()  : PayoutInfo|null
Gets Object containing the settlement info provided by the Merchant in his BitPay account settings
getStatus()  : string|null
Gets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".
getToken()  : string|null
Gets API token for the corresponding settlement resource.
getTotalAmount()  : float|null
Gets total amount sent to the merchant; 2 decimals.
getWithHoldings()  : array<string|int, WithHoldings>
Gets with holdings
getWithHoldingsSum()  : float|null
Gets Sum of all amounts that are withheld from settlement
setAccountId()  : void
Sets account id
setClosingDate()  : void
Sets closing date.
setCurrency()  : void
Sets currency
setDateCompleted()  : void
Sets date completed
setDateCreated()  : void
Sets date created
setDateExecuted()  : void
Sets date executed
setId()  : void
Sets id
setLedgerEntries()  : void
Sets Array of ledger entries listing the various debits and credits which are settled in the report.
setLedgerEntriesSum()  : void
Sets ledger entries sum.
setOpeningBalance()  : void
Sets Balance of the ledger at the openingDate
setOpeningDate()  : void
Sets opening date
setPayoutInfo()  : void
Sets Object containing the settlement info provided by the Merchant in his BitPay account settings
setStatus()  : void
Sets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".
setToken()  : void
Sets API token for the corresponding settlement resource.
setTotalAmount()  : void
Sets total amount sent to the merchant; 2 decimals.
setWithHoldings()  : void
Sets with holdings
setWithHoldingsSum()  : void
Sets Sum of all amounts that are withheld from settlement
toArray()  : array<string|int, mixed>
Returns the Settlement object as array

Properties

$accountId

protected string|null $accountId = null

$closingDate

protected string|null $closingDate = null

$currency

protected string|null $currency = null

$dateCompleted

protected string|null $dateCompleted = null

$dateCreated

protected string|null $dateCreated = null

$dateExecuted

protected string|null $dateExecuted = null

$ledgerEntries

protected array<string|int, mixed> $ledgerEntries = []

$ledgerEntriesSum

protected float|null $ledgerEntriesSum = null

$openingBalance

protected float|null $openingBalance = null

$openingDate

protected string|null $openingDate = null

$totalAmount

protected float|null $totalAmount = null

$withHoldings

protected array<string|int, mixed> $withHoldings = []

$withHoldingsSum

protected float|null $withHoldingsSum = null

Methods

getAccountId()

Gets account id

public getAccountId() : string|null

String identifying the BitPay merchant. For internal use, this field can be ignored in merchant implementations.

Return values
string|null

getClosingDate()

Gets closing date.

public getClosingDate() : string|null

Date & time for last ledger entry used for the settlement. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Return values
string|null

getCurrency()

Gets currency

public getCurrency() : string|null

ISO 4217 3-character currency code. This is the currency associated with the settlement. Supported settlement currencies are listed on https://bitpay.com/docs/settlement

Return values
string|null

getDateCompleted()

Gets date completed

public getDateCompleted() : string|null

Timestamp when the settlement was completed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Return values
string|null

getDateCreated()

Gets date created

public getDateCreated() : string|null

Timestamp when the settlement was created. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Return values
string|null

getDateExecuted()

Gets date executed

public getDateExecuted() : string|null

Timestamp when the settlement was executed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Return values
string|null

getId()

Gets id

public getId() : string|null

String identifying the settlement; this id will also be in the description of the corresponding bank settlement.

Return values
string|null

getLedgerEntries()

Gets Array of ledger entries listing the various debits and credits which are settled in the report.

public getLedgerEntries() : array<string|int, SettlementLedgerEntry>

The total sum of all ledger entries is reported in the field ledgerEntriesSum. A description of all ledger codes can be found

Return values
array<string|int, SettlementLedgerEntry>

getLedgerEntriesSum()

Gets ledger entries sum.

public getLedgerEntriesSum() : float|null

Sum of all ledger entries in the settlement, this means all the debits & credits which happened between openingDate and closingDate

Return values
float|null

getOpeningBalance()

Gets Balance of the ledger at the openingDate

public getOpeningBalance() : float|null
Return values
float|null

getOpeningDate()

Gets opening date

public getOpeningDate() : string|null

corresponds to the closingDate of the previous settlement executed. For the first settlement of an account the value will be the BitPay merchant account creation date. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Return values
string|null

getPayoutInfo()

Gets Object containing the settlement info provided by the Merchant in his BitPay account settings

public getPayoutInfo() : PayoutInfo|null
Return values
PayoutInfo|null

getStatus()

Gets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".

public getStatus() : string|null
Return values
string|null

getToken()

Gets API token for the corresponding settlement resource.

public getToken() : string|null

This token is actually derived from the merchant facade token used during the query. This token is required to fetch the reconciliation report

Return values
string|null

getTotalAmount()

Gets total amount sent to the merchant; 2 decimals.

public getTotalAmount() : float|null

totalAmount = openingBalance + ledgerEntriesSum - withholdingsSum

Return values
float|null

getWithHoldings()

Gets with holdings

public getWithHoldings() : array<string|int, WithHoldings>

Array of withholdings. Withholdings are kept on the ledger to be used later and thus withheld from this settlement. Each withholding is a JSON object containing a code, amount and description field.

Return values
array<string|int, WithHoldings>

getWithHoldingsSum()

Gets Sum of all amounts that are withheld from settlement

public getWithHoldingsSum() : float|null
Return values
float|null

setAccountId()

Sets account id

public setAccountId(string $accountId) : void

String identifying the BitPay merchant. For internal use, this field can be ignored in merchant implementations.

Parameters
$accountId : string

setClosingDate()

Sets closing date.

public setClosingDate(string $closingDate) : void

Date & time for last ledger entry used for the settlement. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Parameters
$closingDate : string

setCurrency()

Sets currency

public setCurrency(string $currency) : void

ISO 4217 3-character currency code. This is the currency associated with the settlement. Supported settlement currencies are listed on https://bitpay.com/docs/settlement

Parameters
$currency : string

setDateCompleted()

Sets date completed

public setDateCompleted(string $dateCompleted) : void

Timestamp when the settlement was completed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Parameters
$dateCompleted : string

setDateCreated()

Sets date created

public setDateCreated(string $dateCreated) : void

Timestamp when the settlement was created. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Parameters
$dateCreated : string

setDateExecuted()

Sets date executed

public setDateExecuted(string $dateExecuted) : void

Timestamp when the settlement was executed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Parameters
$dateExecuted : string

setId()

Sets id

public setId(string $id) : void

String identifying the settlement; this id will also be in the description of the corresponding bank settlement.

Parameters
$id : string

setLedgerEntries()

Sets Array of ledger entries listing the various debits and credits which are settled in the report.

public setLedgerEntries(array<string|int, SettlementLedgerEntry$ledgerEntries) : void

The total sum of all ledger entries is reported in the field ledgerEntriesSum. A description of all ledger codes can be found

Parameters
$ledgerEntries : array<string|int, SettlementLedgerEntry>
Tags
throws
SettlementException

setLedgerEntriesSum()

Sets ledger entries sum.

public setLedgerEntriesSum(float $ledgerEntriesSum) : void

Sum of all ledger entries in the settlement, this means all the debits & credits which happened between openingDate and closingDate

Parameters
$ledgerEntriesSum : float

setOpeningBalance()

Sets Balance of the ledger at the openingDate

public setOpeningBalance(float $openingBalance) : void
Parameters
$openingBalance : float

setOpeningDate()

Sets opening date

public setOpeningDate(string $openingDate) : void

corresponds to the closingDate of the previous settlement executed. For the first settlement of an account the value will be the BitPay merchant account creation date. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

Parameters
$openingDate : string

setPayoutInfo()

Sets Object containing the settlement info provided by the Merchant in his BitPay account settings

public setPayoutInfo(PayoutInfo $payoutInfo) : void
Parameters
$payoutInfo : PayoutInfo

setStatus()

Sets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".

public setStatus(string $status) : void
Parameters
$status : string

setToken()

Sets API token for the corresponding settlement resource.

public setToken(string $token) : void

This token is actually derived from the merchant facade token used during the query. This token is required to fetch the reconciliation report

Parameters
$token : string

setTotalAmount()

Sets total amount sent to the merchant; 2 decimals.

public setTotalAmount(float $totalAmount) : void

totalAmount = openingBalance + ledgerEntriesSum - withholdingsSum

Parameters
$totalAmount : float

setWithHoldings()

Sets with holdings

public setWithHoldings(array<string|int, WithHoldings$withHoldings) : void

Array of withholdings. Withholdings are kept on the ledger to be used later and thus withheld from this settlement. Each withholding is a JSON object containing a code, amount and description field.

Parameters
$withHoldings : array<string|int, WithHoldings>
Tags
throws
SettlementException

setWithHoldingsSum()

Sets Sum of all amounts that are withheld from settlement

public setWithHoldingsSum(float $withHoldingsSum) : void
Parameters
$withHoldingsSum : float

toArray()

Returns the Settlement object as array

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

        
On this page

Search results