Note: Replace Andrew Brown
browner12
`````` [email protected]
```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.
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.
Via Composer
$ composer require browner12/billing
Add the service provider to the providers array in config/app.php
.
'providers' => [
browner12\billing\BillingServiceProvider::class,
];
You can publish everything at once
php artisan vendor:publish --provider="browner12\billing\HelperServiceProvider"
or you can publish groups individually.
php artisan vendor:publish --provider="browner12\billing\HelperServiceProvider" --tag="config"
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.
Next you will want to instantiate the biller with dependency injection.
public function __construct(BillingInterface $biller)
{
//assign
$this->biller = $biller;
}
To create a charge call the charge
method.
$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.
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.