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