From b935b82a8be899e3193677f23f1352d8120432f2 Mon Sep 17 00:00:00 2001 From: Kishan Patel Date: Mon, 18 Apr 2022 17:53:45 +0530 Subject: [PATCH] Global configuration added to Forte gateway. --- app/PaymentDrivers/Forte/ACH.php | 13 ++++++++++--- app/PaymentDrivers/Forte/CreditCard.php | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/app/PaymentDrivers/Forte/ACH.php b/app/PaymentDrivers/Forte/ACH.php index 96f20e54a859..6bd649545482 100644 --- a/app/PaymentDrivers/Forte/ACH.php +++ b/app/PaymentDrivers/Forte/ACH.php @@ -35,6 +35,13 @@ class ACH public function __construct(FortePaymentDriver $forte) { $this->forte = $forte; + + $this->forte_base_uri = $this->forte->company_gateway->getConfigField('baseUri'); + $this->forte_api_access_id = $this->forte->company_gateway->getConfigField('apiAccessId'); + $this->forte_secure_key = $this->forte->company_gateway->getConfigField('secureKey'); + $this->forte_auth_organization_id = $this->forte->company_gateway->getConfigField('authOrganizationId'); + $this->forte_organization_id = $this->forte->company_gateway->getConfigField('organizationId'); + $this->forte_location_id = $this->forte->company_gateway->getConfigField('locationId'); } public function authorizeView(array $data) @@ -64,9 +71,9 @@ class ACH CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ - "first_name": "'.$this->forte->client->name.'", - "last_name": "'.$this->forte->client->name.'", - "company_name": "'.$this->forte->client->name.'", + "first_name": "'.$this->forte->client->present()->name().'", + "last_name": "'.$this->forte->client->present()->name().'", + "company_name": "'.$this->forte->client->present()->name().'", "customer_id": "'.$this->forte->client->number.'" }', CURLOPT_HTTPHEADER => array( diff --git a/app/PaymentDrivers/Forte/CreditCard.php b/app/PaymentDrivers/Forte/CreditCard.php index aeb68ef7625e..e1073456dc0a 100644 --- a/app/PaymentDrivers/Forte/CreditCard.php +++ b/app/PaymentDrivers/Forte/CreditCard.php @@ -36,6 +36,13 @@ class CreditCard public function __construct(FortePaymentDriver $forte) { $this->forte = $forte; + + $this->forte_base_uri = $this->forte->company_gateway->getConfigField('baseUri'); + $this->forte_api_access_id = $this->forte->company_gateway->getConfigField('apiAccessId'); + $this->forte_secure_key = $this->forte->company_gateway->getConfigField('secureKey'); + $this->forte_auth_organization_id = $this->forte->company_gateway->getConfigField('authOrganizationId'); + $this->forte_organization_id = $this->forte->company_gateway->getConfigField('organizationId'); + $this->forte_location_id = $this->forte->company_gateway->getConfigField('locationId'); } public function authorizeView(array $data) @@ -67,9 +74,9 @@ class CreditCard CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ - "first_name": "'.$this->forte->client->name.'", - "last_name": "'.$this->forte->client->name.'", - "company_name": "'.$this->forte->client->name.'", + "first_name": "'.$this->forte->client->present()->name().'", + "last_name": "'.$this->forte->client->present()->name().'", + "company_name": "'.$this->forte->client->present()->name().'", "customer_id": "'.$this->forte->client->number.'" }', CURLOPT_HTTPHEADER => array(