mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for MultiDB payment gateways
This commit is contained in:
parent
066666f5bc
commit
b3b5793703
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Requests\Gateways\Checkout3ds;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\CompanyGateway;
|
||||
@ -37,6 +38,7 @@ class Checkout3dsRequest extends FormRequest
|
||||
|
||||
public function getCompany()
|
||||
{
|
||||
MultiDB::findAndSetDbByCompanyKey($this->company_key);
|
||||
return Company::where('company_key', $this->company_key)->first();
|
||||
}
|
||||
|
||||
|
@ -640,7 +640,8 @@ class Import implements ShouldQueue
|
||||
$client->updated_at = Carbon::parse($modified['updated_at']);
|
||||
|
||||
$client->save(['timestamps' => false]);
|
||||
|
||||
$client->fresh();
|
||||
|
||||
$client->contacts()->forceDelete();
|
||||
|
||||
if (array_key_exists('contacts', $resource)) { // need to remove after importing new migration.json
|
||||
@ -650,7 +651,7 @@ class Import implements ShouldQueue
|
||||
$modified_contacts[$key]['company_id'] = $this->company->id;
|
||||
$modified_contacts[$key]['user_id'] = $this->processUserId($resource);
|
||||
$modified_contacts[$key]['client_id'] = $client->id;
|
||||
$modified_contacts[$key]['password'] = 'mysuperpassword'; // @todo, and clean up the code..
|
||||
$modified_contacts[$key]['password'] = Str::random(8);
|
||||
unset($modified_contacts[$key]['id']);
|
||||
}
|
||||
|
||||
@ -685,6 +686,8 @@ class Import implements ShouldQueue
|
||||
'old' => $resource['id'],
|
||||
'new' => $client->id,
|
||||
];
|
||||
|
||||
$client = null;
|
||||
}
|
||||
|
||||
Client::reguard();
|
||||
|
@ -88,5 +88,7 @@ class ClientContactRepository extends BaseRepository
|
||||
$new_contact->email = ' ';
|
||||
$new_contact->save();
|
||||
}
|
||||
|
||||
$client = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user