import 'package:dio/dio.dart'; import 'package:kmobile/data/models/imps_response.dart'; import 'package:kmobile/data/models/imps_transaction.dart'; class RtgsService { final Dio _dio; RtgsService(this._dio); Future processImpsTransaction( ImpsTransaction transaction) async { try { await Future.delayed(const Duration(seconds: 3)); final response = await _dio.post( '/api/payment/rtgs', data: transaction.toJson(), ); if (response.statusCode == 200) { return ImpsResponse.fromJson(response.data); } else { throw Exception( 'RTGS transaction failed with status code: ${response.statusCode}'); } } on DioException { rethrow ; } catch (e) { throw Exception('An unexpected error occurred: ${e.toString()}'); } } }