From abe06f3d9b341aa9990493274caa7e84281c2752 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 1 Apr 2022 09:43:25 +1100 Subject: [PATCH] fixes for seeds --- app/Jobs/Util/Import.php | 6 +++--- .../2022_03_29_014025_reverse_apple_domain_for_hosted.php | 8 ++++++-- database/seeders/CurrenciesSeeder.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 5d7692913a6e..d30948bc3b87 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1477,6 +1477,9 @@ class Import implements ShouldQueue $modified['fees_and_limits'] = $this->cleanFeesAndLimits($modified['fees_and_limits']); } + if(!array_key_exists('accepted_credit_cards', $modified) || (array_key_exists('accepted_credit_cards', $modified) && empty($modified['accepted_credit_cards']))) + $modified['accepted_credit_cards'] = 0; + // /* On Hosted platform we need to advise Stripe users to connect with Stripe Connect */ if(Ninja::isHosted() && $modified['gateway_key'] == 'd14dd26a37cecc30fdd65700bfb55b23'){ @@ -1488,9 +1491,6 @@ class Import implements ShouldQueue NinjaMailerJob::dispatch($nmo, true); $modified['gateway_key'] = 'd14dd26a47cecc30fdd65700bfb67b34'; - - //why do we set this to a blank array? - //$modified['fees_and_limits'] = []; } diff --git a/database/migrations/2022_03_29_014025_reverse_apple_domain_for_hosted.php b/database/migrations/2022_03_29_014025_reverse_apple_domain_for_hosted.php index 06a3dd87111c..684ed4cb9c34 100644 --- a/database/migrations/2022_03_29_014025_reverse_apple_domain_for_hosted.php +++ b/database/migrations/2022_03_29_014025_reverse_apple_domain_for_hosted.php @@ -34,8 +34,12 @@ class ReverseAppleDomainForHosted extends Migration }); $chf = Currency::find(17); - $chf->symbol = 'CHF'; - $chf->save(); + + if($chf) + { + $chf->symbol = 'CHF'; + $chf->save(); + } } /** diff --git a/database/seeders/CurrenciesSeeder.php b/database/seeders/CurrenciesSeeder.php index f0901e49276c..76815dfb9524 100644 --- a/database/seeders/CurrenciesSeeder.php +++ b/database/seeders/CurrenciesSeeder.php @@ -38,7 +38,7 @@ class CurrenciesSeeder extends Seeder ['id' => 14, 'name' => 'Norske Kroner', 'code' => 'NOK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 15, 'name' => 'New Zealand Dollar', 'code' => 'NZD', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 16, 'name' => 'Vietnamese Dong', 'code' => 'VND', 'symbol' => '', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','], - ['id' => 17, 'name' => 'Swiss Franc', 'code' => 'CHF', 'symbol' => '', 'precision' => '2', 'thousand_separator' => '\'', 'decimal_separator' => '.'], + ['id' => 17, 'name' => 'Swiss Franc', 'code' => 'CHF', 'symbol' => 'CHF', 'precision' => '2', 'thousand_separator' => '\'', 'decimal_separator' => '.'], ['id' => 18, 'name' => 'Guatemalan Quetzal', 'code' => 'GTQ', 'symbol' => 'Q', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 19, 'name' => 'Malaysian Ringgit', 'code' => 'MYR', 'symbol' => 'RM', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 20, 'name' => 'Brazilian Real', 'code' => 'BRL', 'symbol' => 'R$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],