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*/ 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()){