Skip to content

Commit

Permalink
Update to "balance" API request
Browse files Browse the repository at this point in the history
Balance update
  • Loading branch information
svdigital-development authored May 20, 2024
2 parents b18a53e + f46b6d4 commit 37275e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Models/Balance.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

class Balance extends GenericModel {
/**
* @var string
* @var string|null
*/
private $Currency;

/**
* @var float
* @var float|null
*/
private $AvailableBalance;

/**
* @var float
* @var float|null
*/
private $AccountingBalance;

/**
* @var float
* @var float|null
*/
private $CreditLine;

Expand All @@ -34,10 +34,10 @@ class Balance extends GenericModel {
protected function hydrateData( stdClass $data ) {
$payload = $data->payload;

$this->Currency = (string)$payload->currency;
$this->AvailableBalance = (float)$payload->availableBalance;
$this->AccountingBalance = (float)$payload->accountingBalance;
$this->CreditLine = (float)$payload->creditLine;
$this->Currency = ( !isset( $payload->currency ) or empty( $payload->currency ) ) ? null : (string)$payload->currency;
$this->AvailableBalance = ( !isset( $payload->availableBalance ) or is_null( $payload->availableBalance ) ) ? null : (float)$payload->availableBalance;
$this->AccountingBalance = ( !isset( $payload->accountingBalance ) or is_null( $payload->accountingBalance ) ) ? null : (float)$payload->accountingBalance;
$this->CreditLine = ( !isset( $payload->creditLine ) or is_null( $payload->creditLine ) ) ? null : (float)$payload->creditLine;
}


Expand Down

0 comments on commit 37275e7

Please sign in to comment.