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 => {
|
||||
console.log('Payment response:', response);
|
||||
this.$wire.call('logThis', 'Payment response: ' + JSON.stringify(response));
|
||||
this.$wire.call('reloadMe');
|
||||
this.$wire.call('success', response.preimage);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Payment failed:', error);
|
||||
|
||||
@@ -5,11 +5,24 @@
|
||||
<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 class="mt-6">
|
||||
<div class="flex justify-center">
|
||||
<button x-on:click="pay" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Pay Invoice
|
||||
</button>
|
||||
</div>
|
||||
@if(!$paymentDone)
|
||||
<div class="flex justify-center">
|
||||
<button x-on:click="pay"
|
||||
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Pay Invoice
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex justify-center">
|
||||
<div class="text-green-500">
|
||||
Success! Payment done.
|
||||
</div>
|
||||
<button wire:click="reloadMe"
|
||||
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
|
||||
Reload
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user