1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Multi-Master Support for MySQL (#3146)

* Minor fixes for OpenAPI docs for clients

* Add fields to company transformer

* Padding email templates, system level and custom

* Minor fixes for email template subject

* Working on Email Templates

* Clean up User model, remove redundant permissions methods

* Implement Locale for API

* Implement Locale middleware for client routes

* Remove global constants

* Fixes for removing the global constants file

* Working on TDD for emails

* TDD for emails

* implement additional template variables

* Add support for Multi-Master replication with MySQL
This commit is contained in:
David Bomba 2019-12-14 16:49:48 +11:00 committed by GitHub
parent 9d8e4fdb06
commit f8551d6119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 554 additions and 319 deletions

View File

@ -3,8 +3,10 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Mail\TemplateEmail; use App\Mail\TemplateEmail;
use App\Models\Invoice;
use App\Models\User; use App\Models\User;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
class SendTestEmails extends Command class SendTestEmails extends Command
@ -71,4 +73,5 @@ class SendTestEmails extends Command
//->replyTo(also_available_if_needed) //->replyTo(also_available_if_needed)
->send(new TemplateEmail($message, $template, $user)); ->send(new TemplateEmail($message, $template, $user));
} }
} }

View File

@ -1,36 +0,0 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
/**
* GLOBAL CONSTANTS ONLY
*
* Class constants to be assigned and accessed statically via
* their model ie, Invoice::STATUS_DEFAULT
*
*/
define('BANK_LIBRARY_OFX', 1);
define('GATEWAY_TYPE_CREDIT_CARD', 1);
define('GATEWAY_TYPE_BANK_TRANSFER', 2);
define('GATEWAY_TYPE_PAYPAL', 3);
define('GATEWAY_TYPE_CRYPTO', 4);
define('GATEWAY_TYPE_DWOLLA', 5);
define('GATEWAY_TYPE_CUSTOM1', 6);
define('GATEWAY_TYPE_ALIPAY', 7);
define('GATEWAY_TYPE_SOFORT', 8);
define('GATEWAY_TYPE_SEPA', 9);
define('GATEWAY_TYPE_GOCARDLESS', 10);
define('GATEWAY_TYPE_APPLE_PAY', 11);
define('GATEWAY_TYPE_CUSTOM2', 12);
define('GATEWAY_TYPE_CUSTOM3', 13);
define('GATEWAY_TYPE_TOKEN', 'token');

View File

@ -129,12 +129,15 @@ class CompanySettings extends BaseSettings
public $require_quote_signature = false; public $require_quote_signature = false;
//email settings //email settings
public $email_sending_method = 'default'; //enum 'default','gmail'
public $gmail_sending_user_id = '0';
public $reply_to_email = ''; public $reply_to_email = '';
public $bcc_email = ''; public $bcc_email = '';
public $pdf_email_attachment = false; public $pdf_email_attachment = false;
public $ubl_email_attachment = false; public $ubl_email_attachment = false;
public $email_style = ''; //plain, light, dark, custom public $email_style = 'plain'; //plain, light, dark, custom
public $email_style_custom = ''; //the template itself public $email_style_custom = ''; //the template itself
public $email_subject_invoice = ''; public $email_subject_invoice = '';
public $email_subject_quote = ''; public $email_subject_quote = '';
@ -212,6 +215,8 @@ class CompanySettings extends BaseSettings
public static $casts = [ public static $casts = [
'email_sending_method' => 'string',
'gmail_sending_user_id' => 'string',
'currency_id' => 'string', 'currency_id' => 'string',
'counter_number_applied' => 'string', 'counter_number_applied' => 'string',
'email_subject_custom1' => 'string', 'email_subject_custom1' => 'string',

View File

@ -80,6 +80,8 @@
* @OA\Property(property="custom_fields", type="string", example="{}", description="JSON string of custom fields"), * @OA\Property(property="custom_fields", type="string", example="{}", description="JSON string of custom fields"),
* @OA\Property(property="invoice_fields", type="string", example="{}", description="JSON string of invoice fields"), * @OA\Property(property="invoice_fields", type="string", example="{}", description="JSON string of invoice fields"),
* @OA\Property(property="email_footer", type="string", example="A default email footer", description="The default email footer"), * @OA\Property(property="email_footer", type="string", example="A default email footer", description="The default email footer"),
* @OA\Property(property="email_sending_method", type="string", example="default", description="The email driver to use to send email, options include default, gmail"),
* @OA\Property(property="gmail_sending_user_id", type="string", example="F76sd34D", description="The hashed_id of the user account to send email from"),
* @OA\Property(property="email_subject_invoice", type="string", example="Your Invoice Subject", description=""), * @OA\Property(property="email_subject_invoice", type="string", example="Your Invoice Subject", description=""),
* @OA\Property(property="email_subject_quote", type="string", example="Your Quote Subject", description=""), * @OA\Property(property="email_subject_quote", type="string", example="Your Quote Subject", description=""),
* @OA\Property(property="email_subject_payment", type="string", example="Your Payment Subject", description=""), * @OA\Property(property="email_subject_payment", type="string", example="Your Payment Subject", description=""),

View File

@ -5,5 +5,6 @@
* type="object", * type="object",
* @OA\Property(property="id", type="string", example="Opnel5aKBz", description="______"), * @OA\Property(property="id", type="string", example="Opnel5aKBz", description="______"),
* @OA\Property(property="is_manual", type="boolean", example=true, description="______"), * @OA\Property(property="is_manual", type="boolean", example=true, description="______"),
* @OA\Property(property="refunded", type="number", example=10.00, description="The refunded amount of this payment"),
* ) * )
*/ */

View File

@ -253,6 +253,38 @@ class Invoice extends BaseModel
} }
} }
public static function stringStatus(int $status)
{
switch ($status) {
case Invoice::STATUS_DRAFT:
return ctrans('texts.draft');
break;
case Invoice::STATUS_SENT:
return ctrans('texts.sent');
break;
case Invoice::STATUS_PARTIAL:
return ctrans('texts.partial');
break;
case Invoice::STATUS_PAID:
return ctrans('texts.paid');
break;
case Invoice::STATUS_CANCELLED:
return ctrans('texts.cancelled');
break;
case Invoice::STATUS_OVERDUE:
return ctrans('texts.overdue');
break;
case Invoice::STATUS_UNPAID:
return ctrans('texts.unpaid');
break;
case Invoice::STATUS_REVERSED:
return ctrans('texts.reversed');
break;
default:
# code...
break;
}
}
/** /**
* Returns the template for the invoice * Returns the template for the invoice
* *
@ -428,4 +460,36 @@ class Invoice extends BaseModel
}); });
} }
/**
* @deprecated
*
* we can use the trait -> makeValues()
*
*/
public function getVariables() :array
{
return [
'$number' => $this->number,
'$amount' => $this->amount,
'$date' => $this->date,
'$due_date' => $this->due_date,
'$balance' => $this->balance,
'$status' => $this->textStatus(),
'$invoice.number' => $this->number,
'$invoice.amount' => $this->amount,
'$invoice.date' => $this->date,
'$invoice.due_date' => $this->due_date,
'$invoice.balance' => $this->balance,
'$invoice.status' => $this->textStatus(),
];
}
public function getVariableByKey($key)
{
}
} }

View File

@ -162,8 +162,10 @@ trait MakesInvoiceValues
$data = []; $data = [];
$data['$date'] = $this->date; $data['$date'] = $this->date;
$data['$invoice.date'] = &$data['$date'];
$data['$due_date'] = $this->due_date; $data['$due_date'] = $this->due_date;
$data['$invoice_number'] = $this->number; $data['$invoice.due_date'] = &$data['$due_date'];
$data['$number'] = $this->number;
$data['$po_number'] = $this->po_number; $data['$po_number'] = $this->po_number;
$data['$line_taxes'] = $this->makeLineTaxes(); $data['$line_taxes'] = $this->makeLineTaxes();
$data['$total_taxes'] = $this->makeTotalTaxes(); $data['$total_taxes'] = $this->makeTotalTaxes();
@ -175,6 +177,7 @@ trait MakesInvoiceValues
// $data['$line_total'] = ; // $data['$line_total'] = ;
// $data['$paid_to_date'] = ; // $data['$paid_to_date'] = ;
$data['$discount'] = Number::formatMoney($this->calc()->getTotalDiscount(), $this->client); $data['$discount'] = Number::formatMoney($this->calc()->getTotalDiscount(), $this->client);
$data['$invoice.discount'] = &$data['$discount'];
$data['$subtotal'] = Number::formatMoney($this->calc()->getSubTotal(), $this->client); $data['$subtotal'] = Number::formatMoney($this->calc()->getSubTotal(), $this->client);
$data['$balance_due'] = Number::formatMoney($this->balance, $this->client); $data['$balance_due'] = Number::formatMoney($this->balance, $this->client);
$data['$partial_due'] = Number::formatMoney($this->partial, $this->client); $data['$partial_due'] = Number::formatMoney($this->partial, $this->client);

View File

