Update: 2026-05-08 14:05:50
This commit is contained in:
@@ -57,4 +57,27 @@ class CompaniesManagementController extends GetxController {
|
||||
AppSnackbar.showError('خطأ', 'تعذر حذف الشركة');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> connectJoFotara(String id, String clientId, String secretKey, String sequence) async {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
final response = await _dio.post('companies/connect_jofotara', data: {
|
||||
'id': id,
|
||||
'client_id': clientId,
|
||||
'secret_key': secretKey,
|
||||
'income_source_sequence': sequence,
|
||||
});
|
||||
if (response.data['success'] == true) {
|
||||
await fetchCompanies();
|
||||
AppSnackbar.showSuccess('نجاح', 'تم ربط الشركة بجوفوترا بنجاح');
|
||||
} else {
|
||||
AppSnackbar.showError('خطأ', response.data['message'] ?? 'فشل الربط');
|
||||
}
|
||||
} catch (e) {
|
||||
AppLogger.error('Failed to connect jofotara', e);
|
||||
AppSnackbar.showError('خطأ', 'تعذر ربط جوفوترا');
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user