diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index 4aee647..3c63f5e 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -13,7 +13,7 @@ - publicKey (string, optional) — unused by resumeTransaction; kept for callers - returnUrl (string, optional) — where to go after Inline onSuccess (?reference=) - Paystack checkout.paystack.com cannot be iframed (X-Frame-Options: SAMEORIGIN). + checkout.paystack.com cannot be iframed (X-Frame-Options: SAMEORIGIN). Primary path: Paystack Inline JS (PaystackPop.resumeTransaction) — in-page overlay, not a separate browser tab. Same-origin URLs (e.g. MoMo waiting) still use iframe. --}} @@ -44,7 +44,8 @@ @once @endonce +{{-- Keep Paystack checkout inside the Ladill sheet loading area. --}} +@once('ladill-paystack-contain-css') + +@endonce - { + const store = $store.ladillPayCheckout; + if (!store) return; store.sync( - showSheet, - typeof checkoutUrl !== 'undefined' ? checkoutUrl : '', - typeof accessCode !== 'undefined' ? accessCode : '', - typeof returnUrl !== 'undefined' ? returnUrl : '' + !!showSheet, + (typeof checkoutUrl === 'undefined' || checkoutUrl === null) ? '' : String(checkoutUrl), + (typeof accessCode === 'undefined' || accessCode === null) ? '' : String(accessCode), + (typeof returnUrl === 'undefined' || returnUrl === null) ? '' : String(returnUrl) ); - } - " - @keydown.escape.window="if (showSheet) showSheet = false" - @ladill-pay-cancelled.window="showSheet = false" - class="fixed inset-0 z-[9999] flex items-end justify-center md:items-center md:p-6" - role="dialog" - aria-modal="true" - :aria-hidden="(!showSheet).toString()" - aria-label="{{ $sheetAria }}"> + }; + $watch('showSheet', () => runSync()); + $watch('checkoutUrl', () => runSync()); + $watch('accessCode', () => runSync()); + $watch('returnUrl', () => runSync()); + $nextTick(() => runSync()); + " + x-show="showSheet" + x-cloak + data-ladill-pay-sheet + x-effect="document.documentElement.style.overflow = showSheet ? 'hidden' : ''" + @keydown.escape.window="if (showSheet) showSheet = false" + @ladill-pay-cancelled.window="showSheet = false" + class="fixed inset-0 z-[9999] flex items-end justify-center md:items-center md:p-6" + role="dialog" + aria-modal="true" + :aria-hidden="(!showSheet).toString()" + aria-label="{{ $sheetAria }}"> - {{-- One panel: bottom sheet (mobile) + centered modal (desktop). --}} + {{-- + ONE surface everywhere (POS / Merchant / Mini / Give / Invoice / Events): + - Mobile: bottom sheet + - Desktop: centered modal + - Paystack Inline fills the sheet body loading area (not a second full-screen modal) + --}} - + + {{-- Full header while loading / error / same-origin; compact bar once Paystack fills the body --}} + @@ -347,27 +1169,62 @@ - + + + + {{ $sheetTitle }} + + + + + + + + {{-- Body: spinner while starting; Paystack fills this when ready --}} + + {{-- Pin target for Paystack: keep in layout while inline checkout is active. --}} + + - - - - @@ -378,18 +1235,16 @@ data-ladill-pay-status-title x-text="$store.ladillPayCheckout && $store.ladillPayCheckout.error ? 'Checkout unavailable' - : ($store.ladillPayCheckout && $store.ladillPayCheckout.inline && !$store.ladillPayCheckout.launching - ? 'Complete payment in the Paystack window' - : 'Starting secure checkout…')"> + : 'Starting secure checkout…'"> + : 'Secure card and mobile money checkout opens on this page — not in a separate browser.'"> Try again @@ -400,8 +1255,15 @@ + @if (! empty($sheetFooter)) - + {{ $sheetFooter }} @endif
{{ $sheetTitle }}
+
{{ $sheetFooter }}