Skip to content

Commit

Permalink
Fix for invoices without expiry tag
Browse files Browse the repository at this point in the history
Signed-off-by: Djuri Baars <[email protected]>
  • Loading branch information
dsbaars committed Dec 6, 2024
1 parent ecfe3dd commit 0ae82ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Encoder/PaymentRequestDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,13 @@ public function decode(string $paymentRequest): array
$timeExpireDate = $timeExpireDateString = null;
if ($this->tagsContainItem($tags, $this->tagNames[6])) {
$timeExpireDate = $timestamp + $this->tagsItems($tags, $this->tagNames[6]);
$timeExpireDateString = date(\DateTime::ATOM, $timeExpireDate);
} else {
// Default is 3600 (1 hour) if not specified.
$timeExpireDate = $timestamp + 3600;
}

$timeExpireDateString = date(\DateTime::ATOM, $timeExpireDate);

$toSign = Buffertools::concat(
new Buffer($prefix),
$this->wordsToBuffer($wordsWithoutSignature, false),
Expand Down

0 comments on commit 0ae82ed

Please sign in to comment.