From 07bb8beb10fe5d65e3a299b7ff15b27b6d2c4d1e Mon Sep 17 00:00:00 2001 From: isaacclad Date: Tue, 21 Jul 2026 16:50:07 +0000 Subject: [PATCH] Present Paystack checkout in a responsive mobile sheet and desktop modal. Standardize customer-facing Ladill Pay checkout shells across products, open them on all viewports, and escape iframe callbacks back to the product flow. --- resources/views/hosting/account.blade.php | 10 +- .../views/partials/paystack-sheet.blade.php | 135 +++++++++++++++--- .../views/public/payment-return.blade.php | 27 ++++ 3 files changed, 144 insertions(+), 28 deletions(-) create mode 100644 resources/views/public/payment-return.blade.php diff --git a/resources/views/hosting/account.blade.php b/resources/views/hosting/account.blade.php index 2117c6e..aeb8f79 100644 --- a/resources/views/hosting/account.blade.php +++ b/resources/views/hosting/account.blade.php @@ -65,13 +65,9 @@ const data = await res.json(); if (!res.ok || data.error) { alert(data.error || 'Unable to start payment.'); this.renewLoading = false; return; } this.renewModal = false; - if (window.innerWidth < 768) { - this.checkoutUrl = data.checkout_url; - this.showSheet = true; - this.renewLoading = false; - } else { - window.location.href = data.checkout_url; - } + this.checkoutUrl = data.checkout_url; + this.showSheet = true; + this.renewLoading = false; } catch(e) { alert('Network error. Please try again.'); this.renewLoading = false; diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index 559bf73..9d0c4a4 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -1,16 +1,51 @@ {{-- - Paystack mobile bottom-sheet iframe. - Requires Alpine.js ancestor with: showSheet (bool), checkoutUrl (string). - On mobile (< md) the sheet slides up; on desktop nothing renders. + Responsive payment checkout shell: bottom sheet on mobile, centered modal on desktop. + + Audiences: + - buyer (default): public ticket buyers, donors, shoppers — self-serve checkout + - operator: signed-in staff flows such as wallet top-up + + 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. --}} +@php + $audience = $audience ?? 'buyer'; + $defaults = match ($audience) { + 'operator' => [ + 'title' => 'Complete payment', + 'subtitle' => null, + 'aria' => 'Complete payment', + 'iframe' => 'Payment checkout', + 'footer' => null, + ], + default => [ + 'title' => 'Complete your payment', + 'subtitle' => 'Pay securely. You\'ll get a confirmation when it succeeds.', + 'aria' => 'Complete your payment', + 'iframe' => 'Secure payment checkout', + 'footer' => 'Your payment is processed securely. Do not close this window until finished.', + ], + }; + $sheetTitle = $sheetTitle ?? $defaults['title']; + $sheetSubtitle = $sheetSubtitle ?? $defaults['subtitle']; + $sheetAria = $sheetAria ?? $defaults['aria']; + $iframeTitle = $iframeTitle ?? $defaults['iframe']; + $sheetFooter = $sheetFooter ?? $defaults['footer']; +@endphp diff --git a/resources/views/public/payment-return.blade.php b/resources/views/public/payment-return.blade.php new file mode 100644 index 0000000..82ed789 --- /dev/null +++ b/resources/views/public/payment-return.blade.php @@ -0,0 +1,27 @@ + + + + + + Payment + + + +

Confirming your payment…

+ + +