2021-01-14 12:24:45 +01:00
|
|
|
<div class="container mx-auto grid grid-cols-12 mb-4" data-ref="required-fields-container">
|
2021-01-12 15:43:07 +01:00
|
|
|
<div class="col-span-12 lg:col-span-6 lg:col-start-4 overflow-hidden bg-white shadow rounded-lg">
|
|
|
|
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
|
|
|
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
|
|
|
{{ ctrans('texts.required_payment_information') }}
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500">
|
|
|
|
{{ ctrans('texts.required_payment_information_more') }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<form wire:submit.prevent="handleSubmit(Object.fromEntries(new FormData($event.target)))">
|
|
|
|
@foreach($fields as $field)
|
2021-01-19 14:36:07 +01:00
|
|
|
@if(!array_key_exists('filled', $field))
|
|
|
|
@component('portal.ninja2020.components.general.card-element', ['title' => $field['label']])
|
|
|
|
@if($field['name'] == 'client_country_id' || $field['name'] == 'client_shipping_country_id')
|
|
|
|
<select id="country" class="input w-full form-select" name="{{ $field['name'] }}">
|
|
|
|
<option value="none"></option>
|
2021-01-12 15:43:07 +01:00
|
|
|
|
2021-01-19 14:36:07 +01:00
|
|
|
@foreach($countries as $country)
|
|
|
|
<option value="{{ $country->id }}">
|
|
|
|
{{ $country->iso_3166_2 }} ({{ $country->name }})
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
@else
|
|
|
|
<input class="input w-full" type="{{ $field['type'] }}" name="{{ $field['name'] }}">
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))
|
|
|
|
<p class="mt-2 text-gray-900 border-red-300 px-2 py-1 bg-gray-100">{{ session('validation_errors')[$field['name']][0] }}</p>
|
|
|
|
@endif
|
|
|
|
@endcomponent
|
|
|
|
@endif
|
2021-01-12 15:43:07 +01:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
@component('portal.ninja2020.components.general.card-element-single')
|
2021-01-14 12:24:45 +01:00
|
|
|
<div class="flex flex-col items-end">
|
2021-01-12 15:43:07 +01:00
|
|
|
<button class="button button-primary bg-primary">
|
2021-01-14 12:24:45 +01:00
|
|
|
{{ trans('texts.continue') }}
|
2021-01-12 15:43:07 +01:00
|
|
|
</button>
|
2021-01-14 12:24:45 +01:00
|
|
|
<small class="mt-1 text-gray-800">{{ ctrans('texts.required_client_info_save_label') }}</small>
|
2021-01-12 15:43:07 +01:00
|
|
|
</div>
|
|
|
|
@endcomponent
|
|
|
|
</form>
|
|
|
|
</div>
|
2021-01-13 13:31:00 +01:00
|
|
|
|
|
|
|
@if(!$show_form)
|
|
|
|
<script>
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
|
|
document.querySelector('div[data-ref="required-fields-container"]').classList.add('hidden');
|
2021-01-14 12:24:45 +01:00
|
|
|
|
|
|
|
document.querySelector('div[data-ref="gateway-container"]').classList.remove('opacity-25');
|
|
|
|
document.querySelector('div[data-ref="gateway-container"]').classList.remove('pointer-events-none');
|
2021-01-13 13:31:00 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endif
|
2021-01-12 15:43:07 +01:00
|
|
|
</div>
|