Skip to content

m8ty_client_cards

m8ty_client_cards solves this by enabling apps to list and search cards, show balance trends, and retrieve or change card controls, putting relevant card management into the customer’s hands.

As bank can provide various cards to user here the cards can be managed, blocked and limits changed.

Check the documentation of the m8ty_client_cards library to get an idea about the available models and their properties.

import 'package:dio/dio.dart';
import 'package:m8ty_client_cards/m8ty_client_cards.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';

Here some examples how the dart client can be used

final client = M8tyClientCards();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCardsApi();
final Response<CardsResponseModel> response = await api.listAllCards();
final client = M8tyClientCards();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCardsApi();
final Response<CardsResponseModel> response = await api.searchCards(
searchCardsRequestModel: SearchCardsRequestModel((b) {
// set search criteria
}),
);
final client = M8tyClientCards();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCardsApi();
final response = await api.cardBalanceTrends(
cardId: '1234',
);
final client = M8tyClientCards();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCardControlApi();
try {
final response = await api.changeCardControlStatus(
cardId: '1234',
cardControlStatusChangeRequestModel: CardControlStatusChangeRequestModel((b) {
// set required fields
}),
);
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}
final client = M8tyClientCards();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getCardControlApi();
final response = await api.fetchCardsControlData();