mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
import clients - forte
This commit is contained in:
parent
79ed4e4305
commit
08e5d35955
@ -11,10 +11,11 @@
|
||||
|
||||
namespace App\PaymentDrivers;
|
||||
|
||||
use App\Factory\ClientFactory;
|
||||
use App\Models\Payment;
|
||||
use App\Models\SystemLog;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\ClientContact;
|
||||
use App\Factory\ClientFactory;
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\PaymentDrivers\Forte\ACH;
|
||||
@ -244,6 +245,14 @@ class FortePaymentDriver extends BaseDriver
|
||||
->withHeaders(['X-Forte-Auth-Organization-Id' => $this->getOrganisationId()]);
|
||||
}
|
||||
|
||||
private function getClient(?string $email)
|
||||
{
|
||||
return ClientContact::query()
|
||||
->where('company_id', $this->company_gateway->company_id)
|
||||
->where('email', $email)
|
||||
->first();
|
||||
}
|
||||
|
||||
public function importCustomers()
|
||||
{
|
||||
|
||||
@ -261,6 +270,9 @@ class FortePaymentDriver extends BaseDriver
|
||||
|
||||
$data = $factory->convertToNinja($customer, $this->company_gateway->company);
|
||||
|
||||
if(strlen($customer['email']) == 0 || $this->getClient($customer['email']))
|
||||
continue;
|
||||
|
||||
$client_repo->save($data, ClientFactory::create($this->company_gateway->company_id, $this->company_gateway->user_id));
|
||||
|
||||
}
|
||||
|
@ -574,4 +574,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function importCustomers()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user