mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
lnbits paid articles added
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Http\Livewire\News;
|
|||||||
use App\Models\LibraryItem;
|
use App\Models\LibraryItem;
|
||||||
use App\Traits\LNBitsTrait;
|
use App\Traits\LNBitsTrait;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||||
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
||||||
@@ -71,12 +72,14 @@ class InternArticleView extends Component
|
|||||||
public function checkPaymentHash()
|
public function checkPaymentHash()
|
||||||
{
|
{
|
||||||
$invoice = $this->check($this->checkid ?? $this->checkThisPaymentHash);
|
$invoice = $this->check($this->checkid ?? $this->checkThisPaymentHash);
|
||||||
if ($invoice['paid']) {
|
if (isset($invoice['paid']) && $invoice['paid']) {
|
||||||
$this->invoicePaid = true;
|
$this->invoicePaid = true;
|
||||||
auth()
|
auth()
|
||||||
->user()
|
->user()
|
||||||
->paidArticles()
|
->paidArticles()
|
||||||
->syncWithoutDetaching($this->libraryItem->id);
|
->syncWithoutDetaching($this->libraryItem->id);
|
||||||
|
} else {
|
||||||
|
Log::error(json_encode($invoice, JSON_THROW_ON_ERROR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user