2024-02-08 19:55:44 +01:00
|
|
|
@extends('portal.ninja2020.layout.clean')
|
|
|
|
@section('meta_title', ctrans('texts.purchase'))
|
|
|
|
|
|
|
|
@section('body')
|
2024-03-14 15:58:40 +01:00
|
|
|
@if ($errors->any())
|
|
|
|
<div class="alert alert-danger" style="margin: 1rem">
|
|
|
|
@foreach ($errors->all() as $error)
|
|
|
|
<p>{{ $error }}</p>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
2024-02-08 19:55:44 +01:00
|
|
|
@livewire('billing-portal.purchase', ['subscription' => $subscription, 'db' => $subscription->company->db, 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null])
|
|
|
|
@stop
|
2024-02-19 18:16:27 +01:00
|
|
|
|
|
|
|
@push('footer')
|
|
|
|
<script>
|
|
|
|
document.addEventListener('livewire:init', () => {
|
2024-02-21 17:55:12 +01:00
|
|
|
Livewire.on('purchase.submit', (event) => {
|
2024-03-14 15:58:40 +01:00
|
|
|
document.getElementById('payment-method-form').submit();
|
2024-02-19 18:16:27 +01:00
|
|
|
});
|
2024-02-20 17:24:42 +01:00
|
|
|
|
|
|
|
const target = document.getElementById('container');
|
|
|
|
|
2024-02-22 11:21:50 +01:00
|
|
|
Livewire.on('purchase.next', (event) => {
|
|
|
|
document.getElementById('spinner').classList.remove('hidden');
|
|
|
|
document.getElementById('container').classList.add('hidden');
|
2024-02-20 17:24:42 +01:00
|
|
|
|
2024-02-22 11:21:50 +01:00
|
|
|
setTimeout(() => {
|
|
|
|
document.getElementById('spinner').classList.add('hidden');
|
|
|
|
document.getElementById('container').classList.remove('hidden');
|
|
|
|
}, 1500);
|
2024-03-14 15:58:40 +01:00
|
|
|
});
|
2024-02-22 14:08:09 +01:00
|
|
|
|
|
|
|
Livewire.on('update-shipping-data', (event) => {
|
|
|
|
for (field in event) {
|
|
|
|
let element = document.querySelector(`input[name=${field}]`);
|
|
|
|
|
|
|
|
if (element) {
|
|
|
|
element.value = event[field];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2024-02-19 18:16:27 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endpush
|