29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Laravel Cashier<br />

• Introduction<br />

• Subscriptions A> - Creating Subscriptions A> - Checking Subscription Status A> - Changing<br />

Plans A> - Subscription Quantity A> - Subscription Taxes A> - Cancelling Subscriptions A> -<br />

Resuming Subscriptions<br />

• Handling Stripe Webhooks A> - Failed Subscriptions A> - Other Webhooks<br />

• Single Charges<br />

• Invoices A> - Generating Invoice PDFs<br />

Introduction<br />

Laravel Cashier provides an expressive, fluent interface to Stripe’s¹³⁰ subscription billing services. It<br />

handles almost all of the boilerplate subscription billing code you are dreading writing. In addition<br />

to basic subscription management, Cashier can handle coupons, swapping subscription, subscription<br />

“quantities”, cancellation grace periods, and even generate invoice PDFs.<br />

Configuration<br />

Composer<br />

First, add the Cashier package to your composer.json file and run the composer update command:<br />

.<br />

1 "<strong>laravel</strong>/cashier": "~5.0" (For Stripe SDK ~2.0, and Stripe APIs on 2015-02-18 ve\<br />

2 rsion and later)<br />

3 "<strong>laravel</strong>/cashier": "~4.0" (For Stripe APIs on 2015-02-18 version and later)<br />

4 "<strong>laravel</strong>/cashier": "~3.0" (For Stripe APIs up to and including 2015-02-16 versio\<br />

5 n)<br />

Service Provider<br />

Next, register the Laravel\Cashier\CashierServiceProvider service provider in your app configuration<br />

file.<br />

¹³⁰https://stripe.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!