feat: enhance payment confirmation handling in ZapModal
- Added conditional rendering for payment confirmation messages based on the presence of a verify URL. - Introduced a manual confirmation button for providers that do not send automatic confirmations, improving user interaction. - Implemented a new function, markAsPaid, to handle user confirmations and trigger success state for zaps to direct Lightning addresses. These changes enhance the user experience by providing clearer instructions and feedback during the payment process.
This commit is contained in:
@@ -139,9 +139,22 @@
|
||||
Open in wallet app
|
||||
</a>
|
||||
|
||||
<p class="text-xs text-white/40 animate-pulse">
|
||||
<!-- When provider gives a verify URL we poll; otherwise user confirms manually -->
|
||||
<p v-if="verifyUrl" class="text-xs text-white/40 animate-pulse">
|
||||
Waiting for payment confirmation...
|
||||
</p>
|
||||
<template v-else>
|
||||
<p class="text-xs text-white/40 mb-3">
|
||||
This provider doesn't send confirmation. After you pay, tap below.
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
@click="markAsPaid"
|
||||
class="zap-pay-button w-full flex items-center justify-center"
|
||||
>
|
||||
I've sent the payment
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -409,6 +422,15 @@ function showSuccess() {
|
||||
emit('zapped', zapAmount.value || 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user confirms they've paid and we have no verify URL to poll.
|
||||
* Shows the success state so zaps to direct Lightning addresses still get the celebration.
|
||||
*/
|
||||
function markAsPaid() {
|
||||
cleanup()
|
||||
showSuccess()
|
||||
}
|
||||
|
||||
async function handleZap() {
|
||||
if (!zapAmount.value || zapAmount.value < 1) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user