---------------------------------- whmManager Billing v1.0 Manual ---------------------------------- I OVERVIEW II INSTALLATION III CONFIGURATION VI CONTACT INFORMATION Part I: Overview The whmManager Billing module is intended to add billing functionality to the script. It will record transactions, invoices, and send notices when needed. Below is a small diagram to illustrate how billing works: ----------------------------------------------------------------------------- ACCOUNT RENEWAL ----------------------------------------------------------------------------- 3. Notice Sent to User | autoinvoice.php | 1. Account Expires --> 2. Invoice Generated --> 4. User pays at payment.php | 5. Transaction Recorded | (see note below about automation) 6. Account Renewed ----------------------------------------------------------------------------- ACCOUNT SIGNUP ----------------------------------------------------------------------------- 1. New Signup --> 2. Invoice Generated --> 4. User pays via signup.php | 5. Transaction Recorded | (see note below about automation) 6. Account Created ----------------------------------------------------------------------------- 1. An account expires on the day of its expiration date, at which point an invoice can either be manually generated via "Invoice" or "Invoice All" in the "Expired Accounts" list, or automatically generated via the autoinvoice.php crontab script. 2. If you choose to manually generate the invoice, you will then have to send the invoice notice to the user manually. This can be accomplished by selecting "Unpaid Invoices" from the menu and clicking "Send Notice" next to the invoice you'd wish to notify the user about. If the invoice is automatically generated, the notice will automatically be sent. This is the best option. 3. The notice is sent to the user using the template you provide, which can be edited via "Edit Invoice Template" in the menu. 4. Payment is accomplished via linking to a payment processor, check, or any payment module you've added, like PayPal and 2Checkout. 5. The transaction is recorded in the database. You can search all the transactions via "Search Transactions," and see the most recent ones by clicking "Recent Transactions." 6. If autosetup is enabled, and the user paid via an automatable method, the account will be created. If not, you will need to click "+Paid" in the list of unpaid invoices to manually setup the account. If the user is renewing via an automatable method, the account will be renewed automatically. If not, you'll have to use "+Paid" to mark the invoice as paid. Whenever an invoice is marked as paid, a receipt will be sent to the user. This receipt is definable by you via "Edit Receipt Template" in the menu. Payment.php is where your users pay their invoices. They need their domain name and invoice number to pay. That should give you a general idea of how billing works, and what you need to do to work with this module. Part II: Installation To install this module, make sure the "$allow_modules" variable in config.php is set to "yes" and then run billing.php from the web, from a URL like this: http://yourdomain.com/whmManager/modules/billing.php Part III: Configuration First, edit the templates. You will see 3 menu options, as are described below. Edit Invoice Template: to be sent out whenever "Send Notice" is clicked or whenever an invoice is generated by autoinvoice.php. You should include a link to payment.php in this. Edit Receipt Template: to be sent whenever an invoice is marked as +Paid. Edit Early Notice: to be sent out by autoinvoice.php however many days before the account expires you specify. The next two steps are optional. Second, configure autoinvoice.php. Open it up in a text editor and change the variables you see. There should be 3; see below. $early_warning: how many days before an account expires the early notice should be sent. $late_warning: how many days after an account expires the late notice should be sent. Note that the late notice uses the same template as a normal invoice notice. $invoice_key: submit to the script to make sure no unauthorized users can run it. It can be anything you want, but I recommend something without spaces, like an md5 hash. $scriptpath: the path to config.php, without a trailing slash. IMPORTANT!! Third, add a crontab entry for autoinvoice.php. It should be run once a day, so something like this will do just fine. 0 23 * * * /usr/local/bin/php -q /path/to/whmManager/scripts/autoinvoice.php invoicekey You'll have to replace /path/to/whmManager with the path to your installation and invoicekey with the $invoice_key you specified. If your php binary is somewhere other than /usr/local/bin, you'll need to change that as well. Part VI: Contact Use one of these methods for help. HelpDesk: http://nixt.org/hd E-Mail: andrew@nixt.org