1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Merge branch 'payment-driver-rotessa' into v5-develop

Signed-off-by: Kendall Arneaud <kendall.arneaud@gmail.com>
This commit is contained in:
Kendall Arneaud 2024-07-29 18:55:04 -04:00 committed by GitHub
commit 825108039d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 235 additions and 202 deletions

View File

@ -105,7 +105,7 @@ class Gateway extends StaticModel
$link = 'https://www.forte.net/';
} elseif ($this->id == 62) {
$link = 'https://docs.btcpayserver.org/InvoiceNinja/';
} elseif ($this->id == 4002) {
} elseif ($this->id == 63) {
$link = 'https://rotessa.com';
}
@ -226,7 +226,7 @@ class Gateway extends StaticModel
return [
GatewayType::CRYPTO => ['refund' => true, 'token_billing' => false, 'webhooks' => ['confirmed', 'paid_out', 'failed', 'fulfilled']],
]; //BTCPay
case 4002:
case 63:
return [
GatewayType::BANK_TRANSFER => [
'refund' => false,

View File

@ -152,6 +152,8 @@ class SystemLog extends Model
public const TYPE_BTC_PAY = 324;
public const TYPE_ROTESSA = 325;
public const TYPE_QUOTA_EXCEEDED = 400;
public const TYPE_UPSTREAM_FAILURE = 401;

View File

@ -145,18 +145,16 @@ class PaymentMethod implements MethodInterface
$request->validate([
'source' => ['required','string','exists:client_gateway_tokens,token'],
'amount' => ['required','numeric'],
'token_id' => ['required','integer','exists:client_gateway_tokens,id'],
'process_date'=> ['required','date','after_or_equal:today'],
]);
$customer = ClientGatewayToken::query()
->where('company_gateway_id', $this->rotessa->company_gateway->id)
->where('client_id', $this->rotessa->client->id)
->where('id', (int) $request->input('token_id'))
->where('token', $request->input('source'))
->first();
if(!$customer) throw new \Exception('Client gateway token not found!', 605);
$transaction = new Transaction($request->only('frequency' ,'installments','amount','process_date','comment'));
$transaction = new Transaction($request->only('frequency' ,'installments','amount','process_date') + ['comment' => $this->rotessa->getDescription(false) ]);
$transaction->additional(['customer_id' => $customer->gateway_customer_reference]);
$transaction = array_filter( $transaction->resolve());
$response = $this->rotessa->gateway->capture($transaction)->send();
@ -182,12 +180,12 @@ class PaymentMethod implements MethodInterface
[ 'data' => $data ],
SystemLog::CATEGORY_GATEWAY_RESPONSE,
SystemLog::EVENT_GATEWAY_SUCCESS,
880,
SystemLog::TYPE_ROTESSA,
$this->rotessa->client,
$this->rotessa->client->company,
);
return redirect()->route('client.payments.show', [ 'payment' => $this->rotessa->encodePrimaryKey($payment->id) ]);
return redirect()->route('client.payments.show', [ 'payment' => $payment->hashed_id ]);
}
/**
@ -205,7 +203,7 @@ class PaymentMethod implements MethodInterface
$exception->getMessage(),
SystemLog::CATEGORY_GATEWAY_RESPONSE,
SystemLog::EVENT_GATEWAY_FAILURE,
880,
SystemLog::TYPE_ROTESSA,
$this->rotessa->client,
$this->rotessa->client->company,
);

View File

@ -24,6 +24,7 @@ use App\Utils\Traits\MakesHash;
use App\Jobs\Util\SystemLogger;
use App\PaymentDrivers\BaseDriver;
use App\Models\ClientGatewayToken;
use Illuminate\Support\Facades\Cache;
use Illuminate\Database\Eloquent\Builder;
use App\PaymentDrivers\Rotessa\Resources\Customer;
use App\PaymentDrivers\Rotessa\PaymentMethod as Acss;
@ -64,13 +65,15 @@ class RotessaPaymentDriver extends BaseDriver
{
$types = [];
if ($this->client
/*
// TODO: needs to test with US test account
if ($this->client
&& $this->client->currency()
&& in_array($this->client->currency()->code, ['USD'])
&& isset($this->client->country)
&& in_array($this->client->country->iso_3166_2, ['US'])) {
$types[] = GatewayType::BANK_TRANSFER;
}
}*/
if ($this->client
&& $this->client->currency()
@ -115,39 +118,106 @@ class RotessaPaymentDriver extends BaseDriver
public function importCustomers() {
$this->init();
try {
$result = $this->gateway->getCustomers()->send();
if(!$result->isSuccessful()) throw new \Exception($result->getMessage(), (int) $result->getCode());
$customers = collect($result->getData())->unique('email');
if(!$result = Cache::has('rotessa-import_customers')) {
$result = $this->gateway->getCustomers()->send();
if(!$result->isSuccessful()) throw new \Exception($result->getMessage(), (int) $result->getCode());
// cache results
Cache::put('rotessa-import_customers', $result->getData(), 60 * 60 * 24);
}
$result = Cache::get('rotessa-import_customers');
$customers = collect($result)->unique('email');
$client_emails = $customers->pluck('email')->all();
$company_id = $this->company_gateway->company->id;
// get existing customers
$client_contacts = ClientContact::where('company_id', $company_id)->whereIn('email', $client_emails )->whereNull('deleted_at')->get();
$client_contacts = $client_contacts->map(function($item, $key) use ($customers) {
return array_merge([], (array) $customers->firstWhere("email", $item->email) , ['custom_identifier' => $item->client->number, 'identifier' => $item->client->number ]);
return array_merge([], (array) $customers->firstWhere("email", $item->email) , ['custom_identifier' => $item->client->number, 'identifier' => $item->client->number, 'client_id' => $item->client->id ]);
} );
// create payment methods
$client_contacts->each(
function($contact) use ($customers) {
sleep(10);
$result = $this->gateway->getCustomersId(['id' => ($contact = (object) $contact)->id])->send();
$this->client = Client::find($contact->custom_identifier);
$this->client = Client::find($contact->client_id);
$customer = (new Customer($result->getData()))->additional(['id' => $contact->id, 'custom_identifier' => $contact->custom_identifier ] );
$this->findOrCreateCustomer($customer->additional + $customer->jsonSerialize());
}
);
// create new clients from rotessa customers
$client_emails = $client_contacts->pluck('email')->all();
$client_contacts = $customers->filter(function ($value, $key) use ($client_emails) {
return !in_array(((object) $value)->email, $client_emails);
})->each( function($customer) use ($company_id) {
// create new client contact from rotess customer
$customer = (object) $this->gateway->getCustomersId(['id' => ($customer = (object) $customer)->id])->send()->getData();
/**
{
"account_number": "11111111"
"active": true,
"address": {
"address_1": "123 Main Street",
"address_2": "Unit 4",
"city": "Birmingham",
"id": 114397,
"postal_code": "36016",
"province_code": "AL"
},
"authorization_type": "Online",
"bank_account_type": "Checking",
"bank_name": "Scotiabank",
"created_at": "2015-02-10T23:50:45.000-06:00",
"custom_identifier": "Mikey",
"customer_type": "Personal",
"email": "mikesmith@test.com",
"financial_transactions": [],
"home_phone": "(204) 555 5555",
"id": 1,
"identifier": "Mikey",
"institution_number": "",
"name": "Mike Smith",
"phone": "(204) 555 4444",
"routing_number": "111111111",
"transaction_schedules": [],
"transit_number": "",
"updated_at": "2015-02-10T23:50:45.000-06:00"
}
*/
$client = (\App\Factory\ClientFactory::create($this->company_gateway->company_id, $this->company_gateway->user_id))->fill(
[
'address1' => $customer->address['address_1'] ?? '',
'address2' =>$customer->address['address_2'] ?? '',
'city' => $customer->address['city'] ?? '',
'postal_code' => $customer->address['postal_code'] ?? '',
'state' => $customer->address['province_code'] ?? '',
'country_id' => empty($customer->transit_number) ? 840 : 124,
'routing_id' => empty(($r = $customer->routing_number))? null : $r,
"number" => str_pad($customer->account_number,3,'0',STR_PAD_LEFT)
]
);
$client->saveQuietly();
$contact = (\App\Factory\ClientContactFactory::create($company_id, $this->company_gateway->user_id))->fill([
"first_name" => substr($customer->name, 0, stripos($customer->name, " ")),
"last_name" => substr($customer->name, stripos($customer->name, " ")),
"email" => $customer->email,
"phone" => $customer->phone
]);
$client->contacts()->saveMany([$contact]);
$contact = $client->contacts()->first();
$this->client = $client;
$customer = (new Customer((array) $customer))->additional(['id' => $customer->id, 'custom_identifier' => $customer->custom_identifier ?? $contact->id ] );
$this->findOrCreateCustomer($customer->additional + $customer->jsonSerialize());
});
} catch (\Throwable $th) {
$data = [
$data = [
'transaction_reference' => null,
'transaction_response' => $th->getMessage(),
'success' => false,
'description' => $th->getMessage(),
'code' =>(int) $th->getCode()
];
SystemLogger::dispatch(['server_response' => $th->getMessage(), 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, 880 , $this->client , $this->company_gateway->company);
SystemLogger::dispatch(['server_response' => $th->getMessage(), 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, 880 , $this->company_gateway->client , $this->company_gateway->company);
throw $th;
}
@ -198,7 +268,7 @@ class RotessaPaymentDriver extends BaseDriver
'code' =>(int) $th->getCode()
];
SystemLogger::dispatch(['server_response' => is_null($result) ? '' : $result->getData(), 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, 880 , $this->client, $this->client->company);
SystemLogger::dispatch(['server_response' => is_null($result) ? '' : (array) $result, 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, 880 , $this->client, $this->company_gateway->company);
throw $th;
}

View File

@ -15,42 +15,23 @@ return new class extends Migration
public function up(): void
{
Model::unguard();
\DB::statement('SET FOREIGN_KEY_CHECKS=0;');
$record = Gateway::where('name', '=', 'Rotessa')->first();
$count = (int) Gateway::count();
if(!Gateway::find(63)) {
$configuration = new \stdClass;
$configuration->apiKey = '';
$configuration->testMode = true;
$configuration = new \stdClass;
$configuration->api_key = '';
$configuration->test_mode = true;
if (!$record) {
$gateway = new Gateway;
} else {
$gateway = $record;
$gateway = new Gateway();
$gateway->id = 63;
$gateway->name = 'Rotessa';
$gateway->key = '91be24c7b792230bced33e930ac61676';
$gateway->provider = 'Rotessa';
$gateway->is_offsite = true;
$gateway->fields = \json_encode($configuration);
$gateway->visible = 1;
$gateway->site_url = "https://rotessa.com";
$gateway->default_gateway_type_id = 2;
$gateway->save();
}
$gateway->id = 4002;
$gateway->name = 'Rotessa';
$gateway->key = Str::lower(Str::random(32));
$gateway->provider = 'Rotessa';
$gateway->is_offsite = true;
$gateway->fields = \json_encode($configuration);
$gateway->visible = 1;
$gateway->site_url = "https://rotessa.com";
$gateway->default_gateway_type_id = 2;
$gateway->save();
Gateway::query()->where('name','=', 'Rotessa')->update(['visible' => 1]);
\DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Gateway::where('name', '=', 'Rotessa')->delete();
}
};

View File

@ -88,6 +88,7 @@ class PaymentLibrariesSeeder extends Seeder
['id' => 60, 'name' => 'PayPal REST', 'provider' => 'PayPal_Rest', 'key' => '80af24a6a691230bbec33e930ab40665', 'fields' => '{"clientId":"","secret":"","signature":"","testMode":false}'],
['id' => 61, 'name' => 'PayPal Platform', 'provider' => 'PayPal_PPCP', 'key' => '80af24a6a691230bbec33e930ab40666', 'fields' => '{"testMode":false}'],
['id' => 62, 'name' => 'BTCPay', 'provider' => 'BTCPay', 'key' => 'vpyfbmdrkqcicpkjqdusgjfluebftuva', 'fields' => '{"btcpayUrl":"", "apiKey":"", "storeId":"", "webhookSecret":""}'],
['id' => 63, 'name' => 'Rotessa', 'is_offsite' => false, 'sort_order' => 22, 'provider' => 'Rotessa', 'key' => '91be24c7b792230bced33e930ac61676', 'fields' => '{"apiKey":"", "testMode":""}'],
];
foreach ($gateways as $gateway) {
@ -104,7 +105,7 @@ class PaymentLibrariesSeeder extends Seeder
Gateway::query()->update(['visible' => 0]);
Gateway::whereIn('id', [1, 3, 7, 11, 15, 20, 39, 46, 55, 50, 57, 52, 58, 59, 60, 62])->update(['visible' => 1]);
Gateway::whereIn('id', [1, 3, 7, 11, 15, 20, 39, 46, 55, 50, 57, 52, 58, 59, 60, 62, 63])->update(['visible' => 1]);
if (Ninja::isHosted()) {
Gateway::whereIn('id', [20, 49])->update(['visible' => 0]);

View File

@ -5300,7 +5300,7 @@ $lang = array(
'merge_to_pdf' => 'Merge to PDF',
'latest_requires_php_version' => 'Note: the latest version requires PHP :version',
'auto_expand_product_table_notes' => 'Automatically expand products table notes',
'auto_expand_product_table_notes_help' => 'Automatically expands the notes section within the products table to display more lines.',
'auto_expand_product_table_notes_help' => 'Automatically expands the notes section within the products table to display more lines.'
);
return $lang;

View File

@ -5301,6 +5301,15 @@ $lang = array(
'latest_requires_php_version' => 'Note: the latest version requires PHP :version',
'auto_expand_product_table_notes' => 'Automatically expand products table notes',
'auto_expand_product_table_notes_help' => 'Automatically expands the notes section within the products table to display more lines.',
'institution_number' => 'Institution Number',
'transit_number' => 'Transit Number',
'personal' => 'Personal',
'address_information' => 'Address Information',
'enter_the_information_for_the_bank_account' => 'Enter the Information for the Bank Account',
'account_holder_information' => 'Account Holder Information',
'enter_information_for_the_account_holder' => 'Enter Information for the Account Holder',
'customer_type' => 'Customer Type',
'process_date' => 'Process Date'
);
return $lang;

View File

@ -5298,7 +5298,7 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
'latest_requires_php_version' => 'Note: La dernière version requiert PHP :version',
'auto_expand_product_table_notes' => 'Développer automatiquement les notes du tableau de produits',
'auto_expand_product_table_notes_help' => ' 
Développe automatiquement la section des notes dans le tableau de produits pour afficher plus de lignes.',
Développe automatiquement la section des notes dans le tableau de produits pour afficher plus de lignes.'
);
return $lang;

1
public/build/assets/app-02bc3b96.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<dd> Gateway: </dd>
<dd> {{ ctrans('texts.gateway') }}: </dd>
<dt>{{ $brand }}</dt>
<dd> Account Number: </dd>
<dt>{{ $account_number }}</dt>
<dd> {{ ctrans('texts.account_number') }}: </dd>
<dt>{{ $account_number }}</dt>

View File

@ -1,4 +1,4 @@
@extends('portal.ninja2020.layout.payments', ['gateway_title' => 'Direct Debit', 'card_title' => 'Direct Debit'])
@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.direct_debit'), 'card_title' => ctrans('texts.direct_debit') ])
@section('gateway_content')
@if (count($tokens) > 0)
@ -14,55 +14,32 @@
<input type="hidden" name="amount" value="{{ $amount }}">
<input type="hidden" name="currency" value="{{ $currency }}">
<input type="hidden" name="payment_hash" value="{{ $payment_hash }}">
<input type="hidden" name="token_id" value="">
<input type="hidden" name="frequency" value="Once">
<input type="hidden" name="installments" value="1">
<input type="hidden" name="comment" value="Payment for invoice # {{ $invoice_nums }}">
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')])
@if (count($tokens) > 0)
@foreach ($tokens as $token)
<label class="mr-4">
<input type="radio" data-token="{{ $token->token }}" data-token_id="{{ $token->id }}" name="payment-type"
<input type="radio" data-token="{{ $token->token }}" name="payment-type"
class="form-radio cursor-pointer toggle-payment-with-token" />
<span class="ml-1 cursor-pointer">
{{ App\Models\GatewayType::getAlias($token->gateway_type_id) }} ({{ $token->meta->brand }})
&nbsp; Acc#: {{ $token->meta->account_number }}
&nbsp; {{ ctrans('texts.account_number') }}#: {{ $token->meta->account_number }}
</span>
</label><br/>
@endforeach
@endisset
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Process Date
{{ ctrans('texts.process_date') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input autocomplete="new-password" readonly type="date" min="{{ $due_date }}" name="process_date" id="process_date" required class="input w-full" placeholder="" value="{{ old('process_date', $process_date ) }}">
</dd>
{{--
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Insallments
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="installments" name="installments" type="number" placeholder="Installments" required value="{{ old('installments',$installments) }}">
</dd>
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Frequency
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="frequency" name="frequency" type="text" placeholder="Once/Weekly/Monthly/Annually" required >
</dd>
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Comments
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<textarea autocomplete="new-password" id="comment" name="comment" type="text" class="w-full py-2 px-3 rounded text-sm disabled:opacity-75 disabled:cursor-not-allowed undefined border border-gray-300" placeholder="" rows="5" style="background-color: rgb(255, 255, 255); border-color: rgb(209, 213, 219); color: rgb(42, 48, 61);"> </textarea>
</dd> --}}
@endcomponent
</form>
@else
@component('portal.ninja2020.components.general.card-element-single', ['title' => 'Direct Debit', 'show_title' => false])
@component('portal.ninja2020.components.general.card-element-single', ['title' => ctrans('texts.direct_debit'), 'show_title' => false])
<span>{{ ctrans('texts.bank_account_not_linked') }}</span>
<a class="button button-link text-primary"
@ -81,11 +58,10 @@
.from(document.getElementsByClassName('toggle-payment-with-token'))
.forEach((element) => element.addEventListener('click', (element) => {
document.querySelector('input[name=source]').value = element.target.dataset.token;
document.querySelector('input[name=token_id]').value = element.target.dataset.token_id;
}));
document.getElementById('pay-now').addEventListener('click', function() {
document.getElementById('server-response').submit();
});
</script>
@endpush
@endpush

View File

@ -1,31 +1,31 @@
<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">
Account Information
{{ ctrans('texts.account_information') }}
</h3>
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500">
Enter the information for the bank account
{{ ctrans('texts.enter_the_information_for_the_bank_account') }}
</p>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Bank Name
{{ ctrans('texts.bank_name') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="bank_name" name="bank_name" type="text" placeholder="Bank Name" required value="{{ old('bank_name', $bank_name) }}">
<input class="input w-full" id="bank_name" name="bank_name" type="text" placeholder="{{ ctrans('texts.bank_name') }}" required value="{{ old('bank_name', $bank_name) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Account Number
{{ ctrans('texts.account_number') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="account_number" name="account_number" type="text" placeholder="Account Number" required value="{{ old('account_number', $account_number) }}">
<input class="input w-full" id="account_number" name="account_number" type="text" placeholder="{{ ctrans('texts.account_number') }}" required value="{{ old('account_number', $account_number) }}">
</dd>
</div>
<input type="hidden" name="authorization_type" id="authorization_type" value="{{ old('authorization_type',$authorization_type) }}" >
@include("portal.ninja2020.gateways.rotessa.components.banks.$country.bank", compact('bank_account_type','routing_number','institution_number','transit_number'))
@include("portal.ninja2020.gateways.rotessa.components.banks.$country.bank", compact('bank_account_type','routing_number','institution_number','transit_number'))

View File

@ -1,16 +1,16 @@
<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">
Address Information
{{ ctrans('texts.address_information') }}
</h3>
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500">
Enter the address information for the account holder
{{ ctrans('texts.enter_the_address_information_for_the_account_holder') }}
</p>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Address Line 1
{{ ctrans('texts.address1') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="address_1" name="address_1" type="text" placeholder="Address Line 1" required value="{{ old('address_1', $address_1) }}">
@ -19,7 +19,7 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Address Line 2
{{ ctrans('texts.address2') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="address_2" name="address_2" type="text" placeholder="Address Line 2" required value="{{ old('address_2', $address_2) }}">
@ -28,7 +28,7 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
City
{{ ctrans('texts.city') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="city" name="city" type="text" placeholder="City" required value="{{ old('city', $city) }}">
@ -37,7 +37,7 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Postal Code
{{ ctrans('texts.postal_code') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="postal_code" name="postal_code" type="text" placeholder="Postal Code" required value="{{ old('postal_code', $postal_code ) }}">
@ -46,17 +46,17 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Country
{{ ctrans('texts.country') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
@if('US' == $country)
<input type="radio" id="us" name="country" value="US" required @checked(old('country', $country) == 'US')>
<label for="us">United States</label><br>
<label for="us">{{ ctrans('texts.united_states') }}</label><br>
@else
<input type="radio" id="ca" name="country" value="CA" required @checked(old('country', $country) == 'CA')>
<label for="ca">Canada</label><br>
<label for="ca">{{ ctrans('texts.canada') }}</label><br>
@endif
</dd>
</div>
@include("portal.ninja2020.gateways.rotessa.components.dropdowns.country.$country",compact('province_code'))
@include("portal.ninja2020.gateways.rotessa.components.dropdowns.country.$country",compact('province_code'))

View File

@ -1,17 +1,17 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Transit Number
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="transit_number" max="5" name="transit_number" type="text" placeholder="Transit Number" required value="{{ old('transit_number',$transit_number) }}">
</dd>
</div>
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.transit_number') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="transit_number" max="5" name="transit_number" type="text" placeholder="{{ ctrans('texts.transit_number') }}" required value="{{ old('transit_number', $transit_number) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Institution Number
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="institution_number" max="3" name="institution_number" type="text" placeholder="Institution Number" required value="{{ old('institution_number',$institution_number) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.institution_number') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="institution_number" max="3" name="institution_number" type="text" placeholder="{{ ctrans('texts.institution_number') }}" required value="{{ old('institution_number', $institution_number) }}">
</dd>
</div>

View File

@ -1,28 +1,26 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.routing_number') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="routing_number" name="routing_number" type="text" placeholder="{{ ctrans('texts.routing_number') }}" required value="{{ old('routing_number', $routing_number) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Routing Number
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="routing_number" name="routing_number" type="text" placeholder="Routing Number" required value="{{ old('routing_number',$routing_number) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Account Type
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.account_type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<div class="sm:grid-cols-2 sm:flex">
<div class="flex items-center px-2">
<input id="bank_account_type_savings" name="bank_account_type" value="Savings" required @checked(old('bank_account_type', $bank_account_type)) type="radio" class="focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed">
<label for="bank_account_type_savings" class="ml-3 block text-sm font-medium cursor-pointer">Savings</label>
<label for="bank_account_type_savings" class="ml-3 block text-sm font-medium cursor-pointer">{{ ctrans('texts.savings') }}</label>
</div>
<div class="flex items-center px-2">
<input id="bank_account_type_checking" name="bank_account_type" value="Checking" required @checked(old('bank_account_type', $bank_account_type)) type="radio" class="focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed">
<label for="bank_account_type_checking" class="ml-3 block text-sm font-medium cursor-pointer">Checking</label>
<input id="bank_account_type_checking" name="bank_account_type" value="Checking" required @checked(old('bank_account_type', $bank_account_type)) type="radio" class="focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed">
<label for="bank_account_type_checking" class="ml-3 block text-sm font-medium cursor-pointer">{{ ctrans('texts.checking') }}</label>
</div>
</div>
</dd>
</div>
</dd>
</div>

View File

@ -1,69 +1,66 @@
<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">
Account Holder Information
</h3>
<h3 class="text-lg font-medium leading-6 text-gray-900">
{{ ctrans('texts.account_holder_information') }}
</h3>
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500">
Enter the information for the account holder
</p>
</div>
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500">
{{ ctrans('texts.enter_the_information_for_the_account_holder') }}
</p>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Full Name
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="name" name="name" type="text" placeholder="Full Name" required value="{{ old('name',$name) }}">
</dd>
</div>
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.account_holder_name') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="name" name="name" type="text" placeholder="{{ ctrans('texts.name') }}" required value="{{ old('name', $name) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.email_address') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" name="email" id="email" type="email" placeholder="{{ ctrans('texts.email_address') }}" required value="{{ old('email', $email) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Email Address
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" name="email" id="email" type="email" placeholder="Email Address" required value="{{ old('email',$email) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.phone') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="home_phone" name="home_phone" type="text" placeholder="{{ ctrans('texts.phone') }}" required value="{{ old('home_phone', $home_phone) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Home Phone
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="home_phone" name="home_phone" type="text" placeholder="Home Phone" required value="{{ old('phone',$phone) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.work_phone') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="phone" name="phone" type="text" placeholder="{{ ctrans('texts.work_phone') }}" required value="{{ old('phone', $phone) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Other Phone
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<input class="input w-full" id="phone" name="phone" type="text" placeholder="Phone" required value="{{ old('phone',$phone) }}">
</dd>
</div>
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Customer Type
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.customer_type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<div class="sm:grid-cols-2 sm:flex">
<div class="flex items-center px-2">
<input id="customer_type_personal" name="customer_type" value="Personal" required @checked(old('customer_type', $customer_type) == 'Personal') type="radio" class="focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed">
<label for="customer_type_personal" class="ml-3 block text-sm font-medium cursor-pointer">Personal</label>
<label for="customer_type_personal" class="ml-3 block text-sm font-medium cursor-pointer">{{ ctrans('texts.personal') }}</label>
</div>
<div class="flex items-center px-2">
<input id="customer_type_business" name="customer_type" value="Business" required @checked(old('customer_type', $customer_type) == 'Business') type="radio" class="focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed">
<label for="customer_type_business" class="ml-3 block text-sm font-medium cursor-pointer">Business</label>
<label for="customer_type_business" class="ml-3 block text-sm font-medium cursor-pointer">{{ ctrans('texts.business') }}</label>
</div>
</div>
</dd>
</div>
</dd>
</div>
<input name="id" type="hidden" value="{{ old('id', $id ) }}">
<input name="custom_identifier" type="hidden" value="{{ old('custom_identifer', $contact['custom_identifier']) }}">
<input name="id" type="hidden" value="{{ old('id', $id) }}">
<input name="custom_identifier" type="hidden" value="{{ old('custom_identifer', $contact['custom_identifier']) }}">

View File

@ -1,6 +1,6 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
Province Code
{{ ctrans('texts.state') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<select class="input w-full" id="province_code" name="province_code" required>
@ -9,4 +9,4 @@
@endforeach
</select>
</dd>
</div>
</div>

View File

@ -1,6 +1,6 @@
<div class="px-4 py-2 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
State
{{ ctrans('texts.state') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<select class="input w-full" id="province_code" required name="province_code">
@ -9,4 +9,4 @@
@endforeach
</select>
</dd>
</div>
</div>