@ -71,9 +71,7 @@
"App\\": "app/" "App\\": "app/"
}, },
"files": [ "files": [
"app/Libraries/OFX.php", "app/Libraries/OFX.php" ]
"app/Constants.php"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {

View File

@ -38,7 +38,7 @@ return [
], ],
'i18n' => [ 'i18n' => [
'timezone_id' => env('DEFAULT_TIMEZONE', 15), 'timezone_id' => env('DEFAULT_TIMEZONE', 1),
'country_id' => env('DEFAULT_COUNTRY', 840), // United Stated 'country_id' => env('DEFAULT_COUNTRY', 840), // United Stated
'currency_id' => env('DEFAULT_CURRENCY', 1), 'currency_id' => env('DEFAULT_CURRENCY', 1),
'language_id' => env('DEFAULT_LANGUAGE', 1), //en 'language_id' => env('DEFAULT_LANGUAGE', 1), //en

View File

@ -773,6 +773,7 @@ class CreateUsersTable extends Migration
$t->unsignedInteger('payment_type_id')->nullable(); $t->unsignedInteger('payment_type_id')->nullable();
$t->unsignedInteger('status_id')->index(); $t->unsignedInteger('status_id')->index();
$t->decimal('amount', 16, 4)->default(0); $t->decimal('amount', 16, 4)->default(0);
$t->decimal('refunded', 16, 4)->default(0);
$t->datetime('payment_date')->nullable(); $t->datetime('payment_date')->nullable();
$t->string('transaction_reference')->nullable(); $t->string('transaction_reference')->nullable();
$t->string('payer_id')->nullable(); $t->string('payer_id')->nullable();
@ -792,7 +793,7 @@ class CreateUsersTable extends Migration
}); });
Schema::create('paymentables', function ($table) { //allows multiple invoices to one payment Schema::create('paymentables', function ($table) { //allows multiple invoices to one payment
// $table->increments('id'); $table->increments('id');
$table->unsignedInteger('payment_id'); $table->unsignedInteger('payment_id');
$table->unsignedInteger('paymentable_id'); $table->unsignedInteger('paymentable_id');
$table->decimal('amount', 16, 4)->default(0); $table->decimal('amount', 16, 4)->default(0);

View File

@ -142,13 +142,16 @@ class ConstantsSeeder extends Seeder
$timezones[] = ['name'=>'Pacific/Auckland', 'location' => '(GMT+12:00) Auckland', 'utc_offset' => 43200]; $timezones[] = ['name'=>'Pacific/Auckland', 'location' => '(GMT+12:00) Auckland', 'utc_offset' => 43200];
$timezones[] = ['name'=>'Pacific/Fiji', 'location' => '(GMT+12:00) Fiji', 'utc_offset' => 43200]; $timezones[] = ['name'=>'Pacific/Fiji', 'location' => '(GMT+12:00) Fiji', 'utc_offset' => 43200];
$x=1;
foreach ($timezones as $timezone) { foreach ($timezones as $timezone) {
Timezone::create([ Timezone::create([
'id' => $x,
'name' => $timezone['name'], 'name' => $timezone['name'],
'location' => $timezone['location'], 'location' => $timezone['location'],
'utc_offset' => $timezone['utc_offset'], 'utc_offset' => $timezone['utc_offset'],
]); ]);
$x++;
} }
} }

View File

@ -11,85 +11,85 @@ class CurrenciesSeeder extends Seeder
// http://www.localeplanet.com/icu/currency.html // http://www.localeplanet.com/icu/currency.html
$currencies = [ $currencies = [
['name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 1, 'name' => 'US Dollar', 'code' => 'USD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'British Pound', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 2, 'name' => 'British Pound', 'code' => 'GBP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 3, 'name' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'South African Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 4, 'name' => 'South African Rand', 'code' => 'ZAR', 'symbol' => 'R', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 5, 'name' => 'Danish Krone', 'code' => 'DKK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 6, 'name' => 'Israeli Shekel', 'code' => 'ILS', 'symbol' => 'NIS ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Swedish Krona', 'code' => 'SEK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 7, 'name' => 'Swedish Krona', 'code' => 'SEK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Kenyan Shilling', 'code' => 'KES', 'symbol' => 'KSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 8, 'name' => 'Kenyan Shilling', 'code' => 'KES', 'symbol' => 'KSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Canadian Dollar', 'code' => 'CAD', 'symbol' => 'C$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 9, 'name' => 'Canadian Dollar', 'code' => 'CAD', 'symbol' => 'C$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Philippine Peso', 'code' => 'PHP', 'symbol' => 'P ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 10, 'name' => 'Philippine Peso', 'code' => 'PHP', 'symbol' => 'P ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Indian Rupee', 'code' => 'INR', 'symbol' => 'Rs. ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 11, 'name' => 'Indian Rupee', 'code' => 'INR', 'symbol' => 'Rs. ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Australian Dollar', 'code' => 'AUD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 12, 'name' => 'Australian Dollar', 'code' => 'AUD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Singapore Dollar', 'code' => 'SGD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 13, 'name' => 'Singapore Dollar', 'code' => 'SGD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 14, 'name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'New Zealand Dollar', 'code' => 'NZD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 15, 'name' => 'New Zealand Dollar', 'code' => 'NZD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Vietnamese Dong', 'code' => 'VND', 'symbol' => '', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 16, 'name' => 'Vietnamese Dong', 'code' => 'VND', 'symbol' => '', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Swiss Franc', 'code' => 'CHF', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '\'', 'decimal_separator' => '.'], ['id' => 17, 'name' => 'Swiss Franc', 'code' => 'CHF', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '\'', 'decimal_separator' => '.'],
['name' => 'Guatemalan Quetzal', 'code' => 'GTQ', 'symbol' => 'Q', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 18, 'name' => 'Guatemalan Quetzal', 'code' => 'GTQ', 'symbol' => 'Q', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Malaysian Ringgit', 'code' => 'MYR', 'symbol' => 'RM', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 19, 'name' => 'Malaysian Ringgit', 'code' => 'MYR', 'symbol' => 'RM', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Brazilian Real', 'code' => 'BRL', 'symbol' => 'R$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 20, 'name' => 'Brazilian Real', 'code' => 'BRL', 'symbol' => 'R$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Thai Baht', 'code' => 'THB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 21, 'name' => 'Thai Baht', 'code' => 'THB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Nigerian Naira', 'code' => 'NGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 22, 'name' => 'Nigerian Naira', 'code' => 'NGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Argentine Peso', 'code' => 'ARS', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 23, 'name' => 'Argentine Peso', 'code' => 'ARS', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Bangladeshi Taka', 'code' => 'BDT', 'symbol' => 'Tk', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 24, 'name' => 'Bangladeshi Taka', 'code' => 'BDT', 'symbol' => 'Tk', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'United Arab Emirates Dirham', 'code' => 'AED', 'symbol' => 'DH ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 25, 'name' => 'United Arab Emirates Dirham', 'code' => 'AED', 'symbol' => 'DH ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Hong Kong Dollar', 'code' => 'HKD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 26, 'name' => 'Hong Kong Dollar', 'code' => 'HKD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Indonesian Rupiah', 'code' => 'IDR', 'symbol' => 'Rp', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 27, 'name' => 'Indonesian Rupiah', 'code' => 'IDR', 'symbol' => 'Rp', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Mexican Peso', 'code' => 'MXN', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 28, 'name' => 'Mexican Peso', 'code' => 'MXN', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Egyptian Pound', 'code' => 'EGP', 'symbol' => 'E£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 29, 'name' => 'Egyptian Pound', 'code' => 'EGP', 'symbol' => 'E£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Colombian Peso', 'code' => 'COP', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 30, 'name' => 'Colombian Peso', 'code' => 'COP', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'West African Franc', 'code' => 'XOF', 'symbol' => 'CFA ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 31, 'name' => 'West African Franc', 'code' => 'XOF', 'symbol' => 'CFA ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Chinese Renminbi', 'code' => 'CNY', 'symbol' => 'RMB ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 32, 'name' => 'Chinese Renminbi', 'code' => 'CNY', 'symbol' => 'RMB ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Rwandan Franc', 'code' => 'RWF', 'symbol' => 'RF ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 33, 'name' => 'Rwandan Franc', 'code' => 'RWF', 'symbol' => 'RF ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Tanzanian Shilling', 'code' => 'TZS', 'symbol' => 'TSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 34, 'name' => 'Tanzanian Shilling', 'code' => 'TZS', 'symbol' => 'TSh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Netherlands Antillean Guilder', 'code' => 'ANG', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 35, 'name' => 'Netherlands Antillean Guilder', 'code' => 'ANG', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Trinidad and Tobago Dollar', 'code' => 'TTD', 'symbol' => 'TT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 36, 'name' => 'Trinidad and Tobago Dollar', 'code' => 'TTD', 'symbol' => 'TT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'East Caribbean Dollar', 'code' => 'XCD', 'symbol' => 'EC$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 37, 'name' => 'East Caribbean Dollar', 'code' => 'XCD', 'symbol' => 'EC$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Ghanaian Cedi', 'code' => 'GHS', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 38, 'name' => 'Ghanaian Cedi', 'code' => 'GHS', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Bulgarian Lev', 'code' => 'BGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], ['id' => 39, 'name' => 'Bulgarian Lev', 'code' => 'BGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'],
['name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], ['id' => 40, 'name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'],
['name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 41, 'name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Romanian New Leu', 'code' => 'RON', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 42, 'name' => 'Romanian New Leu', 'code' => 'RON', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Croatian Kuna', 'code' => 'HRK', 'symbol' => 'kn', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 43, 'name' => 'Croatian Kuna', 'code' => 'HRK', 'symbol' => 'kn', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Saudi Riyal', 'code' => 'SAR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 44, 'name' => 'Saudi Riyal', 'code' => 'SAR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Japanese Yen', 'code' => 'JPY', 'symbol' => '¥', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 45, 'name' => 'Japanese Yen', 'code' => 'JPY', 'symbol' => '¥', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 46, 'name' => 'Maldivian Rufiyaa', 'code' => 'MVR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 47, 'name' => 'Costa Rican Colón', 'code' => 'CRC', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Pakistani Rupee', 'code' => 'PKR', 'symbol' => 'Rs ', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 48, 'name' => 'Pakistani Rupee', 'code' => 'PKR', 'symbol' => 'Rs ', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Polish Zloty', 'code' => 'PLN', 'symbol' => 'zł', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 49, 'name' => 'Polish Zloty', 'code' => 'PLN', 'symbol' => 'zł', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Sri Lankan Rupee', 'code' => 'LKR', 'symbol' => 'LKR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.', 'swap_currency_symbol' => true], ['id' => 50, 'name' => 'Sri Lankan Rupee', 'code' => 'LKR', 'symbol' => 'LKR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.', 'swap_currency_symbol' => true],
['name' => 'Czech Koruna', 'code' => 'CZK', 'symbol' => 'Kč', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 51, 'name' => 'Czech Koruna', 'code' => 'CZK', 'symbol' => 'Kč', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Uruguayan Peso', 'code' => 'UYU', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 52, 'name' => 'Uruguayan Peso', 'code' => 'UYU', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Namibian Dollar', 'code' => 'NAD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 53, 'name' => 'Namibian Dollar', 'code' => 'NAD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Tunisian Dinar', 'code' => 'TND', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 54, 'name' => 'Tunisian Dinar', 'code' => 'TND', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Russian Ruble', 'code' => 'RUB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 55, 'name' => 'Russian Ruble', 'code' => 'RUB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Mozambican Metical', 'code' => 'MZN', 'symbol' => 'MT', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 56, 'name' => 'Mozambican Metical', 'code' => 'MZN', 'symbol' => 'MT', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Omani Rial', 'code' => 'OMR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 57, 'name' => 'Omani Rial', 'code' => 'OMR', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Ukrainian Hryvnia', 'code' => 'UAH', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 58, 'name' => 'Ukrainian Hryvnia', 'code' => 'UAH', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Macanese Pataca', 'code' => 'MOP', 'symbol' => 'MOP$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 59, 'name' => 'Macanese Pataca', 'code' => 'MOP', 'symbol' => 'MOP$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Taiwan New Dollar', 'code' => 'TWD', 'symbol' => 'NT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 60, 'name' => 'Taiwan New Dollar', 'code' => 'TWD', 'symbol' => 'NT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Dominican Peso', 'code' => 'DOP', 'symbol' => 'RD$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 61, 'name' => 'Dominican Peso', 'code' => 'DOP', 'symbol' => 'RD$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Chilean Peso', 'code' => 'CLP', 'symbol' => '$', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 62, 'name' => 'Chilean Peso', 'code' => 'CLP', 'symbol' => '$', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Icelandic Króna', 'code' => 'ISK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 63, 'name' => 'Icelandic Króna', 'code' => 'ISK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Papua New Guinean Kina', 'code' => 'PGK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 64, 'name' => 'Papua New Guinean Kina', 'code' => 'PGK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Jordanian Dinar', 'code' => 'JOD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 65, 'name' => 'Jordanian Dinar', 'code' => 'JOD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Myanmar Kyat', 'code' => 'MMK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 66, 'name' => 'Myanmar Kyat', 'code' => 'MMK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Peruvian Sol', 'code' => 'PEN', 'symbol' => 'S/ ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 67, 'name' => 'Peruvian Sol', 'code' => 'PEN', 'symbol' => 'S/ ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Botswana Pula', 'code' => 'BWP', 'symbol' => 'P', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 68, 'name' => 'Botswana Pula', 'code' => 'BWP', 'symbol' => 'P', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Hungarian Forint', 'code' => 'HUF', 'symbol' => 'Ft', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 69, 'name' => 'Hungarian Forint', 'code' => 'HUF', 'symbol' => 'Ft', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true],
['name' => 'Ugandan Shilling', 'code' => 'UGX', 'symbol' => 'USh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 70, 'name' => 'Ugandan Shilling', 'code' => 'UGX', 'symbol' => 'USh ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Barbadian Dollar', 'code' => 'BBD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 71, 'name' => 'Barbadian Dollar', 'code' => 'BBD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Brunei Dollar', 'code' => 'BND', 'symbol' => 'B$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 72, 'name' => 'Brunei Dollar', 'code' => 'BND', 'symbol' => 'B$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Georgian Lari', 'code' => 'GEL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ','], ['id' => 73, 'name' => 'Georgian Lari', 'code' => 'GEL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => ','],
['name' => 'Qatari Riyal', 'code' => 'QAR', 'symbol' => 'QR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 74, 'name' => 'Qatari Riyal', 'code' => 'QAR', 'symbol' => 'QR', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Honduran Lempira', 'code' => 'HNL', 'symbol' => 'L', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 75, 'name' => 'Honduran Lempira', 'code' => 'HNL', 'symbol' => 'L', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Surinamese Dollar', 'code' => 'SRD', 'symbol' => 'SRD', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 76, 'name' => 'Surinamese Dollar', 'code' => 'SRD', 'symbol' => 'SRD', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Bahraini Dinar', 'code' => 'BHD', 'symbol' => 'BD ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 77, 'name' => 'Bahraini Dinar', 'code' => 'BHD', 'symbol' => 'BD ', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Venezuelan Bolivars', 'code' => 'VES', 'symbol' => 'Bs.', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 78, 'name' => 'Venezuelan Bolivars', 'code' => 'VES', 'symbol' => 'Bs.', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'South Korean Won', 'code' => 'KRW', 'symbol' => 'W ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ['id' => 79, 'name' => 'South Korean Won', 'code' => 'KRW', 'symbol' => 'W ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
]; ];
foreach ($currencies as $currency) { foreach ($currencies as $currency) {

View File

@ -12,19 +12,19 @@ class DateFormatsSeeder extends Seeder
// Date formats // Date formats
$formats = [ $formats = [
['format' => 'd/M/Y', 'format_moment' => 'DD/MMM/YYYY', 'format_dart' => 'dd/MMM/yyyy'], ['id' => 1, 'format' => 'd/M/Y', 'format_moment' => 'DD/MMM/YYYY', 'format_dart' => 'dd/MMM/yyyy'],
['format' => 'd-M-Y', 'format_moment' => 'DD-MMM-YYYY', 'format_dart' => 'dd-MMM-yyyy'], ['id' => 2, 'format' => 'd-M-Y', 'format_moment' => 'DD-MMM-YYYY', 'format_dart' => 'dd-MMM-yyyy'],
['format' => 'd/F/Y', 'format_moment' => 'DD/MMMM/YYYY', 'format_dart' => 'dd/MMMM/yyyy'], ['id' => 3, 'format' => 'd/F/Y', 'format_moment' => 'DD/MMMM/YYYY', 'format_dart' => 'dd/MMMM/yyyy'],
['format' => 'd-F-Y', 'format_moment' => 'DD-MMMM-YYYY', 'format_dart' => 'dd-MMMM-yyyy'], ['id' => 4, 'format' => 'd-F-Y', 'format_moment' => 'DD-MMMM-YYYY', 'format_dart' => 'dd-MMMM-yyyy'],
['format' => 'M j, Y', 'format_moment' => 'MMM D, YYYY', 'format_dart' => 'MMM d, yyyy'], ['id' => 5, 'format' => 'M j, Y', 'format_moment' => 'MMM D, YYYY', 'format_dart' => 'MMM d, yyyy'],
['format' => 'F j, Y', 'format_moment' => 'MMMM D, YYYY', 'format_dart' => 'MMMM d, yyyy'], ['id' => 6, 'format' => 'F j, Y', 'format_moment' => 'MMMM D, YYYY', 'format_dart' => 'MMMM d, yyyy'],
['format' => 'D M j, Y', 'format_moment' => 'ddd MMM Do, YYYY', 'format_dart' => 'EEE MMM d, yyyy'], ['id' => 7, 'format' => 'D M j, Y', 'format_moment' => 'ddd MMM Do, YYYY', 'format_dart' => 'EEE MMM d, yyyy'],
['format' => 'Y-m-d', 'format_moment' => 'YYYY-MM-DD', 'format_dart' => 'yyyy-MM-dd'], ['id' => 8, 'format' => 'Y-m-d', 'format_moment' => 'YYYY-MM-DD', 'format_dart' => 'yyyy-MM-dd'],
['format' => 'd-m-Y', 'format_moment' => 'DD-MM-YYYY', 'format_dart' => 'dd-MM-yyyy'], ['id' => 9, 'format' => 'd-m-Y', 'format_moment' => 'DD-MM-YYYY', 'format_dart' => 'dd-MM-yyyy'],
['format' => 'm/d/Y', 'format_moment' => 'MM/DD/YYYY', 'format_dart' => 'MM/dd/yyyy'], ['id' => 10, 'format' => 'm/d/Y', 'format_moment' => 'MM/DD/YYYY', 'format_dart' => 'MM/dd/yyyy'],
['format' => 'd.m.Y', 'format_moment' => 'D.MM.YYYY', 'format_dart' => 'dd.MM.yyyy'], ['id' => 11, 'format' => 'd.m.Y', 'format_moment' => 'D.MM.YYYY', 'format_dart' => 'dd.MM.yyyy'],
['format' => 'j. M. Y', 'format_moment' => 'DD. MMM. YYYY', 'format_dart' => 'd. MMM. yyyy'], ['id' => 12, 'format' => 'j. M. Y', 'format_moment' => 'DD. MMM. YYYY', 'format_dart' => 'd. MMM. yyyy'],
['format' => 'j. F Y', 'format_moment' => 'DD. MMMM YYYY', 'format_dart' => 'd. MMMM yyyy'], ['id' => 13, 'format' => 'j. F Y', 'format_moment' => 'DD. MMMM YYYY', 'format_dart' => 'd. MMMM yyyy'],
]; ];
foreach ($formats as $format) { foreach ($formats as $format) {
@ -41,19 +41,19 @@ class DateFormatsSeeder extends Seeder
// Date/time formats // Date/time formats
$formats = [ $formats = [
['format' => 'd/M/Y g:i a', 'format_moment' => 'DD/MMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMM/yyyy h:mm a'], ['id' => 1, 'format' => 'd/M/Y g:i a', 'format_moment' => 'DD/MMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMM/yyyy h:mm a'],
['format' => 'd-M-Y g:i a', 'format_moment' => 'DD-MMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMM-yyyy h:mm a'], ['id' => 2, 'format' => 'd-M-Y g:i a', 'format_moment' => 'DD-MMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMM-yyyy h:mm a'],
['format' => 'd/F/Y g:i a', 'format_moment' => 'DD/MMMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMMM/yyyy h:mm a'], ['id' => 3, 'format' => 'd/F/Y g:i a', 'format_moment' => 'DD/MMMM/YYYY h:mm:ss a', 'format_dart' => 'dd/MMMM/yyyy h:mm a'],
['format' => 'd-F-Y g:i a', 'format_moment' => 'DD-MMMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMMM-yyyy h:mm a'], ['id' => 4, 'format' => 'd-F-Y g:i a', 'format_moment' => 'DD-MMMM-YYYY h:mm:ss a', 'format_dart' => 'dd-MMMM-yyyy h:mm a'],
['format' => 'M j, Y g:i a', 'format_moment' => 'MMM D, YYYY h:mm:ss a', 'format_dart' => 'MMM d, yyyy h:mm a'], ['id' => 5, 'format' => 'M j, Y g:i a', 'format_moment' => 'MMM D, YYYY h:mm:ss a', 'format_dart' => 'MMM d, yyyy h:mm a'],
['format' => 'F j, Y g:i a', 'format_moment' => 'MMMM D, YYYY h:mm:ss a', 'format_dart' => 'MMMM d, yyyy h:mm a'], ['id' => 6, 'format' => 'F j, Y g:i a', 'format_moment' => 'MMMM D, YYYY h:mm:ss a', 'format_dart' => 'MMMM d, yyyy h:mm a'],
['format' => 'D M jS, Y g:i a', 'format_moment' => 'ddd MMM Do, YYYY h:mm:ss a', 'format_dart' => 'EEE MMM d, yyyy h:mm a'], ['id' => 7, 'format' => 'D M jS, Y g:i a', 'format_moment' => 'ddd MMM Do, YYYY h:mm:ss a', 'format_dart' => 'EEE MMM d, yyyy h:mm a'],
['format' => 'Y-m-d g:i a', 'format_moment' => 'YYYY-MM-DD h:mm:ss a', 'format_dart' => 'yyyy-MM-dd h:mm a'], ['id' => 8, 'format' => 'Y-m-d g:i a', 'format_moment' => 'YYYY-MM-DD h:mm:ss a', 'format_dart' => 'yyyy-MM-dd h:mm a'],
['format' => 'd-m-Y g:i a', 'format_moment' => 'DD-MM-YYYY h:mm:ss a', 'format_dart' => 'dd-MM-yyyy h:mm a'], ['id' => 9, 'format' => 'd-m-Y g:i a', 'format_moment' => 'DD-MM-YYYY h:mm:ss a', 'format_dart' => 'dd-MM-yyyy h:mm a'],
['format' => 'm/d/Y g:i a', 'format_moment' => 'MM/DD/YYYY h:mm:ss a', 'format_dart' => 'MM/dd/yyyy h:mm a'], ['id' => 10, 'format' => 'm/d/Y g:i a', 'format_moment' => 'MM/DD/YYYY h:mm:ss a', 'format_dart' => 'MM/dd/yyyy h:mm a'],
['format' => 'd.m.Y g:i a', 'format_moment' => 'D.MM.YYYY h:mm:ss a', 'format_dart' => 'dd.MM.yyyy h:mm a'], ['id' => 11, 'format' => 'd.m.Y g:i a', 'format_moment' => 'D.MM.YYYY h:mm:ss a', 'format_dart' => 'dd.MM.yyyy h:mm a'],
['format' => 'j. M. Y g:i a', 'format_moment' => 'DD. MMM. YYYY h:mm:ss a', 'format_dart' => 'd. MMM. yyyy h:mm a'], ['id' => 12, 'format' => 'j. M. Y g:i a', 'format_moment' => 'DD. MMM. YYYY h:mm:ss a', 'format_dart' => 'd. MMM. yyyy h:mm a'],
['format' => 'j. F Y g:i a', 'format_moment' => 'DD. MMMM YYYY h:mm:ss a', 'format_dart' => 'd. MMMM yyyy h:mm a'], ['id' => 13, 'format' => 'j. F Y g:i a', 'format_moment' => 'DD. MMMM YYYY h:mm:ss a', 'format_dart' => 'd. MMMM yyyy h:mm a'],
]; ];
foreach ($formats as $format) { foreach ($formats as $format) {

View File

@ -10,19 +10,19 @@ class GatewayTypesSeeder extends Seeder
Eloquent::unguard(); Eloquent::unguard();
$gateway_types = [ $gateway_types = [
['alias' => 'credit_card', 'name' => 'Credit Card'], ['id' => 1, 'alias' => 'credit_card', 'name' => 'Credit Card'],
['alias' => 'bank_transfer', 'name' => 'Bank Transfer'], ['id' => 2, 'alias' => 'bank_transfer', 'name' => 'Bank Transfer'],
['alias' => 'paypal', 'name' => 'PayPal'], ['id' => 3, 'alias' => 'paypal', 'name' => 'PayPal'],
['alias' => 'crypto', 'name' => 'Crypto'], ['id' => 4, 'alias' => 'crypto', 'name' => 'Crypto'],
['alias' => 'dwolla', 'name' => 'Dwolla'], ['id' => 5, 'alias' => 'dwolla', 'name' => 'Dwolla'],
['alias' => 'custom1', 'name' => 'Custom'], ['id' => 6, 'alias' => 'custom1', 'name' => 'Custom'],
['alias' => 'alipay', 'name' => 'Alipay'], ['id' => 7, 'alias' => 'alipay', 'name' => 'Alipay'],
['alias' => 'sofort', 'name' => 'Sofort'], ['id' => 8, 'alias' => 'sofort', 'name' => 'Sofort'],
['alias' => 'sepa', 'name' => 'SEPA'], ['id' => 9, 'alias' => 'sepa', 'name' => 'SEPA'],
['alias' => 'gocardless', 'name' => 'GoCardless'], ['id' => 10, 'alias' => 'gocardless', 'name' => 'GoCardless'],
['alias' => 'apple_pay', 'name' => 'Apple Pay'], ['id' => 11, 'alias' => 'apple_pay', 'name' => 'Apple Pay'],
['alias' => 'custom2', 'name' => 'Custom'], ['id' => 12, 'alias' => 'custom2', 'name' => 'Custom'],
['alias' => 'custom3', 'name' => 'Custom'], ['id' => 13, 'alias' => 'custom3', 'name' => 'Custom'],
]; ];
foreach ($gateway_types as $gateway_type) { foreach ($gateway_types as $gateway_type) {

View File

@ -10,39 +10,39 @@ class IndustrySeeder extends Seeder
Eloquent::unguard(); Eloquent::unguard();
$industries = [ $industries = [
['name' => 'Accounting & Legal'], ['id' => 1, 'name' => 'Accounting & Legal'],
['name' => 'Advertising'], ['id' => 2, 'name' => 'Advertising'],
['name' => 'Aerospace'], ['id' => 3, 'name' => 'Aerospace'],
['name' => 'Agriculture'], ['id' => 4, 'name' => 'Agriculture'],
['name' => 'Automotive'], ['id' => 5, 'name' => 'Automotive'],
['name' => 'Banking & Finance'], ['id' => 6, 'name' => 'Banking & Finance'],
['name' => 'Biotechnology'], ['id' => 7, 'name' => 'Biotechnology'],
['name' => 'Broadcasting'], ['id' => 8, 'name' => 'Broadcasting'],
['name' => 'Business Services'], ['id' => 9, 'name' => 'Business Services'],
['name' => 'Commodities & Chemicals'], ['id' => 10, 'name' => 'Commodities & Chemicals'],
['name' => 'Communications'], ['id' => 11, 'name' => 'Communications'],
['name' => 'Computers & Hightech'], ['id' => 12, 'name' => 'Computers & Hightech'],
['name' => 'Defense'], ['id' => 13, 'name' => 'Defense'],
['name' => 'Energy'], ['id' => 14, 'name' => 'Energy'],
['name' => 'Entertainment'], ['id' => 15, 'name' => 'Entertainment'],
['name' => 'Government'], ['id' => 16, 'name' => 'Government'],
['name' => 'Healthcare & Life Sciences'], ['id' => 17, 'name' => 'Healthcare & Life Sciences'],
['name' => 'Insurance'], ['id' => 18, 'name' => 'Insurance'],
['name' => 'Manufacturing'], ['id' => 19, 'name' => 'Manufacturing'],
['name' => 'Marketing'], ['id' => 20, 'name' => 'Marketing'],
['name' => 'Media'], ['id' => 21, 'name' => 'Media'],
['name' => 'Nonprofit & Higher Ed'], ['id' => 22, 'name' => 'Nonprofit & Higher Ed'],
['name' => 'Pharmaceuticals'], ['id' => 23, 'name' => 'Pharmaceuticals'],
['name' => 'Professional Services & Consulting'], ['id' => 24, 'name' => 'Professional Services & Consulting'],
['name' => 'Real Estate'], ['id' => 25, 'name' => 'Real Estate'],
['name' => 'Retail & Wholesale'], ['id' => 26, 'name' => 'Retail & Wholesale'],
['name' => 'Sports'], ['id' => 27, 'name' => 'Sports'],
['name' => 'Transportation'], ['id' => 28, 'name' => 'Transportation'],
['name' => 'Travel & Luxury'], ['id' => 29, 'name' => 'Travel & Luxury'],
['name' => 'Other'], ['id' => 30, 'name' => 'Other'],
['name' => 'Photography'], ['id' => 31, 'name' => 'Photography'],
['name' => 'Construction'], ['id' => 32, 'name' => 'Construction'],
['name' => 'Restaurant & Catering'], ['id' => 33, 'name' => 'Restaurant & Catering'],
]; ];
foreach ($industries as $industry) { foreach ($industries as $industry) {

View File

@ -13,34 +13,34 @@ class LanguageSeeder extends Seeder
// https://www.loc.gov/standards/iso639-2/php/code_list.php // https://www.loc.gov/standards/iso639-2/php/code_list.php
$languages = [ $languages = [
['name' => 'English', 'locale' => 'en'], ['id' => 1, 'name' => 'English', 'locale' => 'en'],
['name' => 'Italian', 'locale' => 'it'], ['id' => 2, 'name' => 'Italian', 'locale' => 'it'],
['name' => 'German', 'locale' => 'de'], ['id' => 3, 'name' => 'German', 'locale' => 'de'],
['name' => 'French', 'locale' => 'fr'], ['id' => 4, 'name' => 'French', 'locale' => 'fr'],
['name' => 'Portuguese - Brazilian', 'locale' => 'pt_BR'], ['id' => 5, 'name' => 'Portuguese - Brazilian', 'locale' => 'pt_BR'],
['name' => 'Dutch', 'locale' => 'nl'], ['id' => 6, 'name' => 'Dutch', 'locale' => 'nl'],
['name' => 'Spanish', 'locale' => 'es'], ['id' => 7, 'name' => 'Spanish', 'locale' => 'es'],
['name' => 'Norwegian', 'locale' => 'nb_NO'], ['id' => 8, 'name' => 'Norwegian', 'locale' => 'nb_NO'],
['name' => 'Danish', 'locale' => 'da'], ['id' => 9, 'name' => 'Danish', 'locale' => 'da'],
['name' => 'Japanese', 'locale' => 'ja'], ['id' => 10, 'name' => 'Japanese', 'locale' => 'ja'],
['name' => 'Swedish', 'locale' => 'sv'], ['id' => 11, 'name' => 'Swedish', 'locale' => 'sv'],
['name' => 'Spanish - Spain', 'locale' => 'es_ES'], ['id' => 12, 'name' => 'Spanish - Spain', 'locale' => 'es_ES'],
['name' => 'French - Canada', 'locale' => 'fr_CA'], ['id' => 13, 'name' => 'French - Canada', 'locale' => 'fr_CA'],
['name' => 'Lithuanian', 'locale' => 'lt'], ['id' => 14, 'name' => 'Lithuanian', 'locale' => 'lt'],
['name' => 'Polish', 'locale' => 'pl'], ['id' => 15, 'name' => 'Polish', 'locale' => 'pl'],
['name' => 'Czech', 'locale' => 'cs'], ['id' => 16, 'name' => 'Czech', 'locale' => 'cs'],
['name' => 'Croatian', 'locale' => 'hr'], ['id' => 17, 'name' => 'Croatian', 'locale' => 'hr'],
['name' => 'Albanian', 'locale' => 'sq'], ['id' => 18, 'name' => 'Albanian', 'locale' => 'sq'],
['name' => 'Greek', 'locale' => 'el'], ['id' => 19, 'name' => 'Greek', 'locale' => 'el'],
['name' => 'English - United Kingdom', 'locale' => 'en_GB'], ['id' => 20, 'name' => 'English - United Kingdom', 'locale' => 'en_GB'],
['name' => 'Portuguese - Portugal', 'locale' => 'pt_PT'], ['id' => 21, 'name' => 'Portuguese - Portugal', 'locale' => 'pt_PT'],
['name' => 'Slovenian', 'locale' => 'sl'], ['id' => 22, 'name' => 'Slovenian', 'locale' => 'sl'],
['name' => 'Finnish', 'locale' => 'fi'], ['id' => 23, 'name' => 'Finnish', 'locale' => 'fi'],
['name' => 'Romanian', 'locale' => 'ro'], ['id' => 24, 'name' => 'Romanian', 'locale' => 'ro'],
['name' => 'Turkish - Turkey', 'locale' => 'tr_TR'], ['id' => 25, 'name' => 'Turkish - Turkey', 'locale' => 'tr_TR'],
['name' => 'Thai', 'locale' => 'th'], ['id' => 26, 'name' => 'Thai', 'locale' => 'th'],
['name' => 'Macedonian', 'locale' => 'mk_MK'], ['id' => 27, 'name' => 'Macedonian', 'locale' => 'mk_MK'],
['name' => 'Chinese - Taiwan', 'locale' => 'zh_TW'], ['id' => 28, 'name' => 'Chinese - Taiwan', 'locale' => 'zh_TW'],
]; ];
foreach ($languages as $language) { foreach ($languages as $language) {

View File

@ -11,63 +11,63 @@ class PaymentLibrariesSeeder extends Seeder
Eloquent::unguard(); Eloquent::unguard();
$gateways = [ $gateways = [
['name' => 'Authorize.Net AIM', 'provider' => 'AuthorizeNet_AIM', 'sort_order' => 5, 'key' => '3b6621f970ab18887c4f6dca78d3f8bb', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"} ['id' => 1, 'name' => 'Authorize.Net AIM', 'provider' => 'AuthorizeNet_AIM', 'sort_order' => 5, 'key' => '3b6621f970ab18887c4f6dca78d3f8bb', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}
'], '],
['name' => 'CardSave', 'provider' => 'CardSave', 'key' => '46c5c1fed2c43acf4f379bae9c8b9f76', 'fields' => '{"merchantId":"","password":""} ['id' => 2, 'name' => 'CardSave', 'provider' => 'CardSave', 'key' => '46c5c1fed2c43acf4f379bae9c8b9f76', 'fields' => '{"merchantId":"","password":""}
'], '],
['name' => 'Eway Rapid', 'provider' => 'Eway_RapidShared', 'is_offsite' => true, 'key' => '944c20175bbe6b9972c05bcfe294c2c7', 'fields' => '{"apiKey":"","password":"","testMode":false}'], ['id' => 3, 'name' => 'Eway Rapid', 'provider' => 'Eway_RapidShared', 'is_offsite' => true, 'key' => '944c20175bbe6b9972c05bcfe294c2c7', 'fields' => '{"apiKey":"","password":"","testMode":false}'],
['name' => 'FirstData Connect', 'provider' => 'FirstData_Connect', 'key' => '4e0ed0d34552e6cb433506d1ac03a418', 'fields' => '{"storeId":"","sharedSecret":"","testMode":false}'], ['id' => 4, 'name' => 'FirstData Connect', 'provider' => 'FirstData_Connect', 'key' => '4e0ed0d34552e6cb433506d1ac03a418', 'fields' => '{"storeId":"","sharedSecret":"","testMode":false}'],
['name' => 'Migs ThreeParty', 'provider' => 'Migs_ThreeParty', 'key' => '513cdc81444c87c4b07258bc2858d3fa', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'], ['id' => 5, 'name' => 'Migs ThreeParty', 'provider' => 'Migs_ThreeParty', 'key' => '513cdc81444c87c4b07258bc2858d3fa', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'],
['name' => 'Migs TwoParty', 'provider' => 'Migs_TwoParty', 'key' => '99c2a271b5088951334d1302e038c01a', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'], ['id' => 6, 'name' => 'Migs TwoParty', 'provider' => 'Migs_TwoParty', 'key' => '99c2a271b5088951334d1302e038c01a', 'fields' => '{"merchantId":"","merchantAccessCode":"","secureHash":""}'],
['name' => 'Mollie', 'provider' => 'Mollie', 'is_offsite' => true, 'sort_order' => 8, 'key' => '1bd651fb213ca0c9d66ae3c336dc77e8', 'fields' => '{"apiKey":""}'], ['id' => 7, 'name' => 'Mollie', 'provider' => 'Mollie', 'is_offsite' => true, 'sort_order' => 8, 'key' => '1bd651fb213ca0c9d66ae3c336dc77e8', 'fields' => '{"apiKey":""}'],
['name' => 'MultiSafepay', 'provider' => 'MultiSafepay', 'key' => 'c3dec814e14cbd7d86abd92ce6789f8c', 'fields' => '{"accountId":"","siteId":"","siteCode":"","testMode":false}'], ['id' => 8, 'name' => 'MultiSafepay', 'provider' => 'MultiSafepay', 'key' => 'c3dec814e14cbd7d86abd92ce6789f8c', 'fields' => '{"accountId":"","siteId":"","siteCode":"","testMode":false}'],
['name' => 'Netaxept', 'provider' => 'Netaxept', 'key' => '070dffc5ca94f4e66216e44028ebd52d', 'fields' => '{"merchantId":"","password":"","testMode":false}'], ['id' => 9, 'name' => 'Netaxept', 'provider' => 'Netaxept', 'key' => '070dffc5ca94f4e66216e44028ebd52d', 'fields' => '{"merchantId":"","password":"","testMode":false}'],
['name' => 'NetBanx', 'provider' => 'NetBanx', 'key' => '334d419939c06bd99b4dfd8a49243f0f', 'fields' => '{"accountNumber":"","storeId":"","storePassword":"","testMode":false}'], ['id' => 10, 'name' => 'NetBanx', 'provider' => 'NetBanx', 'key' => '334d419939c06bd99b4dfd8a49243f0f', 'fields' => '{"accountNumber":"","storeId":"","storePassword":"","testMode":false}'],
['name' => 'PayFast', 'provider' => 'PayFast', 'is_offsite' => true, 'key' => 'd6814fc83f45d2935e7777071e629ef9', 'fields' => '{"merchantId":"","merchantKey":"","pdtKey":"","passphrase":"","testMode":false}'], ['id' => 11, 'name' => 'PayFast', 'provider' => 'PayFast', 'is_offsite' => true, 'key' => 'd6814fc83f45d2935e7777071e629ef9', 'fields' => '{"merchantId":"","merchantKey":"","pdtKey":"","passphrase":"","testMode":false}'],
['name' => 'Payflow Pro', 'provider' => 'Payflow_Pro', 'key' => '0d97c97d227f91c5d0cb86d01e4a52c9', 'fields' => '{"username":"","password":"","vendor":"","partner":"","testMode":false}'], ['id' => 12, 'name' => 'Payflow Pro', 'provider' => 'Payflow_Pro', 'key' => '0d97c97d227f91c5d0cb86d01e4a52c9', 'fields' => '{"username":"","password":"","vendor":"","partner":"","testMode":false}'],
['name' => 'PaymentExpress PxPay', 'provider' => 'PaymentExpress_PxPay', 'key' => 'a66b7062f4c8212d2c428209a34aa6bf', 'fields' => '{"username":"","password":"","pxPostUsername":"","pxPostPassword":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL], ['id' => 13, 'name' => 'PaymentExpress PxPay', 'provider' => 'PaymentExpress_PxPay', 'key' => 'a66b7062f4c8212d2c428209a34aa6bf', 'fields' => '{"username":"","password":"","pxPostUsername":"","pxPostPassword":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL],
['name' => 'PaymentExpress PxPost', 'provider' => 'PaymentExpress_PxPost', 'key' => '7e6fc08b89467518a5953a4839f8baba', 'fields' => '{"username":"","password":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL], ['id' => 14, 'name' => 'PaymentExpress PxPost', 'provider' => 'PaymentExpress_PxPost', 'key' => '7e6fc08b89467518a5953a4839f8baba', 'fields' => '{"username":"","password":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL],
['name' => 'PayPal Express', 'provider' => 'PayPal_Express', 'is_offsite' => true, 'sort_order' => 4, 'key' => '38f2c48af60c7dd69e04248cbb24c36e', 'fields' => '{"username":"","password":"","signature":"","testMode":false,"solutionType":["Sole","Mark"],"landingPage":["Billing","Login"],"brandName":"","headerImageUrl":"","logoImageUrl":"","borderColor":""}','default_gateway_type_id' => GatewayType::PAYPAL], ['id' => 15, 'name' => 'PayPal Express', 'provider' => 'PayPal_Express', 'is_offsite' => true, 'sort_order' => 4, 'key' => '38f2c48af60c7dd69e04248cbb24c36e', 'fields' => '{"username":"","password":"","signature":"","testMode":false,"solutionType":["Sole","Mark"],"landingPage":["Billing","Login"],"brandName":"","headerImageUrl":"","logoImageUrl":"","borderColor":""}','default_gateway_type_id' => GatewayType::PAYPAL],
['name' => 'PayPal Pro', 'provider' => 'PayPal_Pro', 'key' => '80af24a6a69f5c0bbec33e930ab40665', 'fields' => '{"username":"","password":"","signature":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL], ['id' => 16, 'name' => 'PayPal Pro', 'provider' => 'PayPal_Pro', 'key' => '80af24a6a69f5c0bbec33e930ab40665', 'fields' => '{"username":"","password":"","signature":"","testMode":false}','default_gateway_type_id' => GatewayType::PAYPAL],
['name' => 'Pin', 'provider' => 'Pin', 'key' => '0749cb92a6b36c88bd9ff8aabd2efcab', 'fields' => '{"secretKey":"","testMode":false}'], ['id' => 17, 'name' => 'Pin', 'provider' => 'Pin', 'key' => '0749cb92a6b36c88bd9ff8aabd2efcab', 'fields' => '{"secretKey":"","testMode":false}'],
['name' => 'SagePay Direct', 'provider' => 'SagePay_Direct', 'key' => '4c8f4e5d0f353a122045eb9a60cc0f2d', 'fields' => '{"vendor":"","testMode":false,"referrerId":""}'], ['id' => 18, 'name' => 'SagePay Direct', 'provider' => 'SagePay_Direct', 'key' => '4c8f4e5d0f353a122045eb9a60cc0f2d', 'fields' => '{"vendor":"","testMode":false,"referrerId":""}'],
['name' => 'SecurePay DirectPost', 'provider' => 'SecurePay_DirectPost', 'key' => '8036a5aadb2bdaafb23502da8790b6a2', 'fields' => '{"merchantId":"","transactionPassword":"","testMode":false,"enable_ach":"","enable_sofort":"","enable_apple_pay":"","enable_alipay":""}'], ['id' => 19, 'name' => 'SecurePay DirectPost', 'provider' => 'SecurePay_DirectPost', 'key' => '8036a5aadb2bdaafb23502da8790b6a2', 'fields' => '{"merchantId":"","transactionPassword":"","testMode":false,"enable_ach":"","enable_sofort":"","enable_apple_pay":"","enable_alipay":""}'],
['name' => 'Stripe', 'provider' => 'Stripe', 'sort_order' => 1, 'key' => 'd14dd26a37cecc30fdd65700bfb55b23', 'fields' => '{"apiKey":"", "publishableKey":""}'], ['id' => 20, 'name' => 'Stripe', 'provider' => 'Stripe', 'sort_order' => 1, 'key' => 'd14dd26a37cecc30fdd65700bfb55b23', 'fields' => '{"apiKey":"", "publishableKey":""}'],
['name' => 'TargetPay Direct eBanking', 'provider' => 'TargetPay_Directebanking', 'key' => 'd14dd26a37cdcc30fdd65700bfb55b23', 'fields' => '{"subAccountId":""}'], ['id' => 21, 'name' => 'TargetPay Direct eBanking', 'provider' => 'TargetPay_Directebanking', 'key' => 'd14dd26a37cdcc30fdd65700bfb55b23', 'fields' => '{"subAccountId":""}'],
['name' => 'TargetPay Ideal', 'provider' => 'TargetPay_Ideal', 'key' => 'ea3b328bd72d381387281c3bd83bd97c', 'fields' => '{"subAccountId":""}'], ['id' => 22, 'name' => 'TargetPay Ideal', 'provider' => 'TargetPay_Ideal', 'key' => 'ea3b328bd72d381387281c3bd83bd97c', 'fields' => '{"subAccountId":""}'],
['name' => 'TargetPay Mr Cash', 'provider' => 'TargetPay_Mrcash', 'key' => 'a0035fc0d87c4950fb82c73e2fcb825a', 'fields' => '{"subAccountId":""}'], ['id' => 23, 'name' => 'TargetPay Mr Cash', 'provider' => 'TargetPay_Mrcash', 'key' => 'a0035fc0d87c4950fb82c73e2fcb825a', 'fields' => '{"subAccountId":""}'],
['name' => 'TwoCheckout', 'provider' => 'TwoCheckout', 'is_offsite' => true, 'key' => '16dc1d3c8a865425421f64463faaf768', 'fields' => '{"accountNumber":"","secretWord":"","testMode":false}'], ['id' => 24, 'name' => 'TwoCheckout', 'provider' => 'TwoCheckout', 'is_offsite' => true, 'key' => '16dc1d3c8a865425421f64463faaf768', 'fields' => '{"accountNumber":"","secretWord":"","testMode":false}'],
['name' => 'WorldPay', 'provider' => 'WorldPay', 'key' => '43e639234f660d581ddac725ba7bcd29', 'fields' => '{"installationId":"","accountId":"","secretWord":"","callbackPassword":"","testMode":false,"noLanguageMenu":false,"fixContact":false,"hideContact":false,"hideCurrency":false,"signatureFields":"instId:amount:currency:cartId"}'], ['id' => 25, 'name' => 'WorldPay', 'provider' => 'WorldPay', 'key' => '43e639234f660d581ddac725ba7bcd29', 'fields' => '{"installationId":"","accountId":"","secretWord":"","callbackPassword":"","testMode":false,"noLanguageMenu":false,"fixContact":false,"hideContact":false,"hideCurrency":false,"signatureFields":"instId:amount:currency:cartId"}'],
['name' => 'moolah', 'provider' => 'AuthorizeNet_AIM', 'key' => '2f71dc17b0158ac30a7ae0839799e888', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}'], ['id' => 26, 'name' => 'moolah', 'provider' => 'AuthorizeNet_AIM', 'key' => '2f71dc17b0158ac30a7ae0839799e888', 'fields' => '{"apiLoginId":"","transactionKey":"","testMode":false,"developerMode":false,"liveEndpoint":"https:\/\/api2.authorize.net\/xml\/v1\/request.api","developerEndpoint":"https:\/\/apitest.authorize.net\/xml\/v1\/request.api"}'],
['name' => 'Alipay', 'provider' => 'Alipay_Express', 'key' => '733998ee4760b10f11fb48652571e02c', 'fields' => '{"partner":"","key":"","signType":"MD5","inputCharset":"utf-8","transport":"http","paymentType":1,"itBPay":"1d"}'], ['id' => 27, 'name' => 'Alipay', 'provider' => 'Alipay_Express', 'key' => '733998ee4760b10f11fb48652571e02c', 'fields' => '{"partner":"","key":"","signType":"MD5","inputCharset":"utf-8","transport":"http","paymentType":1,"itBPay":"1d"}'],
['name' => 'Buckaroo', 'provider' => 'Buckaroo_CreditCard', 'key' => '6312879223e49c5cf92e194646bdee8f', 'fields' => '{"websiteKey":"","secretKey":"","testMode":false}'], ['id' => 28, 'name' => 'Buckaroo', 'provider' => 'Buckaroo_CreditCard', 'key' => '6312879223e49c5cf92e194646bdee8f', 'fields' => '{"websiteKey":"","secretKey":"","testMode":false}'],
['name' => 'Coinbase', 'provider' => 'Coinbase', 'is_offsite' => true, 'key' => '106ef7e7da9062b0df363903b455711c', 'fields' => '{"apiKey":"","secret":"","accountId":""}'], ['id' => 29, 'name' => 'Coinbase', 'provider' => 'Coinbase', 'is_offsite' => true, 'key' => '106ef7e7da9062b0df363903b455711c', 'fields' => '{"apiKey":"","secret":"","accountId":""}'],
['name' => 'DataCash', 'provider' => 'DataCash', 'key' => 'e9a38f0896b5b82d196be3b7020c8664', 'fields' => '{"merchantId":"","password":"","testMode":false}'], ['id' => 30, 'name' => 'DataCash', 'provider' => 'DataCash', 'key' => 'e9a38f0896b5b82d196be3b7020c8664', 'fields' => '{"merchantId":"","password":"","testMode":false}'],
['name' => 'Pacnet', 'provider' => 'Pacnet', 'key' => '0da4e18ed44a5bd5c8ec354d0ab7b301', 'fields' => '{"username":"","sharedSecret":"","paymentRoutingNumber":"","testMode":false}'], ['id' => 31, 'name' => 'Pacnet', 'provider' => 'Pacnet', 'key' => '0da4e18ed44a5bd5c8ec354d0ab7b301', 'fields' => '{"username":"","sharedSecret":"","paymentRoutingNumber":"","testMode":false}'],
['name' => 'Realex', 'provider' => 'Realex_Remote', 'key' => 'd3979e62eb603fbdf1c78fe3a8ba7009', 'fields' => '{"merchantId":"","account":"","secret":"","3dSecure":0}'], ['id' => 32, 'name' => 'Realex', 'provider' => 'Realex_Remote', 'key' => 'd3979e62eb603fbdf1c78fe3a8ba7009', 'fields' => '{"merchantId":"","account":"","secret":"","3dSecure":0}'],
['name' => 'Sisow', 'provider' => 'Sisow', 'key' => '557d98977e7ec02dfa53de4b69b335be', 'fields' => '{"shopId":"","merchantId":""}'], ['id' => 33, 'name' => 'Sisow', 'provider' => 'Sisow', 'key' => '557d98977e7ec02dfa53de4b69b335be', 'fields' => '{"shopId":"","merchantId":""}'],
['name' => 'Skrill', 'provider' => 'Skrill', 'is_offsite' => true, 'key' => '54dc60c869a7322d87efbec5c0c25805', 'fields' => '{"email":"","notifyUrl":"","testMode":false}'], ['id' => 34, 'name' => 'Skrill', 'provider' => 'Skrill', 'is_offsite' => true, 'key' => '54dc60c869a7322d87efbec5c0c25805', 'fields' => '{"email":"","notifyUrl":"","testMode":false}'],
['name' => 'BitPay', 'provider' => 'BitPay', 'is_offsite' => true, 'sort_order' => 7, 'key' => 'e4a02f0a4b235eb5e9e294730703bb74', 'fields' => '{"apiKey":"","testMode":false}'], ['id' => 35, 'name' => 'BitPay', 'provider' => 'BitPay', 'is_offsite' => true, 'sort_order' => 7, 'key' => 'e4a02f0a4b235eb5e9e294730703bb74', 'fields' => '{"apiKey":"","testMode":false}'],
['name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'], ['id' => 36, 'name' => 'AGMS', 'provider' => 'Agms', 'key' => '1b3c6f3ccfea4f5e7eadeae188cccd7f', 'fields' => '{"username":"","password":"","apiKey":"","accountNumber":""}'],
['name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'], ['id' => 37, 'name' => 'Barclays', 'provider' => 'BarclaysEpdq\Essential', 'key' => '7cba6ce5c125f9cb47ea8443ae671b68', 'fields' => '{"clientId":"","testMode":false,"language":"en_US","callbackMethod":"POST"}'],
['name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'], ['id' => 38, 'name' => 'Cardgate', 'provider' => 'Cardgate', 'key' => 'b98cfa5f750e16cee3524b7b7e78fbf6', 'fields' => '{"merchantId":"","language":"nl","apiKey":"","siteId":"","notifyUrl":"","returnUrl":"","cancelUrl":"","testMode":false}'],
['name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false}'], ['id' => 39, 'name' => 'Checkout.com', 'provider' => 'CheckoutCom', 'key' => '3758e7f7c6f4cecf0f4f348b9a00f456', 'fields' => '{"secretApiKey":"","publicApiKey":"","testMode":false}'],
['name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'], ['id' => 40, 'name' => 'Creditcall', 'provider' => 'Creditcall', 'key' => 'cbc7ef7c99d31ec05492fbcb37208263', 'fields' => '{"terminalId":"","transactionKey":"","testMode":false,"verifyCvv":true,"verifyAddress":false,"verifyZip":false}'],
['name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'], ['id' => 41, 'name' => 'Cybersource', 'provider' => 'Cybersource', 'key' => 'e186a98d3b079028a73390bdc11bdb82', 'fields' => '{"profileId":"","secretKey":"","accessKey":"","testMode":false}'],
['name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'], ['id' => 42, 'name' => 'ecoPayz', 'provider' => 'Ecopayz', 'key' => '761040aca40f685d1ab55e2084b30670', 'fields' => '{"merchantId":"","merchantPassword":"","merchantAccountNumber":"","testMode":false}'],
['name' => 'Fasapay', 'provider' => 'Fasapay', 'key' => '1b2cef0e8c800204a29f33953aaf3360', 'fields' => ''], ['id' => 43, 'name' => 'Fasapay', 'provider' => 'Fasapay', 'key' => '1b2cef0e8c800204a29f33953aaf3360', 'fields' => ''],
['name' => 'Komoju', 'provider' => 'Komoju', 'key' => '7ea2d40ecb1eb69ef8c3d03e5019028a', 'fields' => '{"apiKey":"","accountId":"","paymentMethod":"credit_card","testMode":false,"locale":"en"}'], ['id' => 44, 'name' => 'Komoju', 'provider' => 'Komoju', 'key' => '7ea2d40ecb1eb69ef8c3d03e5019028a', 'fields' => '{"apiKey":"","accountId":"","paymentMethod":"credit_card","testMode":false,"locale":"en"}'],
['name' => 'Paysafecard', 'provider' => 'Paysafecard', 'key' => '70ab90cd6c5c1ab13208b3cef51c0894', 'fields' => '{"username":"","password":"","testMode":false}'], ['id' => 45, 'name' => 'Paysafecard', 'provider' => 'Paysafecard', 'key' => '70ab90cd6c5c1ab13208b3cef51c0894', 'fields' => '{"username":"","password":"","testMode":false}'],
['name' => 'Paytrace', 'provider' => 'Paytrace_CreditCard', 'key' => 'bbd736b3254b0aabed6ad7fda1298c88', 'fields' => '{"username":"","password":"","testMode":false,"endpoint":"https:\/\/paytrace.com\/api\/default.pay"}'], ['id' => 46, 'name' => 'Paytrace', 'provider' => 'Paytrace_CreditCard', 'key' => 'bbd736b3254b0aabed6ad7fda1298c88', 'fields' => '{"username":"","password":"","testMode":false,"endpoint":"https:\/\/paytrace.com\/api\/default.pay"}'],
['name' => 'Secure Trading', 'provider' => 'SecureTrading', 'key' => '231cb401487b9f15babe04b1ac4f7a27', 'fields' => '{"siteReference":"","username":"","password":"","applyThreeDSecure":false,"accountType":"ECOM"}'], ['id' => 47, 'name' => 'Secure Trading', 'provider' => 'SecureTrading', 'key' => '231cb401487b9f15babe04b1ac4f7a27', 'fields' => '{"siteReference":"","username":"","password":"","applyThreeDSecure":false,"accountType":"ECOM"}'],
['name' => 'SecPay', 'provider' => 'SecPay', 'key' => 'bad8699d581d9fa040e59c0bb721a76c', 'fields' => '{"mid":"","vpnPswd":"","remotePswd":"","usageType":"","confirmEmail":"","testStatus":"true","mailCustomer":"true","additionalOptions":""}'], ['id' => 48, 'name' => 'SecPay', 'provider' => 'SecPay', 'key' => 'bad8699d581d9fa040e59c0bb721a76c', 'fields' => '{"mid":"","vpnPswd":"","remotePswd":"","usageType":"","confirmEmail":"","testStatus":"true","mailCustomer":"true","additionalOptions":""}'],
['name' => 'WePay', 'provider' => 'WePay', 'is_offsite' => false, 'sort_order' => 3, 'key' => '8fdeed552015b3c7b44ed6c8ebd9e992', 'fields' => '{"accountId":"","accessToken":"","type":"goods","testMode":false,"feePayer":"payee"}'], ['id' => 49, 'name' => 'WePay', 'provider' => 'WePay', 'is_offsite' => false, 'sort_order' => 3, 'key' => '8fdeed552015b3c7b44ed6c8ebd9e992', 'fields' => '{"accountId":"","accessToken":"","type":"goods","testMode":false,"feePayer":"payee"}'],
['name' => 'Braintree', 'provider' => 'Braintree', 'sort_order' => 3, 'key' => 'f7ec488676d310683fb51802d076d713', 'fields' => '{"merchantId":"","publicKey":"","privateKey":"","testMode":false}'], ['id' => 50, 'name' => 'Braintree', 'provider' => 'Braintree', 'sort_order' => 3, 'key' => 'f7ec488676d310683fb51802d076d713', 'fields' => '{"merchantId":"","publicKey":"","privateKey":"","testMode":false}'],
['name' => 'FirstData Payeezy', 'provider' => 'FirstData_Payeezy', 'key' => '30334a52fb698046572c627ca10412e8', 'fields' => '{"gatewayId":"","password":"","keyId":"","hmac":"","testMode":false}'], ['id' => 51, 'name' => 'FirstData Payeezy', 'provider' => 'FirstData_Payeezy', 'key' => '30334a52fb698046572c627ca10412e8', 'fields' => '{"gatewayId":"","password":"","keyId":"","hmac":"","testMode":false}'],
['name' => 'GoCardless', 'provider' => 'GoCardlessV2\Redirect', 'sort_order' => 9, 'is_offsite' => true, 'key' => 'b9886f9257f0c6ee7c302f1c74475f6c', 'fields' => '{"accessToken":"","webhookSecret":"","testMode":true}'], ['id' => 52, 'name' => 'GoCardless', 'provider' => 'GoCardlessV2\Redirect', 'sort_order' => 9, 'is_offsite' => true, 'key' => 'b9886f9257f0c6ee7c302f1c74475f6c', 'fields' => '{"accessToken":"","webhookSecret":"","testMode":true}'],
['name' => 'PagSeguro', 'provider' => 'PagSeguro', 'key' => 'ef498756b54db63c143af0ec433da803', 'fields' => '{"email":"","token":"","sandbox":false}'], ['id' => 53, 'name' => 'PagSeguro', 'provider' => 'PagSeguro', 'key' => 'ef498756b54db63c143af0ec433da803', 'fields' => '{"email":"","token":"","sandbox":false}'],
['name' => 'PAYMILL', 'provider' => 'Paymill', 'key' => 'ca52f618a39367a4c944098ebf977e1c', 'fields' => '{"apiKey":""}'], ['id' => 54, 'name' => 'PAYMILL', 'provider' => 'Paymill', 'key' => 'ca52f618a39367a4c944098ebf977e1c', 'fields' => '{"apiKey":""}'],
['name' => 'Custom', 'provider' => 'Custom', 'is_offsite' => true, 'sort_order' => 21, 'key' => '54faab2ab6e3223dbe848b1686490baa', 'fields' => '{"name":"","text":""}'], ['id' => 55, 'name' => 'Custom', 'provider' => 'Custom', 'is_offsite' => true, 'sort_order' => 21, 'key' => '54faab2ab6e3223dbe848b1686490baa', 'fields' => '{"name":"","text":""}'],
]; ];
foreach ($gateways as $gateway) { foreach ($gateways as $gateway) {

View File

@ -5,56 +5,77 @@ use Illuminate\Database\Seeder;
class PaymentTypesSeeder extends Seeder class PaymentTypesSeeder extends Seeder
{ {
const BANK_LIBRARY_OFX = 1;
const GATEWAY_TYPE_CREDIT_CARD = 1;
const GATEWAY_TYPE_BANK_TRANSFER = 2;
const GATEWAY_TYPE_PAYPAL = 3;
const GATEWAY_TYPE_CRYPTO = 4;
const GATEWAY_TYPE_DWOLLA = 5;
const GATEWAY_TYPE_CUSTOM1 = 6;
const GATEWAY_TYPE_ALIPAY = 7;
const GATEWAY_TYPE_SOFORT = 8;
const GATEWAY_TYPE_SEPA = 9;
const GATEWAY_TYPE_GOCARDLESS = 10;
const GATEWAY_TYPE_APPLE_PAY = 11;
const GATEWAY_TYPE_CUSTOM2 = 12;
const GATEWAY_TYPE_CUSTOM3 = 13;
public function run() public function run()
{ {
Eloquent::unguard(); Eloquent::unguard();
$paymentTypes = [ $paymentTypes = [
['name' => 'Apply Credit'], ['name' => 'Apply Credit'],
['name' => 'Bank Transfer', 'gateway_type_id' => GATEWAY_TYPE_BANK_TRANSFER], ['name' => 'Bank Transfer', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
['name' => 'Cash'], ['name' => 'Cash'],
['name' => 'Debit', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Debit', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'ACH', 'gateway_type_id' => GATEWAY_TYPE_BANK_TRANSFER], ['name' => 'ACH', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
['name' => 'Visa Card', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Visa Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'MasterCard', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'MasterCard', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'American Express', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'American Express', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Discover Card', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Discover Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Diners Card', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Diners Card', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'EuroCard', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'EuroCard', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Nova', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Nova', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Credit Card Other', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Credit Card Other', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'PayPal', 'gateway_type_id' => GATEWAY_TYPE_PAYPAL], ['name' => 'PayPal', 'gateway_type_id' => self::GATEWAY_TYPE_PAYPAL],
['name' => 'Google Wallet'], ['name' => 'Google Wallet'],
['name' => 'Check'], ['name' => 'Check'],
['name' => 'Carte Blanche', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Carte Blanche', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'UnionPay', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'UnionPay', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'JCB', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'JCB', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Laser', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Laser', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Maestro', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Maestro', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Solo', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Solo', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Switch', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'Switch', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'iZettle', 'gateway_type_id' => GATEWAY_TYPE_CREDIT_CARD], ['name' => 'iZettle', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT_CARD],
['name' => 'Swish', 'gateway_type_id' => GATEWAY_TYPE_BANK_TRANSFER], ['name' => 'Swish', 'gateway_type_id' => self::GATEWAY_TYPE_BANK_TRANSFER],
['name' => 'Venmo'], ['name' => 'Venmo'],
['name' => 'Money Order'], ['name' => 'Money Order'],
['name' => 'Alipay', 'gateway_type_id' => GATEWAY_TYPE_ALIPAY], ['name' => 'Alipay', 'gateway_type_id' => self::GATEWAY_TYPE_ALIPAY],
['name' => 'Sofort', 'gateway_type_id' => GATEWAY_TYPE_SOFORT], ['name' => 'Sofort', 'gateway_type_id' => self::GATEWAY_TYPE_SOFORT],
['name' => 'SEPA', 'gateway_type_id' => GATEWAY_TYPE_SEPA], ['name' => 'SEPA', 'gateway_type_id' => self::GATEWAY_TYPE_SEPA],
['name' => 'GoCardless', 'gateway_type_id' => GATEWAY_TYPE_GOCARDLESS], ['name' => 'GoCardless', 'gateway_type_id' => self::GATEWAY_TYPE_GOCARDLESS],
['name' => 'Crypto', 'gateway_type_id' => GATEWAY_TYPE_CRYPTO], ['name' => 'Crypto', 'gateway_type_id' => self::GATEWAY_TYPE_CRYPTO],
]; ];
$x=1;
foreach ($paymentTypes as $paymentType) { foreach ($paymentTypes as $paymentType) {
$record = PaymentType::where('name', '=', $paymentType['name'])->first(); $record = PaymentType::where('name', '=', $paymentType['name'])->first();
if ($record) { if ($record) {
$record->id = $x;
$record->name = $paymentType['name']; $record->name = $paymentType['name'];
$record->gateway_type_id = ! empty($paymentType['gateway_type_id']) ? $paymentType['gateway_type_id'] : null; $record->gateway_type_id = ! empty($paymentType['gateway_type_id']) ? $paymentType['gateway_type_id'] : null;
$record->save(); $record->save();
} else { } else {
$paymentType['id'] = $x;
PaymentType::create($paymentType); PaymentType::create($paymentType);
} }
$x++;
} }
} }
} }

View File

@ -1,4 +1,4 @@
{{ $body }} {{ $body }}
<br> <br>
<br> <br>
{{ $footer}} {{ $footer }}

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>$invoice_number</title> <title>$number</title>
<link href="{{asset('/vendors/css/bootstrap.min.css') }}" rel="stylesheet"> <link href="{{asset('/vendors/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{asset('/vendors/css/coreui.min.css') }}" rel="stylesheet"> <link href="{{asset('/vendors/css/coreui.min.css') }}" rel="stylesheet">
<style> <style>
@ -62,9 +62,9 @@
</div> </div>
<div class="col-md-4 ml-auto"> <div class="col-md-4 ml-auto">
$invoice_number_label: $invoice_number <br> $number_label: $number <br>
$invoice_date_label: $invoice_date <br> $date_label: $date <br>
$invoice_due_date_label: $due_date $due_date_label: $due_date
</div> </div>
</div> </div>

View File

@ -244,10 +244,10 @@ class ClientTest extends TestCase
$this->assertNotNull($client); $this->assertNotNull($client);
/* Make sure we have a valid settings object*/ /* Make sure we have a valid settings object*/
$this->assertEquals($client->getSetting('timezone_id'), 15); $this->assertEquals($client->getSetting('timezone_id'), 1);
/* Make sure we are harvesting valid data */ /* Make sure we are harvesting valid data */
$this->assertEquals($client->timezone()->name, 'US/Eastern'); $this->assertEquals($client->timezone()->name, 'Pacific/Midway');
/* Make sure NULL settings return the correct count (0) instead of throwing an exception*/ /* Make sure NULL settings return the correct count (0) instead of throwing an exception*/
$this->assertEquals($client->contacts->count(), 3); $this->assertEquals($client->contacts->count(), 3);

View File

@ -17,6 +17,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
use Illuminate\Validation\ValidationException;
use Tests\MockAccountData; use Tests\MockAccountData;
use Tests\TestCase; use Tests\TestCase;
@ -43,6 +44,7 @@ class CompanySettingsTest extends TestCase
Model::reguard(); Model::reguard();
} }
public function testClientNumberCantBeModified() public function testClientNumberCantBeModified()
@ -53,17 +55,29 @@ class CompanySettingsTest extends TestCase
$this->company->saveSettings($settings, $this->company); $this->company->saveSettings($settings, $this->company);
$response = $this->withHeaders([ //$this->withoutExceptionHandling();
$response = false;
try {
$response = $this->withHeaders([
'X-API-SECRET' => config('ninja.api_secret'), 'X-API-SECRET' => config('ninja.api_secret'),
'X-API-Token' => $this->token, 'X-API-Token' => $this->token,
])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $this->company->toArray()); ])->put('/api/v1/companies/'.$this->encodePrimaryKey($this->company->id), $this->company->toArray());
}
catch(ValidationException $e) {
$message = json_decode($e->validator->getMessageBag(),1);
\Log::error($message);
}
$response->assertStatus(200); if($response) {
$response->assertStatus(200);
$arr = $response->json(); $arr = $response->json();
$this->assertEquals($arr['data']['settings']['timezone_id'],15); $this->assertEquals($arr['data']['settings']['timezone_id'],1);
}
} }
public function testNullValuesInSettings() public function testNullValuesInSettings()

View File

@ -0,0 +1,151 @@
<?php
namespace Feature;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Session;
use Tests\MockAccountData;
use Tests\TestCase;
/**
* @test
*/
class InvoiceEmailTest extends TestCase
{
use MockAccountData;
use DatabaseTransactions;
public function setUp() :void
{
parent::setUp();
Session::start();
$this->faker = \Faker\Factory::create();
Model::reguard();
$this->makeTestData();
}
public function test_initial_email_sends()
{
\Log::error($this->invoice->makeValues());
}
//TDD
/**
* Builds the correct template to send
* @param App\Models\Invoice $invoice The Invoice Model
* @param string $reminder_template The template name ie reminder1
* @return void
*/
private function invoiceEmailWorkFlow($invoice, $reminder_template = null)
{
//client
$client = $invoice->client;
$template_style = $client->getSetting('email_style');
if(!$reminder_template)
$reminder_template = $this->calculateTemplate($invoice);
//Need to determine which email template we are producing
$email_data = $this->generateTemplateData($invoice, $reminder_template);
}
private function generateTemplateData(Invoice $invoice, string $reminder_template) :array
{
$data = [];
$client = $invoice->client;
$body_template = $client->getSetting('email_template_'.$reminder_template);
$subject_template = $client->getSetting('email_subject_'.$reminder_template);
$data['message'] = $this->parseTemplate($invoice, $body_template);
$data['subject'] = $this->parseTemplate($invoice, $subject_template);
return $data;
}
private function parseTemplate($invoice, $template_data) :string
{
//process variables
//process markdown
}
private function calculateTemplate(Invoice $invoice) :string
{
//if invoice is currently a draft, or being marked as sent, this will be the initial email
$client = $invoice->client;
//if the invoice
if($invoice->status_id == Invoice::STATUS_DRAFT || Carbon::parse($invoice->due_date) > now())
{
return 'invoice';
}
else if($client->getSetting('enable_reminder1') !== false && $this->inReminderWindow($invoice, $client->getSetting('schedule_reminder1'), $client->getSetting('num_days_reminder1')))
{
return 'template1';
}
else if($client->getSetting('enable_reminder2') !== false && $this->inReminderWindow($invoice, $client->getSetting('schedule_reminder2'), $client->getSetting('num_days_reminder2')))
{
return 'template2';
}
else if($client->getSetting('enable_reminder3') !== false && $this->inReminderWindow($invoice, $client->getSetting('schedule_reminder3'), $client->getSetting('num_days_reminder3')))
{
return 'template3';
}
//also implement endless reminders here
//
}
private function inReminderWindow($invoice, $schedule_reminder, $num_days_reminder)
{
switch ($schedule_reminder) {
case 'after_invoice_date':
return Carbon::parse($invoice->date)->addDays($num_days_reminder)->startOfDay()->eq(Carbon::now()->startOfDay());
break;
case 'before_due_date':
return Carbon::parse($invoice->due_date)->subDays($num_days_reminder)->startOfDay()->eq(Carbon::now()->startOfDay());
break;
case 'after_due_date':
return Carbon::parse($invoice->due_date)->addDays($num_days_reminder)->startOfDay()->eq(Carbon::now()->startOfDay());
break;
default:
# code...
break;
}
}
}

View File

@ -3,8 +3,8 @@
namespace Feature; namespace Feature;
use App\Factory\UserFactory;
use App\Factory\CompanyUserFactory; use App\Factory\CompanyUserFactory;
use App\Factory\UserFactory;
use App\Models\Account; use App\Models\Account;
use App\Models\Activity; use App\Models\Activity;
use App\Models\Company; use App\Models\Company;
@ -18,6 +18,7 @@ use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase; use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\Session;
use Tests\MockAccountData; use Tests\MockAccountData;
use Tests\TestCase; use Tests\TestCase;
@ -42,6 +43,10 @@ class UserTest extends TestCase
Model::reguard(); Model::reguard();
$this->makeTestData(); $this->makeTestData();
$this->withoutMiddleware(
ThrottleRequests::class
);
} }
public function testUserList() public function testUserList()

View File

@ -24,7 +24,7 @@ class CompanySettingsTest extends TestCase
public function testTimezoneId() public function testTimezoneId()
{ {
$this->assertEquals($this->company_settings->timezone_id, 15); $this->assertEquals($this->company_settings->timezone_id, 1);
} }

View File

@ -45,7 +45,7 @@ class CompareObjectTest extends TestCase
$build_client_settings = $this->buildClientSettings(); $build_client_settings = $this->buildClientSettings();
$this->assertEquals($build_client_settings->timezone_id, 15); $this->assertEquals($build_client_settings->timezone_id, 1);
$this->assertEquals($build_client_settings->language_id, 1); $this->assertEquals($build_client_settings->language_id, 1);
$this->assertEquals($build_client_settings->payment_terms, 1); $this->assertEquals($build_client_settings->payment_terms, 1);
} }
@ -54,7 +54,7 @@ class CompareObjectTest extends TestCase
{ {
$settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults()); $settings = ClientSettings::buildClientSettings(CompanySettings::defaults(), ClientSettings::defaults());
$this->assertEquals($settings->timezone_id, 15); $this->assertEquals($settings->timezone_id, 1);
$this->assertEquals($settings->language_id, 1); $this->assertEquals($settings->language_id, 1);
$this->assertEquals($settings->payment_terms, 1); $this->assertEquals($settings->payment_terms, 1);
$this->assertFalse($settings->send_portal_password); $this->assertFalse($settings->send_portal_password);