Working on importing Forte customers

This commit is contained in:
David Bomba 2024-03-18 14:06:16 +11:00
parent fc61065e69
commit 0a87aeaf8f
4 changed files with 59 additions and 4 deletions

View File

@ -1072,6 +1072,28 @@ class CreateSingleAccount extends Command
$cg->save();
}
if (config('ninja.testvars.forte') && ($this->gateway == 'all' || $this->gateway == 'forte')) {
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = 'kivcvjexxvdiyqtj3mju5d6yhpeht2xs';
$cg->require_cvv = true;
$cg->require_billing_address = true;
$cg->require_shipping_address = true;
$cg->update_details = true;
$cg->config = encrypt(config('ninja.testvars.forte'));
$cg->save();
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
}

View File

@ -220,4 +220,15 @@ class EwayPaymentDriver extends BaseDriver
return (bool) count($response->getErrors()) == 0;
}
/**
* importCustomers
*
* No support
* @return void
*/
public function importCustomers()
{
return true;
}
}

View File

@ -204,8 +204,29 @@ class FortePaymentDriver extends BaseDriver
return $response->successful();
}
// public function tokenBilling(ClientGatewayToken $cgt, PaymentHash $payment_hash)
// {
// return $this->payment_method->yourTokenBillingImplmentation();
// }
public function importCustomers()
{
$forte_base_uri = "https://sandbox.forte.net/api/v3/";
if ($this->company_gateway->getConfigField('testMode') == false) {
$forte_base_uri = "https://api.forte.net/v3/";
}
$forte_api_access_id = $this->company_gateway->getConfigField('apiAccessId');
$forte_secure_key = $this->company_gateway->getConfigField('secureKey');
$forte_auth_organization_id = $this->company_gateway->getConfigField('authOrganizationId');
$forte_organization_id = $this->company_gateway->getConfigField('organizationId');
$forte_location_id = $this->company_gateway->getConfigField('locationId');
$response = Http::withBasicAuth($forte_api_access_id, $forte_secure_key)
->withHeaders(['X-Forte-Auth-Organization-Id' => $forte_organization_id])
->get("{$forte_base_uri}/organizations/{$forte_organization_id}/locations/{$forte_location_id}/customers/");
if($response->successful()){
nlog($response->json());
}
}
}

View File

@ -92,6 +92,7 @@ return [
'stripe' => env('STRIPE_KEYS', ''),
'paypal' => env('PAYPAL_KEYS', ''),
'ppcp' => env('PPCP_KEYS', ''),
'forte' => env('FORTE_KEYS', ''),
'paypal_rest' => env('PAYPAL_REST_KEYS', ''),
'authorize' => env('AUTHORIZE_KEYS', ''),
'checkout' => env('CHECKOUT_KEYS', ''),