!open && handleClose()}> Make a Payment {#if booking.id}
Booking ID: {booking.id}
{/if}
{#if status === 'idle' || status === 'processing' || status === 'error'}
{#if booking.status === 'pending_release' && lockAcquired && lockTimer > 0}
Slot re-secured for {formatTimer(lockTimer)} to ensure smooth payment processing
{:else if booking.status === 'pending_release' && (lockTimer === 0 || !lockAcquired)}
Slot no longer secured — please close and retry
{/if}
Services
{#each booking.services ?? [] as service, index (index)}
{service.service_name || 'Unknown Service'} {service.override_price ? formatCurrency(Math.round(service.override_price * 100)) : service.price ? formatCurrency(Math.round(service.price * 100)) : '-'}
{/each}
{#if loyaltyEligible}
Available Savings
{/if} {#if booking.discounts && booking.discounts.length > 0}
Applied Discounts
{#if servicesSubtotal > 0} {((discountSum / servicesSubtotal) * 100).toFixed(0)}% Off Total {/if}
{#each booking.discounts as d}
{#if d.discount_source === 'loyalty'} Loyalty Stamp Card (10% Off) {:else if d.campaign_name} {d.campaign_name} {:else} Promo Campaign ({d.discount_percent}% Off) {/if}
-{formatCurrency(d.discount_amount)}
{/each}
{/if}
Total {formatCurrency(Math.round(booking.total_amount * 100))}
{#if discountPreview?.eligible} {#each discountPreview.discounts as d}
{d.name} -{formatCurrency(Math.round(d.amount * 100))}
{/each} {/if}
Amount Paid {formatCurrency(totalPaid)}
{#if useLoyalty && loyaltyDiscount > 0}
Loyalty Stamp Card (10% Off) -{formatCurrency(loyaltyDiscount)}
{/if}
Amount Remaining {formatCurrency(Math.max(0, Math.round(amountRemaining * 100) - campaignDiscountCents() - loyaltyDiscount))}
{#if status === 'idle' && authStore.isAuthenticated} {#if paymentMethodsLoading}
Loading payment methods...
{:else if paymentMethods.length > 0 && !showNewCardForm}
{#if selectedPaymentMethod} {#each paymentMethods as method (method.id)} {#if method.id === selectedPaymentMethod}
{method.brand}
**** {method.last_4} {formatCardExpiry(method.exp_month, method.exp_year)}
Selected
{/if} {/each} {/if} {#if canSaveCards} {/if} {#if showCardList}
{#if canSaveCards} {/if} {#each paymentMethods as method (method.id)} {/each}
{/if}
{:else} {/if} {/if} {#if depositPolicyWarning}

Cancellation & Deposit Policy

{depositPolicyWarning}

{#snippet trigger()} Full cancellation policy → {/snippet}
{/if} {#if isScenarioA}
{#if payButtonError}

{payButtonError}

{/if}
{/if} {#if isScenarioB}
{#if paymentType === 'partial'}
£
{/if} {#if payButtonError}

{payButtonError}

{/if}
{/if} {#if status === 'error' && error}

{error}

{/if}
{:else if status === 'polling'}

Processing payment...

This may take a few moments

{:else if status === 'success' && paymentResult}

Payment Successful

Amount {formatCurrency(paymentResult.amount)}
Type {paymentResult.payment_type}
{#if paymentResult.card_brand}
Card {paymentResult.card_brand} ****{paymentResult.card_last4}
{/if}
Status Completed
{/if}