Download the PHP package tetrapak07/billerstr without Composer
On this page you can find all versions of the php package tetrapak07/billerstr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tetrapak07/billerstr
More information about tetrapak07/billerstr
Files in tetrapak07/billerstr
Package billerstr
Short Description Stripe subscription billing services for PhalconPHP
License MIT
Informations about the package billerstr
Biller (for phalconphp)
Introduction
Biller is a billing service package created for abstraction of Subscriptions, Charges and Customers using Stripe API under PhalconPHP Framework, inspired by Laravel Cashier, so let's rock and roll...
Installation
The recommended way to install Biller is through Composer.
Install Composer
Next, run the Composer command to install the latest stable version of Biller:
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 for this, using Phalcon Developer Tools.
Run migrations
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
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.
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:
The fields
custom_id
andcustom_email
are the names of properties insideUser
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:
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:
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
.
Now, we can interact with our User
as a Customer
in stripe.
Methods:
Others methods to verify status
Development
Install dependencies:
Tests
Install dependencies as mentioned above (which will resolve PHPUnit), then you can run the test suite:
Or to run an individual test file:
License
Biller is open-sourced software licensed under the MIT license