PHPackages                             baka/cashier - 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. baka/cashier

ActiveLibrary[Payment Processing](/categories/payments)

baka/cashier
============

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

05.8k1PHP

Since Mar 27Pushed 5y ago2 watchersCompare

[ Source](https://github.com/bakaphp/cashier)[ Packagist](https://packagist.org/packages/baka/cashier)[ RSS](/packages/baka-cashier/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Build Status and Join chats us:
-------------------------------

[](#build-status-and-join-chats-us)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6d4eae02cb9906fcb32d855ed863902f9672209b213a1c46ec2ecbec15c2ebba/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616b617068702f636173686965722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bakaphp/cashier/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f25fa319cf0b6e2e9e9b7856a35b49f86e33e3b4e941c17b9994dcf0a748751a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616b617068702f636173686965722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bakaphp/cashier/?branch=master)[![Build Status](https://camo.githubusercontent.com/7cf58837b824990fcb0330cfc64460d6165dabeb78928e2a1b484a66072ffe29/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616b617068702f636173686965722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bakaphp/cashier/build-status/master)

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

[](#introduction)

Phalcon Cashier provides an expressive, fluent interface to [Stripe's](https://stripe.com) subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs.

Test Setup
----------

[](#test-setup)

You will need to set the following details locally and on your Stripe account in order to test:

### Local

[](#local)

#### Database Configuration

[](#database-configuration)

```
CREATE TABLE `companies` (
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(45) DEFAULT NULL,
  `profile_image` varchar(45) DEFAULT NULL,
  `website` varchar(45) DEFAULT NULL,
  `users_id` int(11) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_deleted` int(11) DEFAULT NULL
);

CREATE TABLE `apps` (
  `id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `name` varchar(45) DEFAULT NULL,
  `description` varchar(45) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_deleted` int(11) DEFAULT NULL
);

CREATE TABLE `subscriptions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `name` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `stripe_id` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `stripe_plan` varchar(250) COLLATE utf8_unicode_ci NOT NULL,
  `quantity` int(11) NOT NULL,
  `trial_ends_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `ends_at` timestamp NULL DEFAULT NULL
);

ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `subscriptions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

/*To execute this commands a users table must be created*/

IF (EXISTS (SELECT *
                 FROM INFORMATION_SCHEMA.TABLES
                 WHERE  TABLE_NAME = 'users'))
BEGIN
    ALTER TABLE `users` ADD `stripe_id` VARCHAR(200) NULL;
    ALTER TABLE `users` ADD `card_brand` VARCHAR(200) NULL;
    ALTER TABLE `users` ADD `card_last_four` VARCHAR(200) NULL;
    ALTER TABLE `users` ADD `trial_ends_at` timestamp NULL DEFAULT NULL;
    ALTER TABLE `users` ADD `active_subscription_id` VARCHAR(200) NULL DEFAULT NULL;
END

```

#### Add some parameter in config.php such as like below

[](#add-some-parameter-in-configphp-such-as-like-below)

```
'stripe' => [
    'model'      => 'App\Models\Users',
    'secretKey'  => null,
    'publishKey' => null
]
```

### Model Setup

[](#model-setup)

#### Add Billable Model to Users MODEL

[](#add-billable-model-to-users-model)

```
use Phalcon\Cashier\Billable;

class User extends Authenticatable
{
    use Billable;
}
```

### Stripe

[](#stripe)

#### Plans

[](#plans)

```
* monthly-10-1 ($10)
* monthly-10-2 ($10)

```

#### Coupons

[](#coupons)

```
* coupon-1 ($5)

```

Official Documentation
----------------------

[](#official-documentation)

You can how to using it at [here](https://github.com/duythien/cashier/wiki/Using-Phalcon-Cashier). Also it is inspiring by Laravel so you can take look on the [Laravel website](http://laravel.com/docs/billing).

Contributing
------------

[](#contributing)

Thank you for considering contributing to the Cashier. You can read the contribution guide lines [here](contributing.md).

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.1% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/136c850ea7ec76b23cc5b1fed8507683cc891145cffedc7761fe73ce03960df3?d=identicon)[mctekk](/maintainers/mctekk)

---

Top Contributors

[![kaioken](https://avatars.githubusercontent.com/u/118385?v=4)](https://github.com/kaioken "kaioken (24 commits)")[![duythien](https://avatars.githubusercontent.com/u/1762691?v=4)](https://github.com/duythien "duythien (15 commits)")[![rwhite27](https://avatars.githubusercontent.com/u/29263079?v=4)](https://github.com/rwhite27 "rwhite27 (5 commits)")[![FredPeal](https://avatars.githubusercontent.com/u/22231077?v=4)](https://github.com/FredPeal "FredPeal (1 commits)")[![gabbanaesteban](https://avatars.githubusercontent.com/u/11374198?v=4)](https://github.com/gabbanaesteban "gabbanaesteban (1 commits)")[![rmariuzzo](https://avatars.githubusercontent.com/u/439839?v=4)](https://github.com/rmariuzzo "rmariuzzo (1 commits)")

---

Tags

cashierpaymentsphalconphalconphpphpstripesubscrptions

### Embed Badge

![Health badge](/badges/baka-cashier/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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