Create a Subscription Service with Stripe and PHP

You build a multiple level subscription plan registration page using Stripe that registers new customers.
2.7 (7 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
55 students enrolled
Instructed by Lon Hosford Development / E-Commerce
$19
$155
88% off
Take This Course
  • Lectures 50
  • Length 5.5 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 9/2015 English

Course Description

What is this course about? This course is a primer for using Stripe with PHP to build a subscription service. You build a new account page that allows customers to pay with their credit cards for recurring automatic billing.

Why take this course? Ecommerce is an essential skill for all web developers using PHP. Often the hurdle of where to start is high for newcomers to eCommerce. Stripe is a well known platform and is being add into PHP sites everyday. Stripe is great place to start and this course can be a great ice breaker for you to learn more on your own or take additional courses I am offering on Stripe. This course is also a good experience for combining HTML, CSS, Javascript, JQuery and PHP for a solution. If you have completed my Learn Stripe PHP: Make Checkout Webpages course on Udemy, this is a great course to take next.

Visual Step by Step eBooks Included! Often following along by video is not convenient. So every video in this course includes a page by a PDF eBook you can also use. The eBooks are full sized visuals you see in the videos.

Who might find this course useful? This course is for those who are new to Stripe and prefer not to use documentation to learn. Keep in mind that Stripe provides many examples and documentation a competent PHP programmer could follow. So if you are that type of person, consider looking at that option before enrolling in this course. However if you want a laid back deep dive into the basics, this could be helpful to intermediate and higher level skilled developers.

Are you ready to take this course? Students for this course are new to intermediate in their PHP, Javascript, JQuery, CSS and HTML skills. You are familiar with these technologies and have had some experience. This course will stay on the light side of their use but at the same time provide production quality solutions you can use in simple applications.

We use the Stripe Checkout Form with AJAX with Javascript. We also use Stripe PHP Exceptions. You will be able to follow along and understand if you have no experience with the Stripe Checkout Form and Stripe PHP Exceptions. However we do not go into depth about the code behind them. If you want a more in-depth learning experience on the Stripe Checkout Form and Stripe PHP Exception we recommend our companion course offered here on Udemy: Learn Stripe PHP: Make Checkout Webpages


What are the requirements?

  • PHP: Beginner to intermediate skills.
  • Javascript: Beginner to intermediate skills
  • HTML: Beginner to intermediate skills
  • CSS: Beginner skill with some experience.
  • PHP Web server: Need to have access to a running web server with PHP 5.3.3 or later.
  • SQL: Beginner to intermediate skills. We use SQLite in the course.
  • Stripe Account: You need a Stripe testing account. How to set one up is covered in the course.
  • Web Developer Tools: You should know how to open web developer tools in a web browser and navigate. We use Chrome web developer tools in the course materials. You can use others if you prefer.
  • Code editor of your choice.
  • Stripe Stripe Checkout Form: We use the Stripe Checkout Form with AJAX and Javascript. You will be able to follow along and understand if you have no experience with the Stripe Checkout Form. However we do not go into depth about the code behind it. If you want a more in-depth learning experience on the Stripe Checkout Form we recommend our companion course offered here on Udemy: Learn Stripe PHP: Make Checkout Webpages

What am I going to get from this course?

  • Understand how Stripe handle recurring payments for subscription services.
  • Use the Stripe API to add new customers to free and paid subscription plan.
  • Handle login and content access using PHP session management.
  • Create a tiered framework for UI, network requests, database and Stripe interface.
  • Understand the maintenance of subscriptions on the Stripe dashboard.
  • How to set up a development environment for building Stripe subscription transactions.

What is the target audience?

  • Developers who want to begin learning about Stripe for Subscriptions using PHP.
  • This course uses the copy and paste method for code follow along. We do not type code but rather focus analyzing, testing and understanding the code snippets you paste.
  • Developers who have skills and experience to learn from vendor supplied examples and API documentation may find that Stripe provides above average resources for your learning style.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: About The Course
06:50

This is an introduction to the course. It covers the goals and scope of the course, the minimum skills for a great experience in the course and a high level view of the curriculum sections.

20 pages

Tips for how to follow along in the course and to use the download practice files.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture".

Article

These are the files used in this course.

  1. Download and unzip in a folder in your web server.
  2. Refer to the Instruction Guide for an overview of the structure and purpose of the course folders and files.
  3. Refer to the Practice Files Guide in each course section for direction on how to use the files in that section.

    This includes a version of the Stripe PHP API library for use in the course.
Section 2: Development Environment Setup
02:46

The technologies and services needed to follow the course are covered. They include the web server, Stripe accounts, Stripe API keys, the Stripe PHP library and a PHP SQL database.

A PDF version of the video is included in the additional resources for this lecture.

22 pages

A guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

02:28

This covers the web server environment to use Stripe to follow along in the course. Digital certificates are covered along with required version of PHP.

A PDF version of the video is included in the additional resources for this lecture.

05:19

A Stripe account is needed for the course. This covers the types of account statuses and the Stripe Dashboard.

A PDF version of the video is included in the additional resources for this lecture.

02:51

The use of the secret and publishable Stripe API keys is discussed for both live and test mode. You learn about maintaining them for security. You examine the PHP file that we use in the course to make them available to our code.

A PDF version of the video is included in the additional resources for this lecture.

06:53

This covers installing and using the Stripe PHP Library. You will learn about the manual method and the Composer alternative. The Github repository is stressed for keeping up to date. The relationship of the Stripe API to the Stripe PHP Library is covered.

A PDF version of the video is included in the additional resources for this lecture.

02:53

A database is used in the course. We look at the options and technologies such as PDO, PHP Data Objects and SQL, Structured Query Language.

A PDF version of the video is included in the additional resources for this lecture.

05:41

We are using the PDO library and the SQLite3 Database. In this session we learn how to test for these. We write developer testing scripts to verify that they are installed and working.

We also review installing the Firefox SQLite Manager Add-on for use in the course.

A PDF version of the video is included in the additional resources for this lecture.

Test Your Knowledge
7 questions
Section 3: Understanding the UI
02:04

An overview to the topics covered in this section.

This section explores the core webpages that would accompany a subscription signup form using Stripe. This section explores the core pages and how they might work if the site were about content.

We look at the webpages for such a site, subscription content access and user login access.

A PDF version of the video is included in the additional resources for this lecture.

9 pages

A guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

08:26

In this session we tour the project's user interface pages and work with handling the login access.

07:22

We will look at the proposed access for a multilevel subscription website. We see how we can separate and map subscription plans, public access and content access.

A PDF version of the video is included in the additional resources for this lecture.

Test Your Knowledge
3 questions
Section 4: Adding Stripe Recurring Plans
03:26

An overview to the topics covered in this section.

We setup the subscription plans setup for our project.

We do that both in Stripe and on our own web server.

In Stripe we use both the Stripe dashboard to create plans and we use the Stripe API for building plans to facilitate our testing environment.

Then we integrate them into our user checkout interface and web server.

A PDF version of the video is included in the additional resources for this lecture.

9 pages

A guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

06:09

We add and edit recurring billing plans in the Stripe dashboard. We look at ramifications of deleting a plan.

A PDF version of the video is included in the additional resources for this lecture.

05:25

In this session we add a script that will create all our plans using the Stripe API.

This provides us way to recreate your subscription plans when testing.

A PDF version of the video is included in the additional resources for this lecture.

05:32

In this session we are going to set up a backend data source for our subscription plans. Stripe will maintain the billing aspect of our plans. We want our own resource that not only keeps the plan data such as id, name and price, but also what content access level is allowed for the plan.

A PDF version of the video is included in the additional resources for this lecture.

03:45

We write Javascript to request and load our server plan data resource.

A PDF version of the video is included in the additional resources for this lecture.

05:17

In this session we will integrate plan data into the subscription form rendering.

We will use the plan data in our subscription form buttons.

A PDF version of the video is included in the additional resources for this lecture.

Test Your Knowledge
7 questions
Section 5: Building the Database
02:36

An overview to the topics covered in this section.

We are going to create an SQLite 3 database. We will write the SQL to build a customer table and add records. We test our code and create a database layer for the project architecture.

A PDF version of the video is included in the additional resources for this lecture.

9 pages

guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

07:13

In this session we create our database using SQLite3 and connect to it using PDO.

A PDF version of the video is included in the additional resources for this lecture.

04:48

This session writes the SQL CREATE and DROP statements and uses PDO to create the customers table and investigates the purpose and data for the customers table fields.

A PDF version of the video is included in the additional resources for this lecture.

04:07

This session writes the SQL INSERT statement and uses PDO to create a script to add a record to the customer table. Password encryption data covered.

A PDF version of the video is included in the additional resources for this lecture.

09:11

This session tests the script that adds a customer to the database. The SQLite3 auto increment field, password encryption and duplicate key fields are demonstrated. This is also preparation for the final production code to add new customers.

A PDF version of the video is included in the additional resources for this lecture.

Test Your Knowledge
5 questions
Section 6: Completing the Subscription Checkout Form
02:29

This is the overview for this section. We are reviewing the user interface data validation, sending and receiving data to our web server. We hook up adding new subscribers to our database. And we test all the functionality.

A PDF version of the video is included in the additional resources for this lecture..

9 pages

A guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

06:44

In this session we explore the current subscription form validation that we have in place and how to automatically fill it out to make testing faster

07:21

We are now ready to start using the subscriber form data.

In this session we add coding to package the data so that it can be sent over the network to the server.

A PDF version of the video is included in the additional resources for this lecture.

07:44

We begin work on the server side for the new customer subscription form.

In this session we write the script that receives and responds to the form's POST requests.

A PDF version of the video is included in the additional resources for this lecture.

07:15

Now we are ready to add the form data into the database.

In this session we will complete the coding for that and test it out.

A PDF version of the video is included in the additional resources for this lecture.

07:57

For this session we will add the Stripe embedded checkout form to the subscription page.

A PDF version of the video is included in the additional resources for this lecture.

07:37

In this session we use the API to add subscribers to plans in your Stripe account.

A PDF version of the video is included in the additional resources for this lecture.

02:40

We start sessions to do end to end testing of our subscription form.

This session will help you get your testing environment set up.

A PDF version of the video is included in the additional resources for this lecture.

04:05

This continues the end to end testing of our subscription form.

This session will test adding a new customer to the free Basic subscription plan.

A PDF version of the video is included in the additional resources for this lecture

04:46

This continues the end to end testing of our subscription form.

This session will test adding a new customer to the paid Plus subscription plan.

A PDF version of the video is included in the additional resources for this lecture.

Test Your Knowledge
7 questions
Section 7: Implementing User Login and Logout Sessions
04:00

The login and logout user interface is completed to include a working login form, the logout navigation bar button and automatic login for new subscribers.

10 pages

A guide to how the course files are organized and used for this section.

"Sessions" mentioned in the guide correspond to a Udemy "Lecture" in this section.

03:21

We add a PHP function to retrieve a customer record from the database using the user id and password. This coding is for the database tier in our architecture.

05:10

We will write a script to test our function to retrieve a customer record from the database using the user id and password. Then we will run some tests.

06:58

In this session we create the base code for setting the PHP login and logout sessions.

09:37

In this session we create the network layer scripts for requesting a logged in and logged out out session state.

06:58

In this session we are testing the network layer scripts for requesting a logged in and logged out out state.

08:18

In this session we are modifying the user interface to handle the login and logout session status. This includes completing the login form, the login button and the new subscriber form.

07:36

We have avoided looking at the navigation bar coding. Now we have the session data management in place, we can take a look. Keep in mind that how you do your site navigation can very. But this should give you an appreciation for using the session data management.

09:18

In this session the login form, the login button and the new subscriber form are tested to verify they update the session data properly.

Section 8: Final Section
04:40

A look back on what we learned in the course and suggestions on going forward.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Lon Hosford, Web Developer Coach and Web Site Consultant

Independent software developer with practical engineering project experience for clients such as AT&T, Avis, Bristol Myers Squibb, Ortho BioTech, Chanel, Avaya, Green Birdie Video, Aztec Learning Systems and Verizon Wireless. Lon is well known for translating client needs into useful applications.

An interesting aspect of Lon's consulting work was the creation of industry jobs that did not exist before. That lead to hiring and training college students who were taught dead technologies at a time academia was woefully behind on the paradigm shifts in personal computing, the internet and today the distributed device environment often called mobile.

Lon has taught thousands of students internet web development, animation and programming topics over two decades both privately and academically. He developed Multimedia Associated Degree program and courses for Raritan Valley Community College in the 1990s at a time when Macromedia Authorware and Director were tools. He is the founder, developer and educator for Raritan Valley Community College Web Developer Certification program also having its roots in the 1990s at the dawn of the internet. He also was a key curriculum developer and instructor for one of the Nation's first Web Developer Certification program offered through New Jersey Institute of Technology. Lon was also a technology instructor at the University of Phoenix Online.

Lon over the years has produced educational video for topics including Paradox, Cobol, Java, Jasmine, C, C++, Linux, Flash, Cocos 2d and HTML. These courses were distributed and taught in Universities internationally when global was an emerging term.

Ready to start learning?
Take This Course