Add Beneficiary bugs fixed #2

This commit is contained in:
2025-09-05 18:15:19 +05:30
parent be9a6fc93f
commit 1204507375
3 changed files with 14 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:developer'; import 'dart:developer';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:kmobile/core/errors/exceptions.dart';
import 'package:kmobile/data/models/ifsc.dart'; import 'package:kmobile/data/models/ifsc.dart';
import 'package:kmobile/data/models/beneficiary.dart'; import 'package:kmobile/data/models/beneficiary.dart';
@@ -40,8 +41,12 @@ class BeneficiaryService {
if (e.response?.statusCode == 404) { if (e.response?.statusCode == 404) {
throw Exception('INVALID IFSC CODE'); throw Exception('INVALID IFSC CODE');
} }
else if (e.response?.statusCode == 401) {
throw Exception('INVALID IFSC CODE');
}
} catch (e) { } catch (e) {
rethrow; throw UnexpectedException(
'Unexpected error during login: ${e.toString()}');
} }
return Ifsc.fromJson({}); return Ifsc.fromJson({});
} }
@@ -118,4 +123,4 @@ class BeneficiaryService {
throw Exception('Unexpected error: ${e.toString()}'); throw Exception('Unexpected error: ${e.toString()}');
} }
} }
} }

View File

@@ -86,7 +86,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
final String accountNo = accountNumberController.text.trim(); final String accountNo = accountNumberController.text.trim();
final String ifsc = ifscController.text.trim(); final String ifsc = ifscController.text.trim();
// ignore: prefer_const_declarations
final String remitter = "Unknown"; final String remitter = "Unknown";
final service = getIt<BeneficiaryService>(); final service = getIt<BeneficiaryService>();

View File

@@ -15,13 +15,13 @@ void main() async {
]); ]);
// Check for device compromise // Check for device compromise
// final compromisedMessage = await SecurityService.deviceCompromisedMessage; final compromisedMessage = await SecurityService.deviceCompromisedMessage;
// if (compromisedMessage != null) { if (compromisedMessage != null) {
// runApp(MaterialApp( runApp(MaterialApp(
// home: SecurityErrorScreen(message: compromisedMessage), home: SecurityErrorScreen(message: compromisedMessage),
// )); ));
// return; return;
// } }
// Initialize dependencies // Initialize dependencies
await setupDependencies(); await setupDependencies();