diff --git a/resources/views/partials/payment-checkout-host.blade.php b/resources/views/partials/payment-checkout-host.blade.php index f1f23eb..d40008d 100644 --- a/resources/views/partials/payment-checkout-host.blade.php +++ b/resources/views/partials/payment-checkout-host.blade.php @@ -1,25 +1,41 @@ {{-- Global host for till-operator Card/MoMo sheets (register + open tickets). --}} -
-
- @include('partials.paystack-sheet', [ - 'audience' => 'operator', - 'sheetTitle' => 'Customer payment', - 'sheetSubtitle' => 'Hand this screen to the customer for card or mobile money.', - 'sheetFooter' => 'Stay on this screen until the customer finishes. Closing only hides the sheet.', - 'iframeTitle' => 'Customer card or mobile money checkout', - ]) -
+ @include('partials.paystack-sheet', [ + 'audience' => 'operator', + 'sheetTitle' => 'Customer payment', + 'sheetSubtitle' => 'Hand this screen to the customer for card or mobile money.', + 'sheetFooter' => 'Stay on this screen until the customer finishes. Closing only hides the sheet.', + 'iframeTitle' => 'Customer card or mobile money checkout', + ])
diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index f4e6192..c269c79 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -295,124 +295,118 @@ ); } " - @keydown.escape.window="if (showSheet && $store.ladillPayCheckout && ($store.ladillPayCheckout.frameable || $store.ladillPayCheckout.error || $store.ladillPayCheckout.launching)) showSheet = false" + @keydown.escape.window="if (showSheet) showSheet = false" @ladill-pay-cancelled.window="showSheet = false" - class="fixed inset-0 z-[9999]" - :class="($store.ladillPayCheckout && $store.ladillPayCheckout.inline && !$store.ladillPayCheckout.launching && !$store.ladillPayCheckout.error && !$store.ladillPayCheckout.frameable) ? 'pointer-events-none' : ''" + 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 }}"> - {{-- Brief loader only — then Paystack Inline is the sole payment UI (avoids double modal). --}} -
-
- -

Opening payment…

-
+ x-transition:leave-end="opacity-0" + @click="showSheet = false; window.LadillPayCheckout?.cancel?.()">
- {{-- Full Ladill shell only for same-origin iframe (e.g. MoMo waiting) or recovery errors. --}} -
-
-
- -
-
- -
-
-

{{ $sheetTitle }}

- @if (! empty($sheetSubtitle)) -

{{ $sheetSubtitle }}

- @endif -
- + {{-- Always wrap payment: bottom sheet on mobile, centered modal on desktop. --}} +
+
+ +
+
+

{{ $sheetTitle }}

+ @if (! empty($sheetSubtitle)) +

{{ $sheetSubtitle }}

+ @endif
+
-
- - -
- -
-

Checkout unavailable

-

-
- - -
-
- @if (! empty($sheetFooter)) -

- {{ $sheetFooter }} -

- @endif
+
+ + +
+ +
+

+

+
+ + +
+
+ @if (! empty($sheetFooter)) +

+ {{ $sheetFooter }} +

+ @endif
diff --git a/tests/Feature/ResponsivePaystackSheetTest.php b/tests/Feature/ResponsivePaystackSheetTest.php index edf49fd..397090d 100644 --- a/tests/Feature/ResponsivePaystackSheetTest.php +++ b/tests/Feature/ResponsivePaystackSheetTest.php @@ -18,8 +18,6 @@ class ResponsivePaystackSheetTest extends TestCase $this->assertStringContainsString('data-ladill-pay-panel', $html); $this->assertStringContainsString('data-ladill-pay-backdrop', $html); $this->assertStringContainsString('data-ladill-pay-handle', $html); - $this->assertStringContainsString('data-ladill-pay-loading', $html); - $this->assertStringContainsString('data-ladill-pay-shell', $html); $this->assertStringContainsString('data-ladill-pay-inline-status', $html); $this->assertStringContainsString('md:items-center', $html); $this->assertStringContainsString('rounded-t-2xl', $html); @@ -30,13 +28,13 @@ class ResponsivePaystackSheetTest extends TestCase $this->assertStringContainsString('LadillPayCheckout', $html); $this->assertStringContainsString('resumeTransaction', $html); $this->assertStringContainsString('js.paystack.co/v2/inline.js', $html); - $this->assertStringContainsString('Opening payment', $html); - $this->assertStringContainsString('pointer-events-none', $html); + $this->assertStringContainsString('Starting secure checkout', $html); + $this->assertStringContainsString('Complete payment on this screen', $html); + $this->assertStringContainsString('not in a separate browser', $html); + $this->assertStringContainsString('items-end justify-center md:items-center', $html); // Must not push Paystack to a separate browser as the primary path. $this->assertStringNotContainsString('Continue to Paystack', $html); $this->assertStringNotContainsString('window.open(', $html); - // Must not stack Ladill chrome under Paystack Inline (double interface). - $this->assertStringNotContainsString('Complete payment in the Paystack window', $html); // Must not use Tailwind `hidden` + x-show on the panel (desktop stays invisible). $this->assertStringNotContainsString('hidden w-full max-w-lg', $html); $this->assertStringNotContainsString('Paystack checkout', $html); @@ -70,6 +68,7 @@ class ResponsivePaystackSheetTest extends TestCase $this->assertStringContainsString('access_code', $html); $this->assertStringContainsString('accessCode', $html); $this->assertStringContainsString('paymentCheckout.open', $html); + $this->assertStringContainsString('syncFromStore', $html); $this->assertStringContainsString('partials.paystack-sheet', $html); } }