Merge pull request #5759 from turbo124/v5-develop

Fixes for import
This commit is contained in:
David Bomba 2021-05-20 15:36:18 +10:00 committed by GitHub
commit c0e258eabb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1650,7 +1650,7 @@ class Import implements ShouldQueue
$ninja_company = Company::on('db-ninja-01')->find(config('ninja.ninja_default_company_id'));
/* If we already have a record of this user - move along. */
if($client_contact = ClientContact::on('db-ninja-01')->where(['email' => $owner->email, 'company_id' => $ninja_company->id)->exists())
if($client_contact = ClientContact::on('db-ninja-01')->where(['email' => $owner->email, 'company_id' => $ninja_company->id])->exists())
return $client_contact->client;
$ninja_client = ClientFactory::create($ninja_company->id, $ninja_company->owner()->id);
@ -1689,11 +1689,12 @@ class Import implements ShouldQueue
$token['company_id'] = $ninja_client->company_id;
$token['client_id'] = $ninja_client->id;
$token['user_id'] = $ninja_client->user_id;
$token['company_gateway_id'] = config('ninja.ninja_default_company_gateway_id')
$token['company_gateway_id'] = config('ninja.ninja_default_company_gateway_id');
//todo
ClientGatewayToken::unguard();
$cgt = ClientGatewayToken::Create($token);
ClientGatewayToken::reguard();
}
}

View File

@ -111,7 +111,7 @@ class UpdatePaymentMethods
}
private function addOrUpdateCard(PaymentMethod $method, ClientGatewayToken $token, GatewayType $type_id)
private function addOrUpdateCard(PaymentMethod $method, ClientGatewayToken $token, $type_id)
{
$token_exists = ClientGatewayToken::where([