Stripe Fundamentals with ASP.NET MVC

This course introduces ASP.NET developers to the Stripe payments library, an API that allows developers to quickly accept payments in ASP.NET web applications.
Course info
Rating
(81)
Level
Beginner
Updated
Sep 22, 2015
Duration
3h 7m
Table of contents
Description
Course info
Rating
(81)
Level
Beginner
Updated
Sep 22, 2015
Duration
3h 7m
Description

This course introduces ASP.NET developers to the Stripe payments library, an API that allows developers to quickly accept payments in ASP.NET web applications. This course will show developers how to setup, install, and configure Stripe as well as call its API via the Stripe.NET open source library. Developers will learn how to use an embedded form, create custom forms, and accept payments via the Stripe API. We will start by demonstrating one-time payments and move to the more complex topic of recurring subscription billing. A brief history of payment processing on the web will also be covered to provide context for a discussion of the advantages and disadvantages of Stripe over other payment providers.

About the author
About the author

Craig McKeachie has been a software developer for 15 years and earned the Microsoft Certified Solutions Developer (MCSD) certification for three generations of Microsoft technology. Craig is the author of the JavaScript Framework Guide: AngularJS, Backbone, and Ember, and blogs at funnyant.com

More from the author
Babel: Get Started
Beginner
2h 3m
Feb 9, 2016
Section Introduction Transcripts
Section Introduction Transcripts

Getting Started
Hello, I'm Craig McKeachie, and this course is Stripe Fundamentals with ASP. NET MVC. Stripe empowers developers to easily accept payments online. Stripe is a modern JavaScript library backed by a RESTful API that is easy to work with and avoids the arduous process of setting up a merchant account and a payment gateway. Stripe also significantly reduces your ongoing compliance burden when accepting payments online. This course will show developers how to set up, install, and configure Stripe, as well as call its API and. NET via the Stripe. NET open source library. Developers will learn how to use Stripe's embedded form, create custom forms, and accept payments on the server. This course is aimed at. NET developers who are new to Stripe, but even if you've been working with it, I hope to show you a few tricks. We'll start by understanding how Stripe is different from other payment solutions, and then build an application that accepts a single payment and enhance it to accept recurring subscription payments. Let's get started.

Creating Payment Forms
There are two ways to create forms for accepting payment information with Stripe, using their pre-built embedded form, and creating your own custom form. In this module, we'll first create a form using the pre-built embedded form with the Checkout. js library, which is quicker to set up and allows customization through numerous configuration options. After the form is working, we'll examine the embedded form using Chrome's developer tools to better understand how credit card information is posted to Stripe server, but not to your web server, decreasing your compliance burden. Then, we'll create a custom form and submit the credit card information ourselves using the Stripe. js JavaScript library to post to the Stripe API. Lastly, we'll use the jQuery payment plug-in from Stripe to format and validate the form inputs on our custom form and improve the user experience.

Accepting Payments
We finally get to accept payments and make some money in this module. More specifically, we learn how to charge a credit card with a token we posted to the web server in the previous module. In this module, we explore the Stripe API by authenticating and making our first call to the API using curl, a command line tool. Then we create our first charge from the command line. Next, we authenticate and make our first API calls using Stripe. net. We then learn how to identify compatible versions of the Stripe API and Stripe. NET to use on our project. Finally, we look into handling errors that come back from our API calls.

Listening for Stripe Events
In this module, we talk about how we can listen for Stripe events, and then trigger our own code to run when they happen. In particular, we talk about webhooks, which is how Stripe notifies us about its events. We define webhooks and explain how webhooks work, we go over examples of Stripe events that you might listen to, we discuss use cases for webhooks, when you might need to use a webhook versus a direct API call, show how you can register a webhook in the Stripe dashboard, create a webhook in ASP. NET MVC and go over best practices, we go over testing and debugging webhooks, which can be particular challenging, and finally, we point out some good resources for finding more information about the details of Stripe events you can listen to with a webhook.

Creating Recurring Subscription Payments
In this module, we learn how to create recurring subscription payments. Subscription payments are commonly used for membership websites or software as a service products. More specifically in this module, we'll go over the application demo of our fictitious software as a service app. We haven't looked at it since the first module, so this will be a good refresher. We'll discuss the application architecture, when we need to introduce a database and a data access layer, some domain logic, and talk about unit testing. At that point, we'll be ready to start implementing the application. We'll first create several plans in the Stripe dashboard, and then build out the view that lists those plans. Finally we'll get to subscriptions, where we'll create an account and collect billing information on two different forms, and then we'll create a subscription on the server using Stripe. NET to call the Stripe API.

Listening for Stripe Subscription Events
In this module we'll use a webhook to listen for Stripe events related to the subscription we just created. So now that we have our subscription, we need to go over what the important subscription events are, such as Trial end or Payment succeeded and failed, and show how to handle them with webhooks, and what you want to do in response to each of these events. We'll also create a custom authorization filter to check that ActiveUntil date to make sure users can't get to our software without an active subscription. We'll cover other subscription scenarios like changing plans, upgrades or downgrades, cancelling a plan. Lastly, we'll answer the common question, do you need to use SSL/TLS on your payment pages. Given that there is no sensitive data hitting your servers, you may be wondering about this.