Coder Social home page Coder Social logo

billing's Introduction

billing

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.

Install

Via Composer

$ composer require browner12/billing

Setup

Add the service provider to the providers array in config/app.php.

'providers' => [
    browner12\billing\BillingServiceProvider::class,
];

Publishing

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"

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.

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.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

billing's People

Contributors

browner12 avatar

Watchers

 avatar  avatar

Forkers

space-curiosity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.