You'd have to either resell domain registrations, hook into a registrar's API, or become ICANN-accredited (which costs thousands of dollars I believe) - the most practical option would be to find a good, ICANN-accredited registrar (such as name.com or Namecheap or Enom) and use an API.
For example, Namecheap.com has a developer's API that will let you register and manage domains:
I should point out that APIs like this will register domains to YOUR account, not your customer's individual accounts. So if you secure payment from the customer first, you can register the domain to your (business?) account on a registrar automatically via an API. Then, you can use the same API to manage the domain's settings, such as pointing to their URL on your site.
For billing and payment, I'd look into Google Wallet or PayPal (or better yet, both). You just have to write code that receives some data from their checkout endpoints and do your own processing (save to a database, send confirmation emails, register the domain, etc).
So, it's not too far-fetched. If you have some time and a little financial means (mostly to cover labor/coding costs) it should be fairly straightforward. Just find a developer who really knows what they're doing that you can trust (as always).