1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/resources/views/billing-portal/v3/index.blade.php

48 lines
2.2 KiB
PHP
Raw Normal View History

2024-02-08 19:55:44 +01:00
@extends('portal.ninja2020.layout.clean')
@section('meta_title', ctrans('texts.purchase'))
@section('body')
@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', () => {
Livewire.on('purchase.submit', (event) => {
document.querySelector('input[name="invoices[]"]').value = event.invoice_hashed_id;
document.querySelector('input[name="payable_invoices[0][amount]"').value = event.payable_amount;
document.querySelector('input[name="payable_invoices[0][invoice_id]"').value = event.invoice_hashed_id;
document.querySelector('input[name=company_gateway_id]').value = event.company_gateway_id;
document.querySelector('input[name=payment_method_id]').value = event.payment_method_id;
document.querySelector('input[name=contact_first_name]').value = event.contact_first_name;
document.querySelector('input[name=contact_last_name]').value = event.contact_last_name;
document.querySelector('input[name=contact_email]').value = event.contact_email;
2024-02-22 14:08:09 +01:00
document.getElementById('payment-method-form').submit()
2024-02-19 18:16:27 +01:00
});
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);
})
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