mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 07:02:34 +01:00
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
@extends('portal.ninja2020.layout.clean')
|
|
@section('meta_title', ctrans('texts.purchase'))
|
|
|
|
@section('body')
|
|
@if ($errors->any())
|
|
<div class="alert alert-danger" style="margin: 1rem">
|
|
@foreach ($errors->all() as $error)
|
|
<p>{{ $error }}</p>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
|
|
@livewire('billing-portal.purchase', ['subscription' => $subscription, 'db' => $subscription->company->db, 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null])
|
|
@stop
|
|
|
|
@push('footer')
|
|
<script>
|
|
document.addEventListener('livewire:init', () => {
|
|
Livewire.on('purchase.submit', (event) => {
|
|
document.getElementById('payment-method-form').submit();
|
|
});
|
|
|
|
const target = document.getElementById('container');
|
|
|
|
Livewire.on('purchase.next', (event) => {
|
|
document.getElementById('spinner').classList.remove('hidden');
|
|
document.getElementById('container').classList.add('hidden');
|
|
|
|
setTimeout(() => {
|
|
document.getElementById('spinner').classList.add('hidden');
|
|
document.getElementById('container').classList.remove('hidden');
|
|
}, 1500);
|
|
});
|
|
|
|
Livewire.on('update-shipping-data', (event) => {
|
|
for (field in event) {
|
|
let element = document.querySelector(`input[name=${field}]`);
|
|
|
|
if (element) {
|
|
element.value = event[field];
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|