Easy E-Commerce Using Laravel and Stripe
Easy E-Commerce Using Laravel and Stripe
Selling Products and Subscriptions
About the Book
August 6, 2015 Update: The book has been updated for Laravel 5.1 and includes a new chapter titled "Integrating a Shopping Cart"!
The local lawn care and landscaping company We Dew Lawns, Inc. has contacted you about building and launching an ambitious corporate website. The surly company owner Todd McDew isn't exactly a technophile, but he's well aware of the potential new revenue streams a well-designed website can introduce to the company. Among other features he would like you to create an online store capable of selling both electronic and physical products, as well as lawn care service subscriptions.
Easy E-Commerce Using Laravel and Stripe guides you through the creation of the WeDewLawns.com. Each project phase introduces new features to the website which are typical of a small but capable online store, including a robust contact form, user accounts, and a restricted area where registered users can download coupons and receive other exclusive offers. You'll also learn how to create a product catalog which can be managed using a restricted administration console.
From there you'll learn how to integrate the popular Stripe payment processing service using Laravel Cashier. You'll learn how to customize many aspects of a Stripe account, customize the Stripe checkout modal, and create a solution which customers can use to download electronic products such as lawn care guides. The final project phase guides you through the integration of Stripe's recurring payments (subscriptions) feature. You'll learn how to create multiple subscription tiers, and build a robust interface allowing customers to select a desired tier and input their payment information for subsequent recurring billing purposes.
Book Highlights
- Includes all of the source code to a real-world online store.
- You will receive free updates as we continue to improve and expand the book and companion project.
-
Learn how to integrate Stripe payment processing capabilities into a Laravel-powered website in a fun, entertaining, and unintimidating fashion by following along with the creation of a real-world project for a fictional company. Just don't get on company owner Mr. McDew's bad side!
- Includes coverage of many concepts central to building an online store, such as how to build a product management interface and a one-time URL generator for downloading electronic products.
- Written by bestselling author W. Jason Gilmore and Laravel News founder Eric L. Barnes, two industry veterans with more than 30 years of combined experience using the PHP language.
Table of Contents
Easy E-Commerce Using Laravel and Stripe is divided into five chapters. Each chapter introduces a fundamental concept associated with building a practical online store for a small business interested in building its customer base, selling products, and selling online subscriptions.
Chapter 1. Creating the We Dew Lawns WebsiteIn this opening phase you'll be tasked with the creation of a fairly simple Laravel-driven website that tells prospective customers more about the business, and offers a user-friendly contact form which sends inquiries to the company assistant, Patty Organo.
To suit this requirement, you'll work through the creation of a new Laravel 5 website complete with Less, Elixir, and Bootstrap integration. You'll also create a home and company bio pages, a site-wide layout, and a contact form.
Chapter 2. Integrating User AccountsFollowing a successful launch of the first phase, Mr. McDew would like to begin building a customer mailing list. To entice individuals into handing over their valuable e-mail addresses he would like to offer registered users access to downloadable coupons which they can then apply to lawn care services. In this chapter you'll integrate and customize user registration and authentication features into the site, and create a restricted area of the site accessible only to authenticated users.
Chapter 3. Integrating Stripe and Creating a Product CatalogWith the site launched and the mailing list continuing to grow, Mr. McDew's ambitions have now turned to online sales. He would like to create a simple online store for selling products such as lawn mowers and gardening tools. In this chapter you'll integrate Laravel Cashier to easily and securely accept credit card payments. You'll also learn how to create a restricted administration console complete with a product catalog manager so Mr. McDew and his team can easily add and update products.
Chapter 4. Selling Electronic and Physical ProductsWith Stripe and Laravel Cashier integrated, and your product catalog created, it's time to begin selling products! In this chapter you'll learn how to sell electronic (downloadable) and physical products through your website. We'll show you how to integrate the secure Stripe "Buy" button and modal, complete transactions using Cashier, and generate one-time URLs for automated product downloads. We'll also talk a bit about shipping and sales tax complexities, and identify a few popular associated resources.
Chapter 5. Selling SubscriptionsIn this final project phase, Mr. McDew sets his sights on selling lawn care subscriptions. In this chapter you'll learn how to integrate Stripe's recurring billing service into the We Dew Lawns website, and sell a number of lawn care service tiers to area customers. You'll also learn how to configure webhooks to autonomously receive and respond to various subscription-related events.
Chapter 6. Integrating a Shopping CartThus far we've preferred to focus on Laravel- and Stripe-related fundamentals so as to ensure everything is working flawlessly before introducing more complicated features. In this chapter we'll change that by adding shopping cart capabilities to the site. By the conclusion of this chapter you'll have successfully integrated a shopping cart into the site, allowing customers to truly shop the site, and conveniently purchase more than one product during a single session.
Table of Contents
-
Introduction
- About the Book Project
- Downloading the We Dew Lawns Project
- About the Authors
- Contact the Authors
-
Chapter 1. Creating the We Dew Lawns Website
- Creating the We Dew Lawns Project
- Creating the Project Layout
- Introducing Elixir
- Creating the Home Page
- Creating the About Us Page
- Adding a Contact Form
- Deploying the Website
- The Project Presentation
- Summary
-
Chapter 2. Integrating User Accounts
- Integrating User Account Registration
- Integrating User Authentication
- Display a Greeting in the Layout Header
- Creating and Restricting the Discount Controller
- Signing Users Out of the Website
- Recovering User Passwords
- The Project Presentation
- Summary
-
Chapter 3. Integrating Stripe and Creating a Product Catalog
- Introducing Stripe
- Introducing Cashier
- Creating the Product Catalog
- Creating an Administration Console
- Summary
-
Chapter 4. Selling Electronic and Physical Products
- Purchasing Products Using Stripe
- The Project Presentation
- Summary
-
Chapter 5. Selling Subscriptions
- Defining the Subscription Plans
- Integrating Plans into the Website
- Integrating Stripe Into the Subscription Flow
- Integrating Subscription Management Features
- Listening to Events with Webhooks
- Processing a Webhook Event
- Creating Coupons
- The Project Presentation
- Summary
-
Chapter 6. Integrating a Shopping Cart
- Creating the Cart Model
- Creating the Carts Controller
- Where to From Here?
- The Project Presentation
- Summary
Authors have earned$10,095,386writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
A Guide to Artificial Intelligence in Healthcare
Dr. Bertalan MeskoCan we stay human in the age of A.I.? To go even further, can we grow in humanity, can we shape a more humane, more equitable and sustainable healthcare? This e-book aims to prepare healthcare and medical professionals for the era of human-machine collaboration. Read our guide to understanding, anticipating and controlling artificial intelligence.
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Everyday Rails - RSpecによるRailsテスト入門
Junichi Ito (伊藤淳一), AKIMOTO Toshiharu, 魚振江, and Aaron SumnerRSpecを使ってRailsアプリケーションに信頼性の高いテストを書く実践的なアドバイスを提供します。詳細で丁寧な説明は本書のオリジナルコンテンツです。また、説明には実際に動かせるサンプルアプリケーションも使用します。本書は2017年版にアップデートされ、RSpec 3.6やRails 5.1といった新しい環境に対応しています!さあ、自信をもってテストできるようになりましょう!
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
The Hundred-Page Machine Learning Book
Andriy BurkovEverything you really need to know in Machine Learning in a hundred pages.
Continuous Delivery Pipelines
Dave FarleyThis practical handbook provides a step-by-step guide for you to get the best continuous delivery pipeline for your software.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #3
PowerShell
3 Books
Buy every PowerShell book from Adam Bertram at a 20% discount! - #4
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #5
Software Architecture and Beautiful APIs
2 Books
There is no better way to learn how to design good APIs than to look at many existing examples, complementing the Software Architecture theory on API design. - #6
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #7
Learn Git, Bash, and Terraform the Hard Way
3 Books
Learn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory. - #8
9 Books-Bundle: Shut Up and Code!
9 Books
"Shut up and code." Laughter in the audience. The hacker had just plugged in his notebook and started sharing his screen to present his super-smart Python script. "Shut up and code" The letters written in a white literal coding font on black background was the hackers' home screen background mantra. At the time, I was a first-year computer... - #9
Mastering Containers
2 Books
Docker and Kubernetes are taking the world by storm! These books will get you up-to-speed fast! Docker Deep Dive is over 400 pages long, and covers all objectives on the Docker Certified Associate exam.The Kubernetes Book includes everything you need to get up and running with Kubernetes! - #10
CCDE Practical Studies (All labs)
3 Books
CCDE lab