In TOS, the impression I got is that members of Star Fleet didn’t need money except for when they were off the ship. All their food, clothing, shelter and medical care was provided for them. The only time they needed money was when they wanted to purchase something the ship couldn’t provide them, like tribbles.
There is a joke in “The Apple,” where Kirk asks Spock if he knows how much Star Fleet Command has invested in him and Spock starts to recite precisely how much has been invested in his training and Kirk says, “Never mind.”
In an episode or two or more, Kirk threatens to cut Scotty’s pay if he doesn’t solve that episode’s problem or promise to boost it if he does. In “The Doomsday Machine,” Scotty manages to re-charge the damaged Constellation’s phaser banks and Kirk tells him, “You’ve just earned your pay for the week.” The bartender wanted to sell tribbles to Uhura and Chekov at ten credits apiece and Cyrano Jones muttered, “Robber!” under his breath.
Clearly, they were getting SOME form of compensation, called “credits,” but we were never shown what a credit was. Perhaps it was some form of electronic currency, its value determined by the Federation government and everyone had an account. (If Uhura had bought that tribble instead of getting it as a gift, perhaps she would’ve contacted the ship’s computer and had it deduct ten credits from her account and deposit it in Space Station K7 bartender’s account.) Perhaps physical money didnt exist any more, except when dealing with a planet that still used it. In ST4, Kirk looks around 1986 San Francisco and remarks, “They’re still using money. We’ll have to find some.” I’m guessing he meant actual coins and bills.
Perhaps, in the future, we’ll all be paid by Direct Deposit, coins and bills will be historical relics, but our money will still be called “dollars and cents” even though no physical money will ever actually exchange hands. You just swipe a plastic card through a reader and the appropriate deduction from your account is made electronically. However, you would still be able to get physical cash if you should travel to a country that hasn’t yet joined the e-money system.
I’m not getting into the “gold-press latinum” question. I’m not nearly as familiar with DS9 as I am with TOS.