Notwithstanding the provisions of §§ 12-404, 12-405(a), and 12-411 of this subtitle, a lender may impose and collect, as a condition of making a loan, all fees, discounts, points, or other charges that lenders are permitted or required to impose, collect, or pay pursuant to a federal law providing for a program of mortgage purchases or loans originated pursuant to a State or local governmental program of direct lending or mortgage purchase, or by any federal agency or instrumentality or subsidiary thereof, including but not limited to the Government National Mortgage Association, the Federal National Mortgage Association, the Federal Home Loan Mortgage Corporation, the Federal Reserve Bank, the Federal Home Loan Bank, and the Farmers Home Administration, if the following conditions are met:
(1) The loan is eligible for purchase pursuant to a commitment or offer to purchase by the federal, State, or local government agency, instrumentality, or subsidiary; and
(2) (i) The sum of the fees, discounts, points, or other charges imposed plus the interest rate on the loan does not exceed 24 percent; and
(ii) The fees, discounts, points, or other charges imposed and the interest rate on the loan do not exceed those allowed by the applicable federal law providing for the mortgage purchase program.