getCart method

  1. @override
Future<Either<Failure, Checkout>> getCart({
  1. Map<String, dynamic>? param,
})
override

Implementation

@override
Future<Either<Failure, Checkout>> getCart({
  Map<String, dynamic>? param,
}) async {
  try {
    final result = await httpHandler.get(
      url: Api.payment.checkOutViewCart,
      queryParameters: param,
      withAccessToken: true,
    );

    return Right(CheckoutDto.fromJson(result).jsonResult);
  } on Exception catch (error) {
    return Left(FailureResponse.mapExceptionToFailure(error));
  }
}