From 5d32638d4857dbb56294042d3ef47b026b0f39ce Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Sep 2021 23:24:18 +1000 Subject: [PATCH 1/2] Logging for Ninja Plan Controller --- app/Http/Controllers/ClientPortal/NinjaPlanController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientPortal/NinjaPlanController.php b/app/Http/Controllers/ClientPortal/NinjaPlanController.php index 2d8cd2240f5c..433663923f86 100644 --- a/app/Http/Controllers/ClientPortal/NinjaPlanController.php +++ b/app/Http/Controllers/ClientPortal/NinjaPlanController.php @@ -30,10 +30,16 @@ class NinjaPlanController extends Controller { MultiDB::findAndSetDbByCompanyKey($company_key); $company = Company::where('company_key', $company_key)->first(); + + nlog("Ninja Plan Controller Company key found {$company->company_key}"); + $account = $company->account; - if (Ninja::isHosted() && MultiDB::findAndSetDbByContactKey(request()->segment(3)) && $client_contact = ClientContact::where('contact_key', request()->segment(3))->first()) + if (Ninja::isHosted() && MultiDB::findAndSetDbByContactKey($contact_key) && $client_contact = ClientContact::where('contact_key', $contact_key)->first()) { + + nlog("Ninja Plan Controller - Found and set Client Contact"); + Auth::guard('contact')->login($client_contact,true); /* Current paid users get pushed straight to subscription overview page*/ From e2a8196107969252a2d6a0d0303091dfb880fa48 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 4 Sep 2021 09:41:39 +1000 Subject: [PATCH 2/2] Small fix for stripe import customers --- app/PaymentDrivers/Stripe/ImportCustomers.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/PaymentDrivers/Stripe/ImportCustomers.php b/app/PaymentDrivers/Stripe/ImportCustomers.php index 4f561b98d303..54078a21fa44 100644 --- a/app/PaymentDrivers/Stripe/ImportCustomers.php +++ b/app/PaymentDrivers/Stripe/ImportCustomers.php @@ -83,7 +83,6 @@ class ImportCustomers if($existing_customer_token){ nlog("Skipping - Customer exists: {$customer->email} just updating payment methods"); $this->update_payment_methods->updateMethods($customer, $existing_customer_token->client); - return; } if($customer->email && $contact = $this->stripe->company_gateway->company->client_contacts()->where('email', $customer->email)->first()){