def get_payment_costs(request, payment_method):
    if payment_method is None:
        return {
            "price": 0.0,
            "tax": 0.0
        }

    try:
        tax_rate = payment_method.tax.rate
    except AttributeError:
        tax_rate = 0.0

    price = criteria_utils.get_first_valid(request,
        payment_method.prices.all())
    # TODO: this assumes that payment price is given as gross price, we have to add payment processor here
    if price is None:
        price = payment_method.price
        tax = (tax_rate / (tax_rate + 100)) * price

        return {
            "price": price,
            "tax": tax
        }
    else:
        tax = (tax_rate / (tax_rate + 100)) * price.price

        return {
            "price": price.price,
            "tax": tax
        }
Transmit a single payload using the present modulation scheme
dataset/ETHPy150Open diefenbach/django-lfs/lfs/payment/utils.py/get_payment_costs--crossover with--dataset/ETHPy150Open whaleygeek/pyenergenie/src/energenie/radio2.py/transmit