Deploy Ladill POS / deploy (push) Successful in 40s
Mirror paymentCheckout into local Alpine state so the teleported sheet opens, and restore the always-visible bottomsheet/modal shell around Inline.
42 lines
1.7 KiB
PHP
42 lines
1.7 KiB
PHP
{{-- Global host for till-operator Card/MoMo sheets (register + open tickets). --}}
|
|
<div x-data="{
|
|
showSheet: false,
|
|
checkoutUrl: '',
|
|
accessCode: '',
|
|
returnUrl: '',
|
|
syncFromStore() {
|
|
const store = $store.paymentCheckout;
|
|
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('showSheet', (open) => {
|
|
if (!open && $store.paymentCheckout.isOpen) {
|
|
$store.paymentCheckout.close();
|
|
}
|
|
});
|
|
|
|
const url = @js(session('checkout_url'));
|
|
const code = @js(session('access_code'));
|
|
if (url || code) {
|
|
$store.paymentCheckout.open(url || '', code || '');
|
|
this.syncFromStore();
|
|
}
|
|
},
|
|
}"
|
|
@ladill-pay-cancelled.window="showSheet = false; $store.paymentCheckout.close()"
|
|
class="contents">
|
|
@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',
|
|
])
|
|
</div>
|