From dc65bc44acd3de7c4f64703bc09a5e465002a3af Mon Sep 17 00:00:00 2001 From: isaacclad Date: Tue, 21 Jul 2026 21:55:45 +0000 Subject: [PATCH] Fix POS payment sheet host and harden Inline launch. Use this.\$store in the host component so the bottomsheet opens, and share the hardened Paystack sheet sync path used across apps. --- .../partials/payment-checkout-host.blade.php | 15 +-- .../views/partials/paystack-sheet.blade.php | 116 +++++++++++------- tests/Feature/ResponsivePaystackSheetTest.php | 1 + 3 files changed, 82 insertions(+), 50 deletions(-) diff --git a/resources/views/partials/payment-checkout-host.blade.php b/resources/views/partials/payment-checkout-host.blade.php index d40008d..eea2419 100644 --- a/resources/views/partials/payment-checkout-host.blade.php +++ b/resources/views/partials/payment-checkout-host.blade.php @@ -5,26 +5,27 @@ accessCode: '', returnUrl: '', syncFromStore() { - const store = $store.paymentCheckout; + const store = this.$store.paymentCheckout; + if (!store) return; this.showSheet = !!store.isOpen; this.checkoutUrl = store.url || ''; this.accessCode = store.accessCode || ''; }, init() { // Keep local reactive mirrors so the teleported sheet always re-renders. - this.$watch(() => $store.paymentCheckout.isOpen, () => this.syncFromStore()); - this.$watch(() => $store.paymentCheckout.url, () => this.syncFromStore()); - this.$watch(() => $store.paymentCheckout.accessCode, () => this.syncFromStore()); + this.$watch(() => this.$store.paymentCheckout.isOpen, () => this.syncFromStore()); + this.$watch(() => this.$store.paymentCheckout.url, () => this.syncFromStore()); + this.$watch(() => this.$store.paymentCheckout.accessCode, () => this.syncFromStore()); this.$watch('showSheet', (open) => { - if (!open && $store.paymentCheckout.isOpen) { - $store.paymentCheckout.close(); + if (!open && this.$store.paymentCheckout?.isOpen) { + this.$store.paymentCheckout.close(); } }); const url = @js(session('checkout_url')); const code = @js(session('access_code')); if (url || code) { - $store.paymentCheckout.open(url || '', code || ''); + this.$store.paymentCheckout.open(url || '', code || ''); this.syncFromStore(); } }, diff --git a/resources/views/partials/paystack-sheet.blade.php b/resources/views/partials/paystack-sheet.blade.php index c269c79..a6724a2 100644 --- a/resources/views/partials/paystack-sheet.blade.php +++ b/resources/views/partials/paystack-sheet.blade.php @@ -44,7 +44,8 @@ @once @endonce