A company that allowed creditors to get paid directly from the salaries of military members has to refund $3.1 million in fees that weren't properly disclosed, the Consumer Financial Protection Bureau said on Monday.

Fort Knox National Co. and subsidiary Military Assistance Co. (also known as MAC) assessed recurring fees that could total more than $100 but weren't clear to servicemembers, the CFPB said. They "enrolled servicemembers without adequately disclosing their fees, and then charged servicemembers without telling them," CFPB Director Richard Cordray said. "As a result, servicemembers paid millions of dollars in fees, probably without even knowing it."

Fort Knox is among the largest companies to process such payments. The CFPB said the system that allows it to operate was created before the ability to schedule payments automatically through a bank or to transfer money electronically became routine.

Get Breaking News Delivered to Your Inbox

Now, those who lend to military members often use the system to get paid from money taken directly from their paychecks and put into a pool that MAC used for debt repayment, with MAC levying fees or monthly service charges. Sometimes, money would be pulled out of a soldier's salary even after the debt was satisfied, creating an excess or residual balance, against which fees would keep getting taken out as well.

That happened between 2010 and 2014, the CFPB said, and involved "tens of thousands servicemembers" whose money was "slowly drained from their accounts because they were not notified about the charges. And, since active allotments would replenish the money in the payment account, MAC continued to take such fees in a way that servicemembers could not easily track."

The company would not tell the servicemembers there was excess money and would keep charging the fees until all of the overage was gone, the agency said.

Fort Knox began getting out of that line of work last year, the CFPB said.