mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
feat(payment): add WebLN payment functionality
Implemented functionality to create an invoice and make payment using WebLN. Also added error handling and logging for payment process. Updated UI to display payment information and a button to initiate payment.
This commit is contained in:
@@ -2,11 +2,34 @@
|
||||
|
||||
namespace App\Http\Livewire\Test;
|
||||
|
||||
use App\Traits\LNBitsTrait;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Livewire\Component;
|
||||
|
||||
class WebLN extends Component
|
||||
{
|
||||
use LNBitsTrait;
|
||||
|
||||
public $invoice;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->invoice = $this->createInvoice(
|
||||
sats: 1,
|
||||
memo: 'Test Payment from WebLN',
|
||||
lnbits: [
|
||||
'read_key' => '97f6120563e3498b8be4c67023c912ae',
|
||||
'url' => 'https://bits.codingarena.top',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function reloadMe()
|
||||
{
|
||||
// full reload current page
|
||||
return redirect()->route('webln');
|
||||
}
|
||||
|
||||
public function logThis($text)
|
||||
{
|
||||
Log::info('WEBLN: ' . $text);
|
||||
|
||||
Reference in New Issue
Block a user