TPIN error fixed

This commit is contained in:
2026-01-22 11:38:57 +05:30
parent 658d1be536
commit 76acc2e330
5 changed files with 365 additions and 5 deletions

View File

@@ -278,7 +278,7 @@ class _StopSingleChequeScreenState extends State<StopSingleChequeScreen> {
);
if (!mounted) return;
final decodedResponse = jsonDecode(response);
String responseString = response.toString(); // used as the case only for incorrect TPIN
final status = decodedResponse['status'];
final message = decodedResponse['message'];
final code = decodedResponse['code'];
@@ -293,12 +293,16 @@ class _StopSingleChequeScreenState extends State<StopSingleChequeScreen> {
}
_showResponseDialog('Error', errMessage);
}
if(responseString.contains('INCORRECT_TPIN')){
_showResponseDialog('Invalid TPIN',
'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.');