From c28321a22ac70be711ebde25514aab323140bcb3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Jul 2021 08:11:43 +1000 Subject: [PATCH 1/5] Minor fixes for subscription activities --- app/Listeners/Activity/SubscriptionArchivedActivity.php | 2 +- app/PaymentDrivers/StripePaymentDriver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Listeners/Activity/SubscriptionArchivedActivity.php b/app/Listeners/Activity/SubscriptionArchivedActivity.php index f1f0502c7ae8..0412cecc16fd 100644 --- a/app/Listeners/Activity/SubscriptionArchivedActivity.php +++ b/app/Listeners/Activity/SubscriptionArchivedActivity.php @@ -50,7 +50,7 @@ $user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars[ $fields->subscription_id = $subscription->id; $fields->user_id = $user_id; $fields->company_id = $subscription->company_id; - $fields->activity_type_id = Activity::ARCHIVE_SUBSCRIPTIOn; + $fields->activity_type_id = Activity::ARCHIVE_SUBSCRIPTION; $this->activity_repo->save($fields, $subscription, $event->event_vars); } diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 3075c8ef4c8d..f2e8b8f5e78d 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -114,7 +114,7 @@ class StripePaymentDriver extends BaseDriver public function gatewayTypes(): array { $types = [ - GatewayType::CRYPTO, + // GatewayType::CRYPTO, GatewayType::CREDIT_CARD ]; From dd3f33dfc8f4dd28d740d6adbbd5dc879270dcd6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Jul 2021 08:18:57 +1000 Subject: [PATCH 2/5] Log user in on signup --- app/Jobs/Account/CreateAccount.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Account/CreateAccount.php b/app/Jobs/Account/CreateAccount.php index 8e356babd8b4..9ea168d03ed3 100644 --- a/app/Jobs/Account/CreateAccount.php +++ b/app/Jobs/Account/CreateAccount.php @@ -28,6 +28,7 @@ use App\Models\Account; use App\Models\Timezone; use App\Notifications\Ninja\NewAccountCreated; use App\Utils\Ninja; +use App\Utils\Traits\User\LoginCache; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -39,6 +40,7 @@ use Turbo124\Beacon\Facades\LightLogs; class CreateAccount { use Dispatchable; + use LoginCache; protected $request; @@ -77,9 +79,6 @@ class CreateAccount $sp794f3f->save(); - if(Ninja::isHosted()) - $sp794f3f->startTrial('pro'); - $sp035a66 = CreateCompany::dispatchNow($this->request, $sp794f3f); $sp035a66->load('account'); $sp794f3f->default_company_id = $sp035a66->id; @@ -95,6 +94,8 @@ class CreateAccount } $spaa9f78->setCompany($sp035a66); + $this->setLoginCache($spaa9f78); + $spafe62e = isset($this->request['token_name']) ? $this->request['token_name'] : request()->server('HTTP_USER_AGENT'); $sp2d97e8 = CreateCompanyToken::dispatchNow($sp035a66, $spaa9f78, $spafe62e); From 852461541ed6504d622cb92b61663c25df29ceef Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Jul 2021 20:45:40 +1000 Subject: [PATCH 3/5] Minor fixes --- app/Models/User.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index 8c6ad83f8df9..a7e34827cb59 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -161,6 +161,8 @@ class User extends Authenticatable implements MustVerifyEmail public function setCompany($company) { $this->company = $company; + + return $this; } /** From fe2448196fcc519d3c8af37766c6039ff0c0e72f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Jul 2021 21:58:22 +1000 Subject: [PATCH 4/5] Fixes for scheduler check --- app/Console/Kernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7c777677086e..a97b90b1730c 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -64,7 +64,7 @@ class Kernel extends ConsoleKernel $schedule->job(new AutoBillCron)->dailyAt('00:30')->withoutOverlapping(); - $schedule->job(new SchedulerCheck)->everyFiveMinutes(); + $schedule->job(new SchedulerCheck)->daily()->withoutOverlapping(); /* Run hosted specific jobs */ if (Ninja::isHosted()) { From 7fb41b7d602eeb805de16658b22a93019871cf71 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 6 Jul 2021 07:53:32 +1000 Subject: [PATCH 5/5] Fixes for mime types --- app/Jobs/Company/CompanyImport.php | 4 ++-- app/Services/Client/ClientService.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Company/CompanyImport.php b/app/Jobs/Company/CompanyImport.php index 216ab6a1224e..2d626404e436 100644 --- a/app/Jobs/Company/CompanyImport.php +++ b/app/Jobs/Company/CompanyImport.php @@ -221,8 +221,8 @@ class CompanyImport implements ShouldQueue private function unzipFile() { - if(mime_content_type(Storage::path($this->file_location)) == 'text/plain') - return Storage::path($this->file_location); + // if(mime_content_type(Storage::path($this->file_location)) == 'text/plain') + // return Storage::path($this->file_location); $path = TempFile::filePath(Storage::get($this->file_location), basename($this->file_location)); diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index a33a576909f2..d12bc48ea930 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -60,7 +60,7 @@ class ClientService return Number::roundValue($credits->sum('balance'), $this->client->currency()->precision); } - public function getCredits() :Collection + public function getCredits() { return $this->client->credits() ->where('is_deleted', false)