StripePayment-ASP.Net Core2.1

In this post, we are going to implement stripe payment gateway with Core 2.1. Based on previous post this article is extended to implement payment gateway. We are going to modify/extend existing sample application by downloading full source code from github.

Let’s get started by opening the existing application, first of all we are going to add package. Go to NuGet to install the latest version package. It is a portable class library for the Stripe API.

Configure API Key: 

In Startup.cs we need to add API key for stripe authorization. Without this configuration application throw StripeException.

Here’s the full function in Startup.cs after adding stripe configuration.

AngularJS Controller: In controller we are accessing the token id for server code to create customer.

Html View: This is stripe custom checkout button example, from below code there’s a checkout button to perform action.

WebAPI: From the below post method first customer is created then create charge to stripe with amount and customer id. Finally payment status is returned whether the transaction is failed or succeeded.

Pay: Test card number 4242 4242 4242 4242

Stripe: After successfully payment completion this is the payment details in stripe.


I’ve uploaded the full source code to download/clone @github, Thanks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *