From 094825ee20f66aace68fd7e5051575ea07cb6860 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Mon, 13 Mar 2023 21:33:43 +0100 Subject: [PATCH] lnbits paid articles added --- app/Http/Livewire/News/InternArticleView.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Livewire/News/InternArticleView.php b/app/Http/Livewire/News/InternArticleView.php index 87eb35db..93a13c0d 100644 --- a/app/Http/Livewire/News/InternArticleView.php +++ b/app/Http/Livewire/News/InternArticleView.php @@ -5,6 +5,7 @@ namespace App\Http\Livewire\News; use App\Models\LibraryItem; use App\Traits\LNBitsTrait; use Carbon\Carbon; +use Illuminate\Support\Facades\Log; use Livewire\Component; use RalphJSmit\Laravel\SEO\Support\SEOData; use SimpleSoftwareIO\QrCode\Facades\QrCode; @@ -71,12 +72,14 @@ class InternArticleView extends Component public function checkPaymentHash() { $invoice = $this->check($this->checkid ?? $this->checkThisPaymentHash); - if ($invoice['paid']) { + if (isset($invoice['paid']) && $invoice['paid']) { $this->invoicePaid = true; auth() ->user() ->paidArticles() ->syncWithoutDetaching($this->libraryItem->id); + } else { + Log::error(json_encode($invoice, JSON_THROW_ON_ERROR)); } }