Magento doesn't do this out of the box. What you want is somehow a gift card extension but the giftcard is not sent but used by oneself.
Implementing this is a lot of work, because you have to pay attention to a lot of things:
- Buying funds (should be a product)
- Not paying for them, so they don't get processed to the customers balance
- Buying something with the funds
- The amount is not high enough, so you have to mix different payment methods
- This is the part where you want to implement distributed transaction, because of the below described case*
- People send the things back, so you have to refund part to the customers balance and part to the creditcart/bank account/whatever second payment method (s)he used
Bad case
Order1: Customer has 50$ fund and buys something 100$ worth, he choose paypal to pay with, he is redirected to the paypal site to pay 50$.
Order2: In the same moment, he opens a second order, shops something for 49$, pays with his fund, everything is fine
Order1: The customer pays the 50$ with paypal, he comes backend and the order is flagged as paid ... ERROR.
In this case, you want to rollback the whole transaction, refund the 50$ paid via paypal and refund the maybe decreased 50$ on the funds.
This is technological a mess and I don't think it is worth to implement it correctly. Often companies decide, it is not needed to cover the above case, then it is not soo much work, but still a lot. Be careful with this.