mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
feat: add successful payment response handling
This commit is contained in:
@@ -10,7 +10,7 @@ export default (livewireComponent) => ({
|
|||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('Payment response:', response);
|
console.log('Payment response:', response);
|
||||||
this.$wire.call('logThis', 'Payment response: ' + JSON.stringify(response));
|
this.$wire.call('logThis', 'Payment response: ' + JSON.stringify(response));
|
||||||
this.$wire.call('success', response.preimage);
|
this.$wire.call('success');
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('Payment failed:', error);
|
console.error('Payment failed:', error);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
<div x-data="webln(@this)" class="p-2 sm:p-4" wire:ignore>
|
<div x-data="webln(@this)" class="p-2 sm:p-4">
|
||||||
<div class="font-mono space-y-1 p-2 sm:p-4 text-white break-words">
|
<div class="font-mono space-y-1 p-2 sm:p-4 text-white break-words">
|
||||||
<div class="text-xs sm:text-base break-words">Test Payment from WebLN to "The Ben"</div>
|
<div wire:ignore>
|
||||||
<div class="text-xs sm:text-base break-words">1 sat</div>
|
<div class="text-xs sm:text-base break-words">Test Payment from WebLN to "The Ben"</div>
|
||||||
<div class="text-xs sm:text-base break-words">hash: {{ $invoice['payment_hash'] }}</div>
|
<div class="text-xs sm:text-base break-words">1 sat</div>
|
||||||
<div class="text-xs sm:text-base break-words">payment_request: {{ $invoice['payment_request'] }}</div>
|
<div class="text-xs sm:text-base break-words">hash: {{ $invoice['payment_hash'] }}</div>
|
||||||
|
<div class="text-xs sm:text-base break-words">payment_request: {{ $invoice['payment_request'] }}</div>
|
||||||
|
</div>
|
||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
@if(!$paymentDone)
|
@if(!$paymentDone)
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center" wire:loading.attr="disabled">
|
||||||
<button x-on:click="pay"
|
<button x-on:click="pay"
|
||||||
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||||
Pay Invoice
|
Pay Invoice
|
||||||
@@ -17,7 +19,7 @@
|
|||||||
<div class="text-green-500">
|
<div class="text-green-500">
|
||||||
Success! Payment done.
|
Success! Payment done.
|
||||||
</div>
|
</div>
|
||||||
<button wire:click="reloadMe"
|
<button wire:click="reloadMe" wire:loading.attr="disabled"
|
||||||
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||||
Reload
|
Reload
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user