1. It dependsYou can work with a publishing company, or do it yourself
If you do it yourself, you can publish it from your own web site (for example). You can create the ebook using our softwarehttp://www.ebookcompiler.com
2. If you work with a publisher, then whatever arrangement you make with them
If you do it yourself, then you can choose what method to accept payments. For example, many authors use ClickBank. Clickbank processes the customers credit card, bills the customer, and then sends you checks a few weeks later for your sales (less ClickBank's fees)
You may find this web site helpful:http://www.ebookapprentice.com/