Robust subscription support for ASP.NET MVC 5 apps using Stripe, including payment pages and subscription management for your customers. Also makes it easy to manage logic related to new subscriptions, cancellations, payment failures, and streamlines hooking up notifications, etc. Available on NuGet
See an example of SAAS Ecom Demo. It's connected to Stripe test gateway, so you can add one of their test credit cards.
SAAS Ecom uses the most popular technologies in the .NET world. The main requirements for your application is that you need to use ASP.NET Identity 2.1 for membership, and also Entity Framework 6 Code First. Although, if you’re not using EF Code First currently, you can use a second database for membership and SAAS Ecom, and another one for your application data.
This project is available in NuGet, the recommended way to install it is:
Create a new MVC 5 project that uses Individual accounts. Then install this NuGet Package:
PM> Install-Package SaasEcom.FrontEnd
After installing the package, edit the file "IdentityModels.cs"
public class ApplicationUser : SaasEcomUser
{
// default code ...
}
public class ApplicationDbContext : SaasEcomDbContext<ApplicationUser>
{
// default code ...
}
The SaasEcomUser class defines non-nullable RegistrationDate and LastLoginDate properties. Anyone installing saas-ecom into their project will need to update their Registration action to define the user as below:
var user = new ApplicationUser { UserName = model.Email, Email = model.Email, RegistrationDate = DateTime.UtcNow, LastLoginTime = DateTime.UtcNow };
Now the solution should compile successfully, but you should complete the following additional steps.
Yes, in this case the recommended approach would be to not create the users in Stripe until a user is a paying customer. You should create a Subscription plan in the database, and use "free" as PlanId, that way you can differentiate the users in a free plan from the users in a paid plan.
Yes, you can create a second database using Entity Framework Code first for billing. This is not an ideal solution and hopefully this dependency will become optional in a future release.
This view helper is not provided, but you just need to add the credit card collection details to your register form and submit that to stripe using their js script. Similar to the upgrade form.
Not yet, it might come on a future release but nothing planned so far.
Yes, you can do that integration on the controller handling the WebHooks from Stripe.
Yes at the moment SAAS Ecom is used by:
I'm open to suggestions and pull requests.
Get in touch if you'd like to use this project and need help, I also do contract work.