From 603c7d85b9023a98a1f66e6b20452b98ce8ff89d Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Mon, 13 Mar 2023 21:38:12 +0100 Subject: [PATCH] lnbits paid articles added --- app/Http/Livewire/News/InternArticleView.php | 2 +- app/Traits/LNBitsTrait.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Http/Livewire/News/InternArticleView.php b/app/Http/Livewire/News/InternArticleView.php index 93a13c0d..c2c3b537 100644 --- a/app/Http/Livewire/News/InternArticleView.php +++ b/app/Http/Livewire/News/InternArticleView.php @@ -71,7 +71,7 @@ class InternArticleView extends Component public function checkPaymentHash() { - $invoice = $this->check($this->checkid ?? $this->checkThisPaymentHash); + $invoice = $this->check($this->checkid ?? $this->checkThisPaymentHash, $this->libraryItem->createdBy->lnbits); if (isset($invoice['paid']) && $invoice['paid']) { $this->invoicePaid = true; auth() diff --git a/app/Traits/LNBitsTrait.php b/app/Traits/LNBitsTrait.php index 2b2a0e40..22da8499 100644 --- a/app/Traits/LNBitsTrait.php +++ b/app/Traits/LNBitsTrait.php @@ -30,10 +30,8 @@ trait LNBitsTrait return $response->json(); } - public function check($paymentHash) + public function check($paymentHash, $lnbits) { - $lnbits = auth()->user()->lnbits; - $response = Http::withHeaders([ 'X-Api-Key' => $lnbits['read_key'], ])