getBonus method

Future<ApiCallback<Bonus>> getBonus(
  1. {String cartId}
)

Implementation

Future<ApiCallback<Bonus>> getBonus({String cartId}) async {
  try {
    if (cartId == null) cartId = await _getDefaultCartId();

    var response =
        await _requester.get(BONUS.replaceAll(PARAMETER_CART_ID, cartId));

    return ApiCallback<Bonus>(
        isSuccessful: true, resultData: Bonus.fromJson(response.data));
  } on DioError catch (e) {
    return ApiCallback<Bonus>().defaultErrorCallback(e);
  }
}