trancations method
trancations Fetches the baseAccountNo last n transctions, where n is the number of transactions noOfTransactions
It has a return type of BankReponse
& the raw response can be gotten by calling BankReponse.rawResponceBody
The list of transactions as List of BankTransactionModel can be gotten by calling BankReponse.transactions
Implementation
Future<BankReponse> trancations({
required String referenceNumber,
required int noOfTransactions,
required String accessToken,
}) async {
Map<String, String> _header = {
'content-type': 'application/json',
'Authorization': 'Bearer $accessToken'
};
Map<String, dynamic> _payload = {
'MessageReference': referenceNumber,
'AccountNumber': baseAccountNo,
'NoOfTransactions': noOfTransactions,
};
try {
return await pesalinkProcessTransaction(
transactionsUrl, _header, _payload, applicationMode);
} catch (e) {
rethrow;
}
}