def line_amount
      total = quantity * unit_amount
      total = total * (1 - (discount_rate / BigDecimal(100))) if discount_rate
      total
    end
def line_amount
      total = quantity * unit_amount
      total = total * (1 - (discount_rate / BigDecimal(100))) if discount_rate
      total
    end
Calculate the line_amount as quantity * unit_amount as this value must be correct
 for the API call to succeed.