From 0bd5a9db0c07e6621ccbd2fa5f7048b982d27538 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 24 Apr 2024 09:21:00 +1000 Subject: [PATCH] minor fixes --- app/Export/CSV/ClientExport.php | 8 ++------ app/Http/Controllers/BaseController.php | 2 +- app/Http/Controllers/CompanyGatewayController.php | 1 - app/Models/BaseModel.php | 2 +- .../ninja2020/gateways/paypal/ppcp/card.blade.php | 14 +++++++------- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/Export/CSV/ClientExport.php b/app/Export/CSV/ClientExport.php index dda304bc99..5a5b439129 100644 --- a/app/Export/CSV/ClientExport.php +++ b/app/Export/CSV/ClientExport.php @@ -178,14 +178,10 @@ class ClientExport extends BaseExport } elseif (is_array($parts) && $parts[0] == 'contact' && array_key_exists($parts[1], $transformed_contact)) { $entity[$key] = $transformed_contact[$parts[1]]; } else { - // nlog($key); $entity[$key] = $this->decorator->transform($key, $client); - // $entity[$key] = ''; } } - // return $entity; - return $this->decorateAdvancedFields($client, $entity); } @@ -233,11 +229,11 @@ class ClientExport extends BaseExport } if (in_array('client.country_id', $this->input['report_keys']) && isset($client->country_id)) { - $entity['client.country_id'] = $client->country->full_name; + $entity['client.country_id'] = $client->country ? $client->country->full_name : ''; } if (in_array('client.shipping_country_id', $this->input['report_keys']) && isset($client->shipping_country_id)) { - $entity['client.shipping_country_id'] = $client->shipping_country->full_name; + $entity['client.shipping_country_id'] = $client->shipping_country ? $client->shipping_country->full_name : ''; } return $entity; diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index c8d7d44b8e..fe6485a8ea 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -276,7 +276,7 @@ class BaseController extends Controller /** * API Error response. * - * @param string $message The return error message + * @param string|array $message The return error message * @param int $httpErrorCode 404/401/403 etc * @return Response The JSON response * @throws BindingResolutionException diff --git a/app/Http/Controllers/CompanyGatewayController.php b/app/Http/Controllers/CompanyGatewayController.php index f55222d21a..fb3726be9d 100644 --- a/app/Http/Controllers/CompanyGatewayController.php +++ b/app/Http/Controllers/CompanyGatewayController.php @@ -565,7 +565,6 @@ class CompanyGatewayController extends BaseController public function importCustomers(TestCompanyGatewayRequest $request, CompanyGateway $company_gateway) { - // $x = Cache::pull("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}"); //Throttle here if (Cache::has("throttle_polling:import_customers:{$company_gateway->company->company_key}:{$company_gateway->hashed_id}")) diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index d90056f820..2e6e810667 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -209,7 +209,7 @@ class BaseModel extends Model * Retrieve the model for a bound value. * * @param mixed $value - * @param null $field + * @param mixed $field * @return Model|null */ public function resolveRouteBinding($value, $field = null) diff --git a/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php b/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php index 55b4c3cc11..f303968082 100644 --- a/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php +++ b/resources/views/portal/ninja2020/gateways/paypal/ppcp/card.blade.php @@ -97,10 +97,10 @@ if(liabilityShift) { /* Handle liability shift. More information in 3D Secure response parameters */ - // console.log("inside liability shift") - // console.log(liabilityShift) - // console.log(orderID); - // console.log(data); + console.log("inside liability shift") + console.log(liabilityShift) + console.log(orderID); + console.log(data); //doesn't really do anything as failure is linked in SUBMIT. We only hit here after a successful return //and where SCA is optional? @@ -175,7 +175,7 @@ expiryField.render("#card-expiry-field-container"); document.getElementById("pay-now").addEventListener('click', (e) => { - + console.log("paynow"); document.getElementById('errors').textContent = ''; document.getElementById('errors').hidden = true; @@ -189,8 +189,8 @@ document.querySelector('#pay-now > span').classList.add('hidden'); cardField.submit().then((response) => { - // console.log("then"); - // console.log(response); + console.log("then"); + console.log(response); }).catch((error) => {