Get started

Requirments:
    
    - Minimum PHP 7.0
    - MySQL Database
    - cURL function enabled
    - exec function enabled (optional)
    - ZIP extension enabled (optional)
    - PHP memory limit set to 128M (optional)
                

BillingFox is the complete solution for hosting providers and domain registrars to sell with ease and automate their business.

For first you will need a BillingFox License to run installation. After your license has been successfully activated you will have to go to My services >> Manage (right of BillingFox license service) >> Download BillingFox.

After you downloaded it, unzip the archive and upload the files (don't forget to upload .htaccess file) in the main domain / main subdomain directory of your website. Set all file permissions of the current main directory to 774.

Now you can go to your website trough https://your-website.com, there should be the installation wizard. Complete all steps from there and don't forget to create the CronJob. If you have an existing installation click once on "Clear database" button and wait for database clearing and installation process, if you don't have, you can click on "Go to website." button.

Now your website has been setup to use BillingFox.

Functions & Definitions

In order to be a BillingFox developer you would need to learn about BF development functions:

Get current user ID.

You can use the session variable $_SESSION['user_id']. This will return current the user ID.


// Example:
<?php

$user_id = $_SESSION['user_id'];

echo $user_id;

?>
                
 

Get user information.


// Example:
<?php

$user_info = getUserVar($_SESSION['user_id']);

echo $user_info['username'];

?>
                

The function getUserVar($USER_ID) will return an associative array with specified user information.

Function parameters
Parameter Type Description
User ID Integer This parameter represents the user ID.
Items in returned array of getUserVar(...):
Item Type Description
user_id Integer This item represents the user ID.
user_id Integer This item represents the user ID.
email String This item represents the user email address.
user_type String This item represents the user type (usually: user, operator, admin, partner).
user_banned Integer (0/1) This item represents the user ban status, if it is set to 1, the user is banned, otherwise it have an active account.
username String This item represents the username.
account_money Decimal This item represents the user account money.
user_invoices Integer This item represents the user created tickets number.
user_tickets Integer This item represents the user created tickets number.
user_domains Integer This item represents the user domains number.
user_services Integer This item represents the user services number.
country String This item represents the user country.
city String This item represents the user city.
state String This item represents the user state.
address String This item represents the user address.
real_name String This item represents the user real name.
phone_number Integer This item represents the user phone number.
zip_code Integer[5] This item represents the user zip / postal code.
user_company String This item represents the user company.
user_ip IP address This item represents the user IP address.
user_verified Integer(0/1) This item represents the user account verification status, if it is set to 1 the account in verified via e-mail, otherwise it is not.
by_affiliate Integer This item represents the user affiliate id, if it is set to -1, the user hasn't been registered via an affiliate link.
age Integer This item represents the user age.
date Date (Y/M/D) This item represents the user registration date.

Get product information.


// Example:
<?php

$product_info = getProductVar($_GET['product_id']);

echo $product_info['svdo_name'];

?>
                

The function getProductVar($PRODUCT_ID) will return an associative array with specified product information.

Function parameters
Parameter Type Description
Product ID Integer This parameter represents the product ID.
Items in returned array of getProductVar(...):
Item Type Description
product_id Integer This item represents the product ID.
product_topic Integer This item represents the assigned topic ID of the product.
product_type String This item represents the product type.
product_name String This item represents the product name (if it is a domain it will return the domain name).
product_specifications String This item represents the product specifications (usually seen by admin and user).
product_price Decimal This item represents the product price.
product_tax Float This item represents the product tax percent.
product_atax Float This item represents the product activation / setup tax.
product_instant Integer(0/1) This item represents the product instant activation status.
product_hot Integer(0/1) This item represents the product hot (popular) status.
product_on_sale Integer(0/1) This item represents the product sale status.
product_stock Integer This item represents the product stock.
product_sales Integer This item represents the product sales.
product_sale_price Decimal This item represents the product sale price.
svdo_expire_date Date(Y/M/D) This item represents the product expiration date.
product_timeline String This item represents the one-character string that define product renew timeline (d = days, m = months, y = years, o = one-time payment, l = for life).
product_timenumber Integer This item represents the product timeline number (For example: if timeline is equal to "d" and the timenumber is equal to 7, this means the product will have 7 days to expiration).
product_addon String This item represents the product addon.
product_date Date(Y/M/D) This item represents the product creation date.

Get domain information.


// Example:
<?php

$domain_info = getDomainVar($_GET['domain_extension_id']);

echo 'Extension: '.$domain_info['domain_name'];

?>
                

The function getDomainVar($DOMAIN_EXTENSION_ID) will return an associative array with specified domain information.

Function parameters
Parameter Type Description
Domain extension ID Integer This parameter represents the domain extension ID.
Items in returned array of getDomainVar(...):
Item Type Description
domain_id Integer This item represents the domain extension ID.
domain_name String This item represents the domain extension name.
domain_specifications String This item represents the domain extension specifications (usually seen by admin and users).
domain_price Decimal This item represents the domain extension price.
domain_transfer_price Decimal This item represents the domain extension transfer price.
domain_transfer_sale_price Decimal This item represents the domain extension transfer sale price.
domain_transfer_on_sale Decimal This item represents the domain extension transfer sale status.
domain_tax Float This item represents the domain extension tax percent.
domain_atax Float This item represents the domain extension activation / setup tax.
domain_instant Integer(0/1) This item represents the domain extension instant activation status.
domain_hot Integer(0/1) This item represents the domain extension hot (popular) status.
domain_on_sale Integer(0/1) This item represents the domain extension sale status.
domain_stock Integer This item represents the domain extension stock.
domain_sales Integer This item represents the domain extension sales.
domain_sale_price Decimal This item represents the domain extension sale price.
domain_timeline String This item represents the one-character string that define domain extension renew timeline (d = days, m = months, y = years, o = one-time payment, l = for life).
domain_timenumber Integer This item represents the domain extension timeline number (For example: if timeline is equal to "d" and the timenumber is equal to 7, this means the domain extension will have 7 days to expiration).
domain_addon String This item represents the domain extension addon.
domain_date Date(Y/M/D) This item represents the domain extension creation date.

Get deposit order information.


// Example:
<?php

$deposit_info = getDepositVar($_GET['deposit_id']);

echo 'Deposit funds: '.$deposit_info['funds'];

?>
                

The function getDepositVar($DEPOSIT_ID) will return an associative array with specified deposit information.

Function parameters
Parameter Type Description
Deposit ID Integer This parameter represents the deposit ID.
Items in returned array of getDepositVar(...):
Item Type Description
f_id Integer This item represents the deposit ID.
user Integer This item represents the deposit assigned use ID.
payment_method String This item represents the deposit payment method.
specifications String This item represents the deposit specifications (usually seen by admin).
funds Float This item represents the deposit funds.
approved Integer(0/1) This item represents the deposit approved status (deprecated, it will be removed on a future release).
date Date(Y/M/D) This item represents the deposit creation date.

Add funds in current user account.


// Example:
<?php

BF_AddFunds($method = 'PaySafeCard', 'Payment PIN: 2034-2352-5475-3433', 3.00, 1);

?>
                

The function BF_AddFunds($method = 'default', $specifications, $FUNDS, $NeedApproval = 0) will simulate a successful add funds action, it will include the after payment page on success, else it will throw errors in $errors array.

* This function is used internally by BillingFox, is recommended to use it carefully.

Function parameters
Parameter Type Description
Method String The payment method used for deposit.
Specifications String The specifications of deposit (usually seen by admin).
Funds Float The funds of deposit.
Need Approval Integer(0/1) If it is set to 1, the deposit will have to be verified by an admin before adding funds, if it is 0, the funds will be automatically set.

Return the renew payment page.


// Example:
<?php

BF_getRenewPaymentPage($_POST['payment_option']);

?>
                

The function BF_getRenewPaymentPage($Payment_Addon_Name) will return the renew payment page via addon name, usually it is used in only one client area page to output renew payment pages.

Function parameters
Parameter Type Description
Payment Option Addon String This parameter represents the payment addon ID, usually it will be populated on payment radio checkbox (POST) selection.

Return the deposit payment page.


// Example:
<?php

BF_getFundsPaymentPage($_POST['payment_option']);

?>
                

The function BF_getFundsPaymentPage($Payment_Addon_Name) will return the deposit / funding payment page via addon name, usually it is used in only one client area page to output deposit payment pages.

Function parameters
Parameter Type Description
Payment Option Addon String This parameter represents the payment addon ID, usually it will be populated on payment (select) (POST) selection.

Return the cart payment page.


// Example:
<?php

BF_getPaymentPage($_POST['payment_option']);

?>
                

The function BF_getPaymentPage($Payment_Addon_Name) will return the cart payment page via addon name, usually it is used in only one client area page to output cart payment pages.

Function parameters
Parameter Type Description
Payment Option Addon String This parameter represents the payment addon ID, usually it will be populated on payment radio checkbox (POST) selection.

Return (cached) nameservers (1-5) of a domain.


// Example:
<?php

echo 'BillingFox.net cached nameservers:';
echo getNameservers('billingfox.net', 1);
echo getNameservers('billingfox.net', 2);

/* Output */

/*
BillingFox.net cached nameservers:
ns1.thos-host.com
ns2.thos-host.com
*/

?>
                

The function getNameservers($DOMAIN, $NAMESERVER_NUMBER) will return the cached* nameservers (from 1 to 5) of a domain.

Function parameters
Parameter Type Description
Domain String This parameter represents the domain name.
Nameserver number Integer This parameter represents the nameserver number (from 1 to 5).
Response from getNameservers(...):
Item Type Description
(A domain nameserver) String Returns the cached nameserver of a domain.

Return website info.


// Example:
<?php

echo 'Your website name is:';
echo getWebVar('webname');

/* Output */

/*
Your website name is:
BillingFox
*/

?>
                

The function getWebVar($PARAMETER) will return the specified information about your BillingFox website.

Function parameters
Parameter Type Description
webname String This parameter will return website name (Faster alternative: constant WEBSITE_NAME).
cronjob_mode Integer This parameter will return website cronjob mode. (usually it is set to 1 after installation).
theme String This parameter will return website theme directory name (Faster alternative: constant WEBSITE_THEME).
facebook_link String This parameter will return website Facebook social link.
twitter_link String This parameter will return website Twitter social link.
linkedin_link String This parameter will return website LinkedIn social link.
client_area String This parameter will return website client area directory name (Faster alternative: constant WEBSITE_CLIENT_AREA).
domains Integer This parameter will return website client domains number sold on website.
services Integer This parameter will return website client services number sold on website.
currency String This parameter will return website payment currency (Faster alternative: constant WEBSITE_CURRENCY).
users Integer This parameter will return website registered accounts (Alias for getUserCount()).
creation_date Date This parameter will return website creation (or BillingFox installation) date (Faster alternative: constant WEBSITE_CREATION_DATE).
email_verification Integer (0/1) This parameter will return website email verification status (if users have to validate their email address it should return "1").
total_orders Integer This parameter will return website total orders count.
company String This parameter will return website company name.
maximum_deposit Float This parameter will return website maximum deposit amount (Faster alternative: constant WEBSITE_MAXIMUM_DEPOSIT).
minimum_deposit Float This parameter will return website minimum deposit amount (Faster alternative: constant WEBSITE_MINIMUM_DEPOSIT).
affiliate_percent Integer This parameter will return website affiliate earning percent amount.
affiliate_system Integer This parameter will return website affiliate system status (if the system is activated it should return "1").
maintenance Integer This parameter will return website maintenance system status (if the maintenance is activated it should return "1") (Faster alternative: constant MAINTENANCE).
maintenance_text String This parameter will return website maintenance text.
cash-year Float This parameter will return website earnings from this year.
cash-month Float This parameter will return website earnings from this month.
cash-today Float This parameter will return website earnings from today.
cash-total Float This parameter will return website total earnings.
Response from getWebVar(...):
Item Type Description
(Website info) String/Integer/Float Returns website information.

Simulate a renew payment.


// Example:
<?php

renewService(1, 'm', 12, 1, 'InstantPayments', 18.00);

?>
                

The function renewService($timeline, $timenumber, $svdo_id, $user, $method, $price) will simulate a renew payment.

Function parameters
Parameter Type Description
timeline Integer This parameter is the renew service time letter.
timenumber Integer This parameter is the renew service time number.
svdo_id Integer This parameter is the renewed service ID.
user Integer This parameter is the renew user account ID.
method String This parameter is the payment method used for renew.
price Float This parameter is the renew payment price.

Simulate a payment.


// Example:
<?php

PayAll('PinPayments', $_POST['payment_pin'], 'AllPending');

?>
                

The function PayAll($method', $specifications, $CMD) will simulate a renew payment.

Function parameters
Parameter Type Description
method String This parameter is the payment method used for payment.
specifications String This parameter are the additional specifications for the payment, usually they are seen only by the admin.
CMD String This parameter is the additional command used for the payment (Default: "None"), Command can be: "AllPending" [Makes the payment to be on pending, by using this the services will not be activated instantly] and "AlreadyPaid" [You can use this when the payment was processed by an external addon / API, it will ignore services and invoice].

Simulate a deposit.


// Example:
<?php

BF_AddFunds('FastPay', 'Payment PIN: 0437683762975986', 2.00, 1);

?>
                

The function BF_AddFunds($method, $specifications, $FUNDS, $NeedApproval) will simulate a deposit.

Function parameters
Parameter Type Description
method String This parameter is the payment method used for deposit.
specifications String This parameter are the additional specifications for the deposit, usually they are seen only by the admin.
FUNDS Float This parameter are the funds for deposit.
NeedApproval Integer (0/1) This parameter is the approval deposit status (if it is set to "1", the deposit must be verified by administrators).

Display info, warning, error and success messages.


// Example:
<?php

display_infos(); display_infos2(); display_warnings(), display_warnings2(); display_successes(); display_successes2();

?>
                

The functions display_infos(); display_infos2(); display_warnings(), display_warnings2(); display_successes(); display_successes2(); will display a HTML code with info, warning, error and success messages from BillingFox, there are 2 for every type of message to let developers have 2 different locations of different messages for every single page. The messages are get from the arrays $info, $info2, $warnings, $warnings2, $errors, $errors2, $successes and $successes2.

Check if an addon is activated / deactivated.


// Example:
<?php

echo addon_activated('PayPal_Gateway');

/* Output */

/*
YES
*/

?>
                

The function addon_activated($ADDON_NAME) will return the addon activation status (YES/NO).

Function parameters
Parameter Type Description
Addon name String This parameter represents the addon name.
Response from addon_activated(...):
Item Type Description
(Addon status) String If the addon is activated it will return YES, if it is not activated, the function will return NO.

Get variable SQL injection protection for main database.


// Example:
<?php

$variable_to_db = e($variable);

?>
                

The function e($VARIABLE) will escape the variable string to stop SQL Injection.

Function parameters
Parameter Type Description
Variable String This parameter represents the variable.
Response from e(...):
Item Type Description
(Escaped variable) String Returns the escaped variable to use it safely across database.

Check if an addon is on database.


// Example:
<?php

echo addon_in_db('PayPal_Gateway');

/* Output */

/*
YES
*/

?>
                

The function addon_in_db($ADDON_NAME) will check if an addon is in database (usually used for custom addon installation wizards), returns YES if the addon is on database, and NO if it is not.

Function parameters
Parameter Type Description
Addon name String This parameter represents the addon name.
Response from addon_in_db(...):
Item Type Description
(Addon in database) String If the addon is in database it will return YES, but if it is not, the function will return NO.

Get current user IP.


// Example:
<?php

echo getUserIP();

/* OUTPUT */
/*
(IP ADDRESS)
*/

?>
                

The function getUserIP() will return the current user IP address.

Response returned by getUserIP():
Item Type Description
(IP Address) IP Address The function will return only the current user IP address.

Check for expired services.


// Example:
<?php

BF_checkExpireProducts_or_domains

?>
                

The function BF_checkExpireProducts_or_domains() will check for expired services on your BillingFox installation, if there's one or more, the status of the service will be set to "Expired".

Get admin area Bootstrap addon buttons.


// Example:
<?php

echo getAdminAreaButtons();

/* OUTPUT */
/*
[HTML CODE]
*/

?>
                

Get addon generated html codes in themes & client areas.


// Example:
<?php

echo getElement('header');

/* OUTPUT */
/*
[HTML CODE]
*/

?>
                
Function parameters
Parameter Type Description
Element String This parameter represents the desired element (Usually: "header", "top", "before_body", "header_client_area", "top_client_area", "before_body_client_area") (It will use the content/addons/(every active addon)/functions/(Element)).

* It have to be used on client areas & themes.

Get admin area Bootstrap buttons generated by addons.


// Example:
<?php

listAddonsMenu();

/* OUTPUT */
/*
[HTML CODE]
*/

?>
                

The function listAddonsMenu() will return the html code with admin area bootstrap addon manage buttons.

Get payment method radios.


// Example:
<?php

echo getPaymentMethods();

/* OUTPUT */
/*
[HTML CODE]
*/

?>
                

Get service information.


// Example:
<?php

$sv_info = getServiceVar($_GET['sv_id']);

echo $sv_info['svdo_name'];

?>
                

The function getServiceVar($SERVICE_ID) will return an associative array with specified service information.

Function parameters
Parameter Type Description
Service ID Integer This variable represents the service ID.
Items in returned array of getServiceVar(...):
Item Type Description
svdo_id Integer This item represents the service ID.
svdo_user Integer This item represents the assigned user ID of the service.
svdo_specifications String This item represents the service specifications (usually sent only to admins).
svdo_price Decimal This item represents the service price.
svdo_status String This item represents the service status (Expired, Active, Canceled or Pending).
svdo_informations String This item represents the service information (usually seen by user and admin).
svdo_instant Integer(0/1) This item represents the service instant activation status, if the service was instantly activatet, the assigned number will be 1.
svdo_type String This item represents the service type (For domains it will be automatically assigned as "domain", on other servcices it will have a custom value set on product creation or addon updates).
svdo_payment_method String This item represents the service used payment method.
svdo_hot Integer(0/1) This item represents the service hot (popular) status.
svdo_on_sale Integer(0/1) This item represents the service sale status.
svdo_stock Integer This item represents the service stock.
svdo_sale_price Decimal This item represents the service sale price.
svdo_date Date(Y/M/D) This item represents the service creation date.
svdo_expire_date Date(Y/M/D) This item represents the service expiration date.
svdo_timeline String This item represents the one-character string that define service renew timeline (d = days, m = months, y = years, o = one-time payment, l = for life).
phone_number Integer This item represents the user phone number.
svdo_timenumber Integer This item represents the service timeline number (For example: if timeline is equal to "d" and the timenumber is equal to 7, this means the service will have 7 days to expiration).
svdo_expired Integer(0/1) This item represents the service expiration status.
svdo_renew_price Decimal This item represents the service renew price.
svdo_instant_renew Integer(0/1) This item represents the service instant renew status, if it is set to 1, the service will be instantly activated on payment, so it would not need administration verification.
svdo_WHOIS_protection Integer(0/1) This item represents the service WHOIS protection status.
svdo_special_domain_required Integer(0/1) This item represents the service domain required status.
svdo_special_domain String This item represents the service special assigned domain.
svdo_special_user String This item represents the service special assigned user.
svdo_special_pass String This item represents the service special assigned password.
svdo_special_hostname String This item represents the service special assigned hostname.
svdo_special_ns1pre String This item represents the service special assigned first nameserver prefix.
svdo_special_ns2pre String This item represents the service special assigned second nameserver prefix.
svdo_transfered Integer(0/1) This item represents the service transfered status.
svdo_transfer_epp_code String This item represents the service transfer EPP / AUTH transfer key.
svdo_addon String This item represents the service addon.
svdo_token String This item represents the service randomly generated token.
 

Definitions List

Name Type Description
$_SESSION['user_id'] Integer This variable represents the current user ID (if it is logged in).
$db Integer This is the database connection variable.
WEBSITE_NAME String Returns your website name.
WEBSITE_THEME String Returns your website theme.
WEBSITE_CLIENT_AREA String Returns your website client area.
WEBSITE_CURRENCY String Returns your website currency.
WEBSITE_MINIMUM_DEPOSIT String Returns your website minimum deposit amount.
WEBSITE_MAXIMUM_DEPOSIT String Returns your website maximum deposit amount.
MAINTENANCE Integer (0/1) Returns your website maintenance system status.

You can find more advanced functions & definition examples on the right side of the page.

Themes

// Example theme page:
<?php getElement('top'); ?>
<!DOCTYPE html>
<html>
<head>
    <title>My theme page</title>
<link rel="stylesheet" href="content/themes/MY_THEME_DIRECTORY/css/style.css">
<?php getElement('header'); ?>
</head>
<body>
Content here
<?php getElement('footer'); ?>
</body>
</html>

In order to create a BillingFox theme you have to use getElement('top') in the top of your pages, getElement('header') before <head> of your pages and getElement('footer') before <body> of your pages.

After that you will have to edit all file paths to use your theme files, example: set <link rel="stylesheet" href="/css/style.css"> to <link rel="stylesheet" href="/content/themes/YOUR_THEME_DIRECTORY/css/style.css">

Now you have to set logo image link to images/brand/logo.webp and the redirects to files without file extension (BillingFox validate URLs without file extensions for aesthetic purposes)

You can now create a file called maintenance.php where you can use the getWebVar(...) function to get maintenance text

You must create a file called custom_page.php where you can use the constants: PAGE_CONTENT, PAGE_TITLE and PAGE_META_DESCRIPTION to get custom page info

After you finished theme files you can add them into a new theme directory in content/themes/, after you activate the theme, it should display properly.

Client areas

// Example client area page:
<?php getElement('top_client_area'); ?>
<!DOCTYPE html>
<html>
<head>
    <title>My theme page</title>
<link rel="stylesheet" href="content/themes/MY_THEME_DIRECTORY/css/style.css">
<?php getElement('header_client_area'); ?>
</head>
<body>
Content here
<?php getElement('before_body_client_area'); ?>
</body>
</html>

In order to create a BillingFox client area you have to use getElement('top_client_area') in the top of your pages, getElement('header_client_area') before <head> of your pages and getElement('before_body_client_area') before <body> of your pages.

After that you will have to edit all file paths to use your cloet area files, example: set <link rel="stylesheet" href="/css/style.css"> to <link rel="stylesheet" href="/content/client_areas/YOUR_CLIENT_AREA_DIRECTORY/css/style.css">

Now you have to set logo image link to images/brand/logo.webp and the redirects to files without file extension (BillingFox validate URLs without file extensions for aesthetic purposes)

Replace all strings with language variable from content/LANG/english.php with their translation, for example, we will take this line from translations: $_LANG['client_area']['admin_panel'] = 'Admin panel'; and we will go to on client area files and replace 'Admin panel' or 'Admin dashboard' or something like that to Admin panel , use this for all texts.

// Example client area page:

    <!-- Get custom menu addon list -->
     <?php $menu = getMenuItems();
    if(is_array($menu)) {
      foreach($menu as $item)
      { ?>
      <a href="<?php echo $item['href']; ?>">
        <div class="icon menu-item"><?php echo $item['icon']; ?></div>
        <div class="text menu-item"><?php echo $item['item_display'];?></div>
      </a>
        <?php
      }
    } ?>

Now you must load custom menu item list from addons by using (Check right side of the documentation under "Get custom menu addon list" section) Replace classes and div elements with your integrated client area classes and elements. You can use BillingFox functions to customize your client area [check Functions & Definitions section] and you can take as referrence other client areas.

After you finished client area files you can add them into a new client area directory in content/client-areas/, after you activate the client area, it should display properly.

Addons

Addons are used by BillingFox to extend it's functions. How to create an addon? Create the following default addon directory structure: -> YourAddonName (dir) -> run.php (file)

run.php's default content: (Check right side of the documentation under "Addons run.php default content" section)


    // Addons run.php default content
     <?php
    $query_addon = "SELECT addon_name FROM BF_addons WHERE addon_name='YourAddonName' LIMIT 1";
 // selecting this addon from db
        $addon_result = mysqli_query($db, $query_addon);
        if(mysqli_num_rows($addon_result) == 1 && addon_activated('YourAddonName'))
 // check if addon is on db and activated
        {
            // IF THE ADDON IS ACTIVATED - (you can use $_GET[] to check the page)
        }
    else
    {
      // INSTALATION OF ADDON
            $install_db1 = "INSERT INTO BF_addons (`addon_status`, `addon_name`, `addon_description`, `custom_var`, `custom_var_name`) VALUES ('1', 'YourAddonName', 'Some description', 'Self Database,edit on addon menu', 'CustomVariable');";
 // Inserting addon on addons table
            $install_db2 = "CREATE TABLE IF NOT EXISTS `BF_YourAddonName` (field text NOT NULL);";
 // Creating table for data of addon
             $install_db3 = "INSERT INTO BF_YourAddonName (`field`) VALUES ('This is a default field.');";
      mysqli_query($db, $install_db1)
      or die ("SQL error(YourAddonName - addon(install1)): " .mysqli_error($db));
      mysqli_query($db, $install_db2)
      or die ("SQL error(YourAddonName - addon(install2)): " .mysqli_error($db));
      mysqli_query($db, $install_db3)
      or die ("SQL error(YourAddonName - addon(install3)): " .mysqli_error($db));
      // INSTALTION OF ADDON
      // WHAT TO DO AFTER INSTALATION (like, setting a session variable to make an install wizard and more)
            }
?>

Now you can edit your addon as much do you want.

IMPORTANT: AN ADDON IS USED WHEN $_GET['addon_use'] is 'YourAddonName' (used on addon checking) $_GET['something'] is your url variable like >https://YourWebsite/index?variable1=test1&variable2=test2&variable3=test3

Here are 3 GET variables:

$_GET['variable1'] have value test1
$_GET['variable2'] have value test2
$_GET['variable3'] have value test3

ADDON PAGES ARE WORKING ONLY ON CLIENT AREA AND LOGIN/REGISTER (panel) PAGE FOR SECURITY REASONS:
IMPORTANT: THE ADDON PRINCIPAL FILE IS 'run.php'.

Things to know about addons:
The principal file of an addon is named 'run.php' (without quotes)
uninstall process of addon is located on (addon directory)/uninstall.php (deleting tables of addon and addon row in BF_addons table)
run.php and uninstall.php are mandatory for addon functionality
- AddonDirectory/functions/menu.php is a tiny file used to generate menu items, example:
$menu_item[] = BF_add_menu_item('client_area?addon_use=MarketPlace', '<img src="content/addons/MarketPlace/icons/BillingFox-gray-mini.png" style="width:
15px; height: 15px;" alt="BillingFox Icon">', 'BillingFox MarketPlace');

Menu item will redirect you to 'your-website.com/client_area?addon_use=MarketPlace', it will create a menu item that have icon '<img src="content/addons/
MarketPlace/icons/BillingFox-gray-mini.png" style="width: 15px; height: 15px;" alt="BillingFox
Icon">' (image or fontawesome icon, ANYTHING), and text of menu item will be 'BillingFox MarketPlace'

'AddonDirectory/service_buttons/buttons.php' is used to generate service menu buttons
'AddonDirectory/frontend/frontend.php' is used by addons to make client area pages for normal users, you can acces them with https://yourwebsite.com/
client_area?addon_use=Your_Addon
NOTE: directories of addons are loaded automatically by BillingFox, they are optionally so you don't must create them if you don't need.
'AddonDirectory/admin_actions' is a directory used by admin area on use of run.php, so you can edit it's name if you specify that on 'run.php' file.
'AddonDirectory/functions' is a directory used to make functions on top (top of script, running before loading of theme), header (before </head> tag) and
footer (running before </body> tag) [FOLDER FILES MUST BE NAMED:
'top.php','header.php' and 'footer.php' AND ALL MUST BE IN 'functions' directory of addon], also this directory is handling other actions of BillingFox.
'AddonDirectory/functions/fields.php' is a file that is creating custom fields for product that are using this addon (valid name values of inputs: domain,
use_nameservers (boolean, if is set to 1, domain is required), server_ns1_pre, server_ns2_pre,
server_user, server_pass, server_hostname, specifications) , EVERY input from here must have form="addform" in input tag
'AddonDirectory/functions/dfields.php' is a file that is creating custom fields for domain that are using this addon when it is added to cart.

'AddonDirectory/functions/instant_info.php' is a file that is good to create a product on external API or to offer informations for services with instant
activation, variables that you can use here:
$_SESSION['woExpire_on'] - Expiration date of product;
$_SESSION['wo_domain'] - domain of product;
$_SESSION['wo_domainrequired'] - (boolean) domain required status;
$_SESSION['woPrice'] - price of product;
$_SESSION['wo_pass'] - password of product;
$_SESSION['wo_user'] - user of product;
$_SESSION['wo_hostname'] - hostname of product;
$_SESSION['wo_ns1_pre'] - first nameserver prefix of product;
$_SESSION['wo_ns1_pre'] - 2nd nameserver prefix of product;
$_SESSION['wo_token'] - random token of product;
$_SESSION['wo_addon'] - Addon of product;
$_SESSION['item_name'] - product name;
$_SESSION['item_id'] - ID of product;
$_SESSION['wo_specifications'] - Specifications about the order, these are additional informations created by addons seen only by administration (You can set
this only).

NOTE: $_SESSION['wo_token'] is usually used to make random unique IDs for products, by using that you can make differences between services in addons.

In this file you MUST set $_SESSION['info'] (informations of service) and you can set also $_SESSION['user'] and $_SESSION['pass'];
'functions/on_expire.php' is a file that is good to suspend a product on external API on service expiration;

'AddonDirectory/functions/on_add_to_cart.php' is the file that runs after adding an item to cart, you can use addon POST variables & billingfox inputs, GET parametsrs and selects to improve your file better;
'AddonDirectory/functions/on_renew.php' is a file that is good to suspend a product on external API on service expiration, variables that you can use:

$_SESSION['svdo_id'] - the service order ID
$_SESSION['svdo_newExpire'] - new expiration date
$_SESSION['svdo_token'] - service order token

'AddonDirectory/functions/create_fields.php' is a file that is included after an order is created, you can use all POST
variables from the creation form.

'AddonDirectory/functions/on_create.php' Is a file with all inputs added on order creation page, it gets the post variables from 'AddonDirectory/functions/create_fields.php' and order creation page.

If order creation type is domain you can use the variable $creationDomain to get the domain name.

'AddonDirectory/functions/on_service_activate.php' Is a file with all inputs added on service activation page, it gets the post variables from 'AddonDirectory/functions/activate_fields.php' and service activation page page.

Payment addon functionalities:
'payment' is a directory that must have payment page and payment methods on it (see Paypal_Gateway addon to observe)
'AddonDirectory/payment/payment_page.php' is the payment page that is using an addon;
'AddonDirectory/payment/funds_payment_page.php' is the page that will create pay-for-deposit page;
'AddonDirectory/payment/payment_methods.php' is the page that will create payment methods on BillingFox cart page (Use checkboxes with name 'payment_option');
'AddonDirectory/payment/payment_options.php' is the page that will create <option value="addon_name">Addon Name</option>, payment options for deposit page

'AddonDirectory/system.php' is the file that contains payment verification and functions after an user buy something;
Admin things:
'AddonDirectory/admin_area_buttons' is the directory that contains files for admin area buttons.
'AddonDirectory/admin_area_buttons/buttons.php' is the file that is used to create custom buttons on admin area.
Login/Register things:
'AddonDirectory/login_area' is the directory that is creating buttons on login system;
'AddonDirectory/register_area' is the directory that is creating buttons on registration system;
YOU CAN DO ANYTHING WITH ADDONS, DON'T FORGET TO GET INSPIRATION FROM EXISTING ADDONS.

API

<?php

/**
* BillingFox PHP API CLIENT CLASS
*
* This class allows for easy interaction with BF's API for managing your BF store from every website
*
* LICENSE:
*
* Copyright (c) 2019, BF.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
*   following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
*   following disclaimer in the documentation and/or other materials provided with the distribution.
* * Neither the name of the BF nor the names of its contributors may be used to endorse or promote
*   products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*
* @copyright 2019 BF
* @link https://thos-host.com/index?page=billingfox-documentation
* @since File available since release 2.9
**/

/**
* The base API class
*
* The API class allows for easy execution of BFAPI calls.  The goal of this project is to create
* an open source library that can be used for multiple types of applications.  This class relies on PHP compiled
* with curl support.
*
*
*
*
*
* Making Calls with this class are done in the following steps:
*
* 1 - Instaniating the command: 
* $command = "COMMAND";
* $NEED_STATUS = 0;
*
*
* 3 - Performing BF API CALL:
* BF_API::CMD_EXTERNAL($command);
*
* NOTE: You must define your endsoftware.php API URL in class to get a correct result. ( private const call_url = "https://YourWebsite.com/API/endsoftware.php"; )
*
* EXAMPLE:
*
*
* $command = "getUserCount";
* $NEED_STATUS = 1;
*
*
*
* echo BF_API::CMD_EXTERNAL($command, $NEED_STATUS);
*
* returns:
* SUCCESS
*
*
* Deffinitions:
* $command: command performed on API call
* $NEED_STATUS: if is set to '1', API call will respond with status of command ( ERROR / SUCCESS ), else will respond with message of command.
*
* VALID RETURN COMMANDS:
* - createInstall [back website to the installation page; (usefull to protect your store on an admin attack)]
* - getUserCount [outputs website user count]
* - getWebName [outputs website name]
* - getClientArea [outputs client area name]
* - getTheme [outputs theme name]
* - getCurrency [outputs currency name of website]
* - getCompany [outputs website's company]
* - getServices [outputs total services of this website (sold)]
* - getDomains [outputs total domains of this website (sold)]
* - getCoupons [outputs total coupons of this website]
* - getCreationDate [outputs creation date of this website]
* - getTotalOrders [outputs total number of orders on this website]
* - getMoney [outputs total profit of this website]
* - getCashToday [outputs profit from today of this website]
* - getCashMonth [outputs profit from this month of this website]
* - getCashMonth [outputs profit from this year of this website]
*
*
* OTHER VALID COMMANDS:
* - getUserVar [get an array with an user info]
* - modifyUserVar [modify a variable of an user]
* - getDepositVar [get an array with a deposit info]
* - getServiceVar [get an array with a service info]
* - getProductVar [get an array with a product info]
* - getDomainVar [get an array with a domain info]
* - userExists [check if an user exists(return true/false)]
*
* Example for getUserVar:
*
* $command = "getUserVar";
* $NEED_STATUS = 0;
*
*
* $data = array("id" => 11);
* $data_new = json_encode($data);
* var_dump(BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new));
*
*
* // Examples for getDepositVar, getServiceVar, getProductVar, userExists, and getDomainVar have same syntax as getUserVar
*
*
* Example for modifyUserVar:
*
* $command = "modifyUserVar";
* $NEED_STATUS = 0;
*
* $data = array("id" => 11, "var" => "email", "operation" => "set", "value" => "someone@newemail.com");
* $data_new = json_encode($data);
* echo BF_API::CMD_EXTERNAL($command, $NEED_STATUS, $data_new);
*
* The array will run modifyUserVar function in remote website (check documentation) id, user_variable, operation (set/add/substract), value.
*
*
*
*
*
*
*
* 
*
* @category BillingFox
* @package BillingFoxAPI
* @copyright 2019 BillingFox
* @license https://www.thos-host.com/index?page=billingfox-verification
* @link http://thos-host.com
* @since Class available since release 2.9
**/

Check right side of documentation for API requests & info.

Development licenses

If you want to become a BillingFox addon, theme, client area creator or you want to integrate it with your software, email us at: support@billingfox.net