makeTransaction method
Requires Transaction
form as parameter
Throws AuthException if no m4e user is authenticated
Throws ServerException if request fails. This could be as a result of a
Request timeout
, Socket Exception
or General server error
Implementation
// TODO: Pass-in token from application when issueing a request
Future<UnitImpl> makeTransaction(M4eTransactionForm transaction) async {
if ((await _connectionChecker.hasConnection) ?? false) {
try {
await _transactionApi.makeTransaction(transaction);
return UnitImpl();
} catch (e) {
rethrow;
}
}
throw ExceptionMessages.kNoInternetConnectionException;
}