PHPackages                             frangeris/biller - 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. frangeris/biller

ActiveLibrary[Payment Processing](/categories/payments)

frangeris/biller
================

Stripe subscription billing services for PhalconPHP

v1.0.0(10y ago)7223MITPHPPHP &gt;=5.5.0

Since Nov 26Pushed 10y ago4 watchersCompare

[ Source](https://github.com/frangeris/biller)[ Packagist](https://packagist.org/packages/frangeris/biller)[ RSS](/packages/frangeris-biller/feed)WikiDiscussions master Synced 3w ago

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

Biller (for phalconphp)
=======================

[](#biller-for-phalconphp)

[![Build Status](https://camo.githubusercontent.com/19f88f223f2bb3d9de1cf41d06807d6a8f2aa53923267b6be3cca07934044084/68747470733a2f2f7472617669732d63692e6f72672f6672616e67657269732f62696c6c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/frangeris/biller)[![Total Downloads](https://camo.githubusercontent.com/9398fb7f9708e463e34dcddecfe563990842f34217edb3105a6f79dc6ffe822f/68747470733a2f2f706f7365722e707567782e6f72672f6672616e67657269732f62696c6c65722f646f776e6c6f616473)](https://packagist.org/packages/frangeris/biller)[![Latest Stable Version](https://camo.githubusercontent.com/ff3b29278230684e04465d305351672be39a526eb1a24986d46fdb0d42a31c3b/68747470733a2f2f706f7365722e707567782e6f72672f6672616e67657269732f62696c6c65722f762f737461626c65)](https://packagist.org/packages/frangeris/biller)[![Latest Unstable Version](https://camo.githubusercontent.com/330a6fda9cb55d43d65796aa06b9e27be5dee2f129c8436c630d160d1f13796d/68747470733a2f2f706f7365722e707567782e6f72672f6672616e67657269732f62696c6c65722f762f756e737461626c65)](https://packagist.org/packages/frangeris/biller)[![License](https://camo.githubusercontent.com/f05db09818e51c1971f50783ba676f3b65470e31458b70ac466488bd8ff6a32c/68747470733a2f2f706f7365722e707567782e6f72672f6672616e67657269732f62696c6c65722f6c6963656e7365)](https://packagist.org/packages/frangeris/biller)

Introduction
------------

[](#introduction)

Biller is a billing service package created for abstraction of [Subscriptions](https://stripe.com/docs/api#subscriptions), [Charges](https://stripe.com/docs/api#intro) and [Customers](https://stripe.com/docs/api#customers) using [Stripe API](https://stripe.com/docs/api#intro) under [PhalconPHP Framework](https://phalconphp.com), inspired by [Laravel Cashier](https://github.com/laravel/cashier), so let's rock and roll...

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

[](#installation)

The recommended way to install Biller is through Composer.

#### Install Composer

[](#install-composer)

```
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version of Biller:

```
composer.phar require frangeris/biller
```

Getting Started
---------------

[](#getting-started)

This vendor use connection to Mysql database for manage data of stripe. The first step is create those tables (Subscriptions, Customers), we'll use [Phalcon database migration](https://docs.phalconphp.com/en/latest/reference/migrations.html) for this, using [Phalcon Developer Tools](https://docs.phalconphp.com/en/latest/reference/tools.html).

#### Run migrations

[](#run-migrations)

```
$ phalcon migration --action=run --migrations=migrations --config=
```

This simply add two more tables to your current database (will be used by the vendor to keep record of the data in stripe).

#### Initialize the gateway

[](#initialize-the-gateway)

The next step is to start with the implementation directly in code, before make any kind of request, we must start `\Biller\Gateway`, this will allow us make continues request to [Stripe API](https://stripe.com/docs/api#intro).

Before start the **Gateway** we need to add the configuration of `Biller` in the configuration array of the app, with the next structure:

#### Add biller configuration to config file:

[](#add-biller-configuration-to-config-file)

```
return new \Phalcon\Config([
    'database' => [
        'adapter' => 'Mysql',
        'host' => '127.0.0.1',
		// ...
    ],
    // ------------- ADD THIS -------------
    'biller' => [
    	'key' => '', // the stripe key
    	'custom_id' => 'id', // primary key of your user model, default 'id'
    	'custom_email' => 'email', // email field to use from user model for customers, default 'email'
    ]
]);
```

> The fields `custom_id` and `custom_email` are the names of properties inside `User` model that represent such values.

\####Start the gateway using `Gateway::me()`:

The **Gateway** receive as parameter an object `\Phalcon\Config` so we spend the configuration of the application previously loaded; use method `me()` for indicate who we are:

```
/*
 * Read the configuration file
 */
$config = include __DIR__.'/../app/config/config.php';

// Initialize the gateway with the config var
\Biller\Gateway::me($config);
```

Done this, our app is connected with stripe and we can begin to treat `Users` as `Customers`, let's start:

#### Add a trait to User model:

[](#add-a-trait-to-user-model)

To give the behavior of a `Customer` to the `User` model that we're using, simply add the trait `Biller\Behavior\IsCustomer` to the `User` class that extends of `\Phalcon\Mvc\Model`.

```
class User extends \Phalcon\Mvc\Model
{
    use Biller\Behavior\IsCustomer;

    // ...
}
```

Now, we can interact with our `User` as a `Customer` in stripe.

Methods:
--------

[](#methods)

```
// Get an user
$user = User::findFirst();

// create a new customer with pro plan using object attributes as metadata in stripe
$customer = $user->toCustomer($this->request->getPost('stripeToken'), 'pro', ['name', 'age', 'phone']);

// get customer stripe object
$user->customer('default_source');

// start a pro subscription with 14 days of trial
$user->subscription()->trial(14)->go('pro');

// get date when trial ends
$user->trial(14)->trial_end;

// go pro plan without trial
$user->subscription()->go('pro');

// change to enterprise plan
$user->subscription()->go('enterprise');

// go pro using a coupon
$user->subscription()->withCoupon('coupon')->go('pro');

// cancel the current subscription
$user->subscription()->cancel();
```

**Others methods to verify status**

```
// verify if the user is subscribed
$user->subscribed();

// verify if the user has cancelled a subscription
$user->cancelled();

// verify if the user subscription is pro plan
$user->onPlan('pro');

// verify if the user is on a trial period
$user->onTrial();
```

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

Tests
-----

[](#tests)

Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite:

```
./vendor/bin/phpunit
```

Or to run an individual test file:

```
./vendor/bin/phpunit tests/Biller/GatewayTest.php
```

License
-------

[](#license)

Biller is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3863d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7233b2363ad6f159be7d5f8f6147de3b7fde43ad32402b0a7292a0733151d399?d=identicon)[frangeris](/maintainers/frangeris)

---

Top Contributors

[![frangeris](https://avatars.githubusercontent.com/u/811381?v=4)](https://github.com/frangeris "frangeris (24 commits)")

---

Tags

stripebillingsubscriptionsphalconcustomers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frangeris-biller/health.svg)

```
[![Health](https://phpackages.com/badges/frangeris-biller/health.svg)](https://phpackages.com/packages/frangeris-biller)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k28.4M137](/packages/laravel-cashier)[mollie/laravel-cashier-mollie

Laravel Cashier provides an expressive, fluent interface to Mollie's subscription billing services.

177185.5k1](/packages/mollie-laravel-cashier-mollie)[mmanos/laravel-billing

A billing package for Laravel 4.

461.3k](/packages/mmanos-laravel-billing)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
