mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for required fields
This commit is contained in:
parent
5735dd7c15
commit
d0759b1215
@ -73,6 +73,7 @@ class RequiredClientInfo extends Component
|
||||
'state',
|
||||
'postal_code',
|
||||
'country_id',
|
||||
'shipping_country_id',
|
||||
];
|
||||
|
||||
protected $rules = [
|
||||
|
@ -190,7 +190,7 @@ class Import implements ShouldQueue
|
||||
|
||||
public function middleware()
|
||||
{
|
||||
return [new WithoutOverlapping($this->company->account->key)];
|
||||
return [new WithoutOverlapping($this->company->company_key)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,19 @@ class AuthorizePaymentDriver extends BaseDriver
|
||||
|
||||
public function getClientRequiredFields(): array
|
||||
{
|
||||
return [
|
||||
|
||||
$fields = [];
|
||||
|
||||
if ($this->company_gateway->require_shipping_address) {
|
||||
$fields[] = ['name' => 'client_shipping_address_line_1', 'label' => ctrans('texts.shipping_address1'), 'type' => 'text', 'validation' => 'required'];
|
||||
$fields[] = ['name' => 'client_shipping_city', 'label' => ctrans('texts.shipping_city'), 'type' => 'text', 'validation' => 'required'];
|
||||
$fields[] = ['name' => 'client_shipping_state', 'label' => ctrans('texts.shipping_state'), 'type' => 'text', 'validation' => 'required'];
|
||||
$fields[] = ['name' => 'client_shipping_postal_code', 'label' => ctrans('texts.shipping_postal_code'), 'type' => 'text', 'validation' => 'required'];
|
||||
$fields[] = ['name' => 'client_shipping_country_id', 'label' => ctrans('texts.shipping_country'), 'type' => 'text', 'validation' => 'required'];
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
['name' => 'client_name', 'label' => ctrans('texts.name'), 'type' => 'text', 'validation' => 'required|min:2'],
|
||||
['name' => 'contact_email', 'label' => ctrans('texts.email'), 'type' => 'text', 'validation' => 'required|email:rfc'],
|
||||
['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required'],
|
||||
@ -75,6 +87,9 @@ class AuthorizePaymentDriver extends BaseDriver
|
||||
['name' => 'client_postal_code', 'label' => ctrans('texts.postal_code'), 'type' => 'text', 'validation' => 'required'],
|
||||
['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'select', 'validation' => 'required'],
|
||||
];
|
||||
|
||||
return array_merge($fields, $data);
|
||||
|
||||
}
|
||||
|
||||
public function authorizeView($payment_method)
|
||||
|
Loading…
x
Reference in New Issue
Block a user