Download the PHP package tmyers273/laravel-stripe-billing without Composer

On this page you can find all versions of the php package tmyers273/laravel-stripe-billing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-stripe-billing

Laravel Stripe Billing

Versions

Installation

Via composer:

composer require tmyers273/laravel-stripe-billing

After package is installed via composer, run the following command: php artisan vendor:publish and then pick Provider: TMyers\StripeBilling\StripeBillingServiceProvider from the displayed list. This will copy migrations files and config into your app.

Afterwards run the migrations:

Usage

Add Billable trait to the User model.

Stripe Secret

In order to use this package you must posses a Stripe Secret Key. It must be stored as an environment variable STRIPE_SECRET and/or set in config/services.php under stripe.secret

Models

Product model represents product access/privileges parameters Price model optionally belongs to Product model and represents price parameters

Public API

StripeBilling static helper

Stripe customer

Subscriptions

By default users can have multiple subscriptions. But this can be changed by setting unique_active_subscription to true in config/stripe-billing.php

Check subscription
Retrieve subscriptions and chain methods
Create products and subscriptions
List subscriptions
Cancel subscriptions
Resuming subscription

Resuming subscription is possible only as long as it is on grace period

Extend trial

Extending the trial is done in two ways.

This will default prorate to false

Changing plan

Subscription scopes

Charges and credit cards

Default card

Add card from token

This will create a stripe customer if user does not have one assigned yet. The default source of the new Stripe customer will be used to create the default credit card for the user, which will be used by default for future transactions.

If Stripe customer already exists for the user and the user already has a default card, the new card will be added as a new source for the users's Stripe Customer and a new Card record will be created in the local database.

Set another card as default

That method by default takes \TMyers\StripeBilling\Models\Card::class as an argument and makes the card the default card for that user. User's corresponding Stripe Customer's default source also gets updated.

Check if user already has a default card assigned

Or you can pass an instance of \TMyers\StripeBilling\Models\Card::class to verify if that particular card is the default one for the user:

Remove card

Card helper methods

Single charges

When user already has a default card assigned:

Charge by token

Charge via non-default card

Coupons

Coupon can be either a Stripe/Coupon or a string coupon ID of an existing coupon

Middleware

Register in HTTP Kernel.php

The middleware can take parameters like so: subscription:basic,pro - that means that users with any of these subscriptions can pass the middleware. When used without parameters it will just look for any active including onTrial or OnGracePeriod subscriptions

Blade directives

subscribed directive determines if user is logged in and subscribed

unless_subscribed directive determines if user is logged in and not subscribed

Config


All versions of laravel-stripe-billing with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/console Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|~7.0
illuminate/database Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|~7.0
illuminate/events Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|~7.0
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0|~7.0
stripe/stripe-php Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tmyers273/laravel-stripe-billing contains the following files

Loading the files please wait ....