Skip to content

Commit

Permalink
Added Missing Invoice Getter Methods (#72)
Browse files Browse the repository at this point in the history
* Added Missing Invoice Getter Methods
  • Loading branch information
utxo-one authored Sep 12, 2022
1 parent 3e39b11 commit cc9ab93
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/Result/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace BTCPayServer\Result;

use BTCPayServer\Util\PreciseNumber;

class Invoice extends AbstractResult
{
public const STATUS_NEW = 'New';
Expand All @@ -24,6 +26,51 @@ class Invoice extends AbstractResult

public const ADDITIONAL_STATUS_PAID_LATE = 'PaidLate';

public function getId(): string
{
return $this->getData()['id'];
}

public function getAmount(): PreciseNumber
{
return PreciseNumber::parseString($this->getData()['amount']);
}

public function getCurrency(): string
{
return $this->getData()['currency'];
}

public function getType(): string
{
return $this->getData()['type'];
}

public function getCheckoutLink(): string
{
return $this->getData()['checkoutLink'];
}

public function getCreatedTime(): int
{
return $this->getData()['createdTime'];
}

public function getExpirationTime(): int
{
return $this->getData()['expirationTime'];
}

public function getMonitoringTime(): int
{
return $this->getData()['monitoringTime'];
}

public function isArchived(): bool
{
return $this->getData()['archived'];
}

public function isPaid(): bool
{
$data = $this->getData();
Expand Down

0 comments on commit cc9ab93

Please sign in to comment.