import clients - forte

This commit is contained in:
David Bomba 2024-03-18 17:10:12 +11:00
parent 79ed4e4305
commit 08e5d35955
2 changed files with 18 additions and 1 deletions

View File

@ -11,10 +11,11 @@
namespace App\PaymentDrivers; namespace App\PaymentDrivers;
use App\Factory\ClientFactory;
use App\Models\Payment; use App\Models\Payment;
use App\Models\SystemLog; use App\Models\SystemLog;
use App\Models\GatewayType; use App\Models\GatewayType;
use App\Models\ClientContact;
use App\Factory\ClientFactory;
use App\Jobs\Util\SystemLogger; use App\Jobs\Util\SystemLogger;
use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesHash;
use App\PaymentDrivers\Forte\ACH; use App\PaymentDrivers\Forte\ACH;
@ -244,6 +245,14 @@ class FortePaymentDriver extends BaseDriver
->withHeaders(['X-Forte-Auth-Organization-Id' => $this->getOrganisationId()]); ->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() public function importCustomers()
{ {
@ -261,6 +270,9 @@ class FortePaymentDriver extends BaseDriver
$data = $factory->convertToNinja($customer, $this->company_gateway->company); $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)); $client_repo->save($data, ClientFactory::create($this->company_gateway->company_id, $this->company_gateway->user_id));
} }

View File

@ -574,4 +574,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
return false; return false;
} }
public function importCustomers()
{
}
} }