Fixes for static analysis in PayFast token billing class

This commit is contained in:
David Bomba 2025-07-10 09:14:20 +10:00
parent 6da076de5d
commit 9b97ba7fae
2 changed files with 12 additions and 5 deletions

View File

@ -62,11 +62,17 @@ class Token
return $this->processSuccessfulPayment($response);
}
return $this->processUnsuccessfulPayment($response, $payment_hash);
return $this->processUnsuccessfulPayment($response);
} catch (Exception $e) {
} catch (\Exception $e) {
echo 'There was an exception: '.$e->getMessage();
return $this->processUnsuccessfulPayment($e->getMessage());
$data = [
'data' => [
'message' => $e->getMessage(),
],
'code' => 500,
];
return $this->processUnsuccessfulPayment($data);
}
}

View File

@ -98,6 +98,7 @@ class MapSettings extends AbstractService
}
private function handleLanguage(string $language_id): string
{
/** @var \App\Models\Language $language */
$language = app('languages')->firstWhere('id', $language_id);
return $language->name;
}
@ -114,11 +115,11 @@ class MapSettings extends AbstractService
private function handleCompanyGateways(string $company_gateway_ids): string
{
nlog($company_gateway_ids);
if(strlen($company_gateway_ids) == "0") {
if($company_gateway_ids == "0") {
return "Payment Gateways Disabled!";
}
if (strlen($company_gateway_ids) == "") {
if ($company_gateway_ids == "") {
return "No Special Configuration.";
}