Hi,
The easiest way to accomplish this is to use a Radius server.
Have a look at DMA Soft Labs Radiusmanager server solution.
www.dmasoftlab.com
License is cheap and will allow you to create accounts and pre-paid cards for usage as well.
Kind Regards