lnbits paid articles added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-13 21:30:46 +01:00
parent ca0a0dab69
commit 02d2fcce06
2 changed files with 3 additions and 4 deletions

View File

@@ -45,7 +45,8 @@ class InternArticleView extends Component
{ {
$invoice = $this->createInvoice( $invoice = $this->createInvoice(
sats: $this->libraryItem->sats, 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']); session('payment_hash_article_'.$this->libraryItem->id, $invoice['payment_hash']);
$this->paymentHash = $invoice['payment_hash']; $this->paymentHash = $invoice['payment_hash'];

View File

@@ -16,10 +16,8 @@ trait LNBitsTrait
return $response->status() === 200; return $response->status() === 200;
} }
public function createInvoice($sats, $memo) public function createInvoice($sats, $memo, $lnbits)
{ {
$lnbits = auth()->user()->lnbits;
$response = Http::withHeaders([ $response = Http::withHeaders([
'X-Api-Key' => $lnbits['read_key'], 'X-Api-Key' => $lnbits['read_key'],
]) ])