billing
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
Note: Replace Andrew Brown browner12 `````` browner12@gmail.com browner12 billing accept payments with their correct values in README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE.md and composer.json files, then delete this line., (*2)
This is a billing package. It abstracts the implementation allowing you to quickly setup billing using your preferred provided. Please note that currently only the Stripe implementation is available., (*3)
Install
Via Composer, (*4)
``` bash
$ composer require browner12/billing, (*5)
## Setup
Add the service provider to the providers array in `config/app.php`.
``` php
'providers' => [
browner12\billing\BillingServiceProvider::class,
];
Publishing
You can publish everything at once, (*6)
``` php
php artisan vendor:publish --provider="browner12\billing\HelperServiceProvider", (*7)
or you can publish groups individually.
``` php
php artisan vendor:publish --provider="browner12\billing\HelperServiceProvider" --tag="config"
Usage
Make sure you start by updating your new billing.php config file. You must select a provider, and set the API key. Your API key should most likely use an environment variable., (*8)
Next you will want to instantiate the biller with dependency injection., (*9)
``` php
public function __construct(BillingInterface $biller)
{
//assign
$this->biller = $biller;
}, (*10)
To create a charge call the `charge` method.
``` php
$this->biller->charge(2199, $token, 'description of the charge');
The $token will come from your service provider. The token allows you to prevent any payment details from ever touching your server., (*11)
Change log
Please see CHANGELOG for more information what has changed recently., (*12)
Testing
bash
$ composer test, (*13)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*14)
Security
If you discover any security related issues, please email browner12@gmail.com instead of using the issue tracker., (*15)
Credits
License
The MIT License (MIT). Please see License File for more information., (*16)