But you can allow access to the Internet via a firewall and/or web proxy base on details entered on a web page. There's a whole lot of stuff involved here which mostly spans what's covered in Stack Overflow and Server Fault - and is perhaps not very relevant here on security.stackechange.
Note that (unless you go down the IPv6 route) the access would probably have to be granted based on the MAC address of the client device - which can be faked.
You'll need a DHCP server configured to serve short leases, and a webserver with a logic tier which can autenticate users / payments and pass the IP address / MAC address to the device gating access to the Internet - if it were me, I'd just allow HTTP and HTTPS and control this via a proxy such as Squid. The advantage of using the HTTP proxy is that you can easily redirect unauthenticated clients back to the login page on your server (you can't do this in a firewall). Note that you'll need to set up the device to transparently reroute HTTP via the proxy.
This won't work for protocols like POP, IMAP and SMTP - but you could publish the same information to a script controlling the firewall - indeed you could configure Fail2ban to work the opposite way it usually does!