def METHOD_NAME(user, sku, course_price):
    """
    Return the course's discounted price for a user if user is eligible for any otherwise return course original price.
    """
    price_details = {}
    try:
        api_url = urljoin(f"{get_ecommerce_api_base_url()}/", "baskets/calculate/")
        response = get_ecommerce_api_client(user).get(
            api_url,
            params={
                "sku": [sku],
                "username": user.username,
            }
        )
        response.raise_for_status()
        price_details = response.json()
    except RequestException as exc:
        LOGGER.info(
            '[e-commerce calculate endpoint] Exception raise for sku [%s] - user [%s] and exception: %s',
            sku,
            user.username,
            str(exc)
        )
    LOGGER.info(
        '[e-commerce calculate endpoint] The discounted price for sku [%s] and user [%s] is [%s]',
        sku,
        user.username,
        price_details.get('total_incl_tax')
    )
    result = price_details.get('total_incl_tax', course_price)
    # When ecommerce price has zero cents, 'result' gets 149.0
    # As per REV-2260: if zero cents, then only show dollars
    if int(result) == result:
        result = int(result)
    return result