getBanks method

  1. @override
Future<Either<Failure, GetBanksResponseEntity>> getBanks({
  1. required String token,
})
override

Implementation

@override
Future<Either<Failure, GetBanksResponseEntity>> getBanks({
  required String token,
}) async {
  try {
    final response = await httpClient.get(
      '/payment/pse/banks',
      options: Options(
        headers: {
          'Authorization': 'Bearer $token',
        },
      ),
    );
    return Right(
      GetBanksResponse.fromJson(
        response.data,
      ),
    );
  } catch (e) {
    return Left(
      Failure(
        message: e.toString(),
      ),
    );
  }
}