mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6566 from turbo124/v5-develop
Minor fixes for Stripe Import Customers
This commit is contained in:
commit
baa9008a3c
@ -30,10 +30,16 @@ class NinjaPlanController extends Controller
|
|||||||
{
|
{
|
||||||
MultiDB::findAndSetDbByCompanyKey($company_key);
|
MultiDB::findAndSetDbByCompanyKey($company_key);
|
||||||
$company = Company::where('company_key', $company_key)->first();
|
$company = Company::where('company_key', $company_key)->first();
|
||||||
|
|
||||||
|
nlog("Ninja Plan Controller Company key found {$company->company_key}");
|
||||||
|
|
||||||
$account = $company->account;
|
$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);
|
Auth::guard('contact')->login($client_contact,true);
|
||||||
|
|
||||||
/* Current paid users get pushed straight to subscription overview page*/
|
/* Current paid users get pushed straight to subscription overview page*/
|
||||||
|
@ -83,7 +83,6 @@ class ImportCustomers
|
|||||||
if($existing_customer_token){
|
if($existing_customer_token){
|
||||||
nlog("Skipping - Customer exists: {$customer->email} just updating payment methods");
|
nlog("Skipping - Customer exists: {$customer->email} just updating payment methods");
|
||||||
$this->update_payment_methods->updateMethods($customer, $existing_customer_token->client);
|
$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()){
|
if($customer->email && $contact = $this->stripe->company_gateway->company->client_contacts()->where('email', $customer->email)->first()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user