Skip to content

Instantly share code, notes, and snippets.

@bmadigan
Created October 6, 2015 02:13
Show Gist options
  • Save bmadigan/d3f8aa37f96e01142d41 to your computer and use it in GitHub Desktop.
Save bmadigan/d3f8aa37f96e01142d41 to your computer and use it in GitHub Desktop.
My Stripe Cartalyst laravel Setup
// LARAVEL 5.1
// composer.json
"cartalyst/stripe-billing-laravel": "~3.0"
//---------------------
// config/app.php
//---------------------
'providers' => [
Cartalyst\Stripe\Billing\Laravel\StripeServiceProvider::class,
...
'aliases' => [
'Stripe' => Cartalyst\Stripe\Laravel\Facades\Stripe::class,
//---------------------
// Account Model
//---------------------
use Cartalyst\Stripe\Billing\Laravel\Billable;
use Cartalyst\Stripe\Billing\Laravel\BillableContract;
...
class Account extends Model implements BillableContract
{
use Billable;
...
//---------------------
// Controller
//---------------------
$account = Account::createNewAccount($request);
$account->createStripeCustomer([
'email' => '[email protected]',
'description' => 'My Account Name'
]);
$account->subscription()
->onPlan('monthly')
->create();
- See more at: http://laravelsnippets.com/members/snippets/cartalyst-laravel-stripe-steup#sthash.EjOYWxvv.dpuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment