From 58819832f25e28cd53d13416027b78491db9a131 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Tue, 21 Jul 2026 17:34:17 +0000 Subject: [PATCH] Fix Paystack sheet: stop iframe embeds that Paystack blocks. Paystack checkout.paystack.com returns X-Frame-Options: SAMEORIGIN, so the shared sheet opened empty. Keep mobile sheet/desktop modal chrome, launch checkout in a named window with a Continue CTA fallback, and escape payment-return via window.opener or top. --- .../views/partials/paystack-sheet.blade.php | 157 +++++++++++++++++- .../views/public/payment-return.blade.php | 7 + tests/Feature/ResponsivePaystackSheetTest.php | 42 +++++ 3 files changed, 201 insertions(+), 5 deletions(-) create mode 100644 tests/Feature/ResponsivePaystackSheetTest.php diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index 9d0c4a4..a437868 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -8,8 +8,10 @@ Optional overrides: $sheetTitle, $sheetSubtitle, $sheetFooter, $sheetAria, $iframeTitle Requires Alpine ancestor with: showSheet (bool), checkoutUrl (string). - Loads the provider authorization URL in-frame (verified via production Events/POS). - MoMo and other non-frameable providers should redirect instead of opening this sheet. + Paystack (checkout.paystack.com) sends X-Frame-Options: SAMEORIGIN and cannot be + embedded. Same-origin URLs (e.g. MoMo waiting pages) still load in an iframe. + External checkouts open in a named window, with an in-sheet Continue CTA as a + user-gesture fallback when the popup is blocked after an async fetch. --}} @php $audience = $audience ?? 'buyer'; @@ -35,10 +37,101 @@ $iframeTitle = $iframeTitle ?? $defaults['iframe']; $sheetFooter = $sheetFooter ?? $defaults['footer']; @endphp +@once + +@endonce