PHPackages                             ranskills/billing-boss - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. ranskills/billing-boss

ActiveLibrary[Payment Processing](/categories/payments)

ranskills/billing-boss
======================

A library that implements billing using a domain-specific language (DSL) to express a billing structure to be applied

1.0.0-rc2(7y ago)20[1 PRs](https://github.com/ranskills/billing-boss-php/pulls)MITPHPPHP ^7.3CI passing

Since Dec 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/ranskills/billing-boss-php)[ Packagist](https://packagist.org/packages/ranskills/billing-boss)[ Docs](https://github.com/ranskills/billing-boss-php)[ RSS](/packages/ranskills-billing-boss/feed)WikiDiscussions develop Synced today

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

Billing Boss
============

[](#billing-boss)

[![Build Status](https://camo.githubusercontent.com/b8146e6a76f842a7a7695f9c807661c42c9bd21a5d931d26d7c08953a3b992ba/68747470733a2f2f7472617669732d63692e6f72672f72616e736b696c6c732f62696c6c696e672d626f73732d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ranskills/billing-boss-php)[![codecov](https://camo.githubusercontent.com/87afadda30ca8ab4adc6a3e7856f3c10f69910c1af9bbdcccfaca1063a5a2294/68747470733a2f2f636f6465636f762e696f2f67682f72616e736b696c6c732f62696c6c696e672d626f73732d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ranskills/billing-boss-php)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/002d4453efc2d28468c5f4e4d486f9c7f070e61c2c19d845ec116e2751e8a905/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72616e736b696c6c732f62696c6c696e672d626f73732d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ranskills/billing-boss-php/?branch=master)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

**Billing Boss** is a free, open-source library that implements billing using a domain-specific language (DSL) to express a billing structure to be applied.

The library has implementations in the following languages:

- [Java](https://github.com/ranskills/billing-boss-java "Project's Homepage") \[Coming soon\]
- [PHP](https://github.com/ranskills/billing-boss-php)

Features
--------

[](#features)

- Intuitive notations for expressing billing/discount structures
- Common billing interpreters provided, namely [Flat Rate](#Flat-Rate), [Percentage](#Percentage), [Capped](#Capped), [Progressive](#Progressive), and [Stepped](#Stepped) interpreters
- [Highly extensible](#Extending-The-Library)
- Lightweight, just under 85KB, with no dependencies

Why Use This Library
--------------------

[](#why-use-this-library)

- It is a fully-tested library
- Lets you focus on developing your next great application without having to implement if, loops, etc. to apply *billing*, *discount*, etc.
- Can be used anywhere an amount is based on another amount such as billing, discounts, etc.
- Because of its use of a DSL, the billing structure can be persisted and loaded on demand allowing for different billing definitions to be stored with the associated entities, such as a customer, group of customers, etc.

Installation
------------

[](#installation)

The recommended installation is via [composer](https://getcomposer.org) by running the command:

```
$ composer require ranskills/billing-boss

```

OR

[download](https://github.com/ranskills/billing-boss-php/releases "Download archive") the most recent archive from the releases page of the project.

Testing
-------

[](#testing)

Run tests with:

```
$ composer test

```

Make sure the test dependencies are installed by running `composer install`, if required

Usage
-----

[](#usage)

```
