Except when otherwise permitted by law, any banker who discounts any note, bill of exchange, or draft at a higher rate of interest than eight percent per annum, not including the difference of exchange, cannot enforce the collection of the same, except as to principal; and if any interest has been paid, the same must be deducted from the principal and judgment entered for the balance only.