From 02d2fcce065c8307729babe2b06c1209529f61b7 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Mon, 13 Mar 2023 21:30:46 +0100 Subject: [PATCH] lnbits paid articles added --- app/Http/Livewire/News/InternArticleView.php | 3 ++- app/Traits/LNBitsTrait.php | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Livewire/News/InternArticleView.php b/app/Http/Livewire/News/InternArticleView.php index 782660a7..87eb35db 100644 --- a/app/Http/Livewire/News/InternArticleView.php +++ b/app/Http/Livewire/News/InternArticleView.php @@ -45,7 +45,8 @@ class InternArticleView extends Component { $invoice = $this->createInvoice( sats: $this->libraryItem->sats, - memo: 'Payment for: "'.$this->libraryItem->slug.'" on Einundzwanzig Portal.' + memo: 'Payment for: "'.$this->libraryItem->slug.'" on Einundzwanzig Portal.', + lnbits: $this->libraryItem->createdBy->lnbits, ); session('payment_hash_article_'.$this->libraryItem->id, $invoice['payment_hash']); $this->paymentHash = $invoice['payment_hash']; diff --git a/app/Traits/LNBitsTrait.php b/app/Traits/LNBitsTrait.php index 96eae941..2b2a0e40 100644 --- a/app/Traits/LNBitsTrait.php +++ b/app/Traits/LNBitsTrait.php @@ -16,10 +16,8 @@ trait LNBitsTrait return $response->status() === 200; } - public function createInvoice($sats, $memo) + public function createInvoice($sats, $memo, $lnbits) { - $lnbits = auth()->user()->lnbits; - $response = Http::withHeaders([ 'X-Api-Key' => $lnbits['read_key'], ])