APY integrated without testing...

This commit is contained in:
2026-03-18 12:36:41 +05:30
parent 075cb3aaad
commit 8744e69ef7
29 changed files with 1069 additions and 498 deletions

View File

@@ -278,31 +278,35 @@ class _StopSingleChequeScreenState extends State<StopSingleChequeScreen> {
);
if (!mounted) return;
final decodedResponse = jsonDecode(response);
String responseString = response.toString(); // used as the case only for incorrect TPIN
String responseString = response
.toString(); // used as the case only for incorrect TPIN
final status = decodedResponse['status'];
final message = decodedResponse['message'];
final code = decodedResponse['code'];
if (status == 'SUCCESS') {
_showResponseDialog('Success', message);
} if (status == 'ERROR') {
}
if (status == 'ERROR') {
String errMessage = "error";
if(code == '0429') {
errMessage = 'The selected Cheque is already stopped';
} else if(code == '0748') {
errMessage = 'The selected Cheque is already presented';
if (code == '0429') {
errMessage =
'The selected Cheque is already stopped';
} else if (code == '0748') {
errMessage =
'The selected Cheque is already presented';
}
_showResponseDialog('Error', errMessage);
}
if(responseString.contains('INCORRECT_TPIN')){
if (responseString.contains('INCORRECT_TPIN')) {
_showResponseDialog('Invalid TPIN',
'The TPIN you entered is incorrect. Please try again.');
'The TPIN you entered is incorrect. Please try again.');
}
} on DioException catch (e) {
try {
final errorBodyString =
e.toString().split('Exception: ')[1];
final errorBody = jsonDecode(errorBodyString);
if (errorBody.containsKey('error') &&
final errorBody = jsonDecode(errorBodyString);
if (errorBody.containsKey('error') &&
errorBody['error'] == 'INCORRECT_TPIN') {
_showResponseDialog('Invalid TPIN',
'The TPIN you entered is incorrect. Please try again.');