🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 14:02
This commit is contained in:
@@ -63,7 +63,7 @@ final class CompanyController
|
||||
];
|
||||
|
||||
try {
|
||||
$this->companyService->createCompany(array_merge($data, ['id' => $id])); // Reuses encryption logic
|
||||
$this->companyService->updateJoFotara($id, $data);
|
||||
Response::json([
|
||||
'success' => true,
|
||||
'message' => 'تم تحديث بيانات جو-فواتير بنجاح'
|
||||
|
||||
@@ -34,6 +34,21 @@ final class CompanyService
|
||||
return (string)$this->companyModel->create($data);
|
||||
}
|
||||
|
||||
public function updateJoFotara(string $id, array $data): bool
|
||||
{
|
||||
if (isset($data['jofotara_client_id'])) {
|
||||
$data['jofotara_client_id_encrypted'] = $this->encryption->encrypt($data['jofotara_client_id']);
|
||||
unset($data['jofotara_client_id']);
|
||||
}
|
||||
|
||||
if (isset($data['jofotara_secret_key'])) {
|
||||
$data['jofotara_secret_key_encrypted'] = $this->encryption->encrypt($data['jofotara_secret_key']);
|
||||
unset($data['jofotara_secret_key']);
|
||||
}
|
||||
|
||||
return $this->companyModel->update($id, $data);
|
||||
}
|
||||
|
||||
public function getJoFotaraCredentials(string $companyId): array
|
||||
{
|
||||
$company = $this->companyModel->find($companyId);
|
||||
|
||||
Reference in New Issue
Block a user