Billing With Stripe
At some point or another, every web developer will find himself in the position of needing to accept financial data. This isn't to be taken lightly. What if, instead, we could offload the handling of credit card data to a third party service?
Updated Series Available
You are viewing an archived course. We instead recommend that you watch Billing With Laravel Cashier.
Progress
Series Info
- Episodes
- 6
- Run Time
- 55m
- Difficulty
- Intermediate
- Last Updated
- Nov 11, 2015
- Version
- Latest
Series Episodes
- Episodes (5)
The Stripe Dashboard
In this opening episode, we'll take things easy and browse the Stripe dashboard, as we review such things as API keys, plans, and coupons. To finish up, we'll begin the inital prep work of installing Stripe's PHP package through Composer.Building the Form
Let's next move on to storing the test and live versions of our API keys within a configuration file. We'll also discuss forms, and why it's so important to never include thenameattribute for financial-specific inputs.Stripe.js
Let's now move on to the JavaScript portion of the series. We need to fetch the user's data from the form, and submit an AJAX request to Stripe's servers, at which point, if the card is billable, a unique one-time token will be returned.Finally, Charging
We're finally at a point where we can charge the user, using the unique token that was returned to us from the AJAX request.Customers and Exceptions
While one-time charges have their place, often, you'll find that it's preferable to instead create customers. This way, in the future, should you need to bill the user again, you only need to reference their customer id.
