Giter Site home page Giter Site logo

yonglehou / saas-ecom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pedropaf/saas-ecom

0.0 1.0 0.0 5.2 MB

Subscription support for ASP.NET MVC 5 apps using Stripe, including out-of-the-box view helpers. Available via NuGET

Home Page: http://www.saasecom.org

License: Apache License 2.0

C# 56.07% PowerShell 30.37% Batchfile 0.25% Pascal 9.75% JavaScript 1.09% Puppet 2.47%

saas-ecom's Introduction

SAAS Ecom

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

Build status

See an example of SAAS Ecom Demo. It's connected to Stripe test gateway, so you can add one of their test credit cards.

  • Test Card Number: 4242 4242 4242 4242
  • Expiry date: Any future date.
  • CVC: 3 digits

Features

  • Integrated with Stripe: Use stripe as your gateway. This billing application is nicely integrated.
  • Trials supported: You have the option to let your customers to try your application first. Don't even ask them for a credit card to register.
  • Invoicing: The invoices are created automatically, and Stripe will try to get them paid.
  • Billing view helpers: View helpers for your application, to let your customers manage their subscription / password / credit card.
  • Only SSL needed: Your customers' credit card number don't hit your server (stripe.js). You only need SSL to deploy this app.

Is it easy to integrate SAAS Ecom in my application?

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.

NuGet

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.

Additional Steps

  1. Register in Stripe.com, and get your API Keys.
  2. Add your API Keys to Web.config.
  3. Configure Stripe Webhooks, the URL will be something like: http://yourdomain.com/StripeWebhooks
  4. Enable Entity Framework Migrations, add the first migration and update your database.
  5. Integrate your SAAS with the provided view helpers:
    • Create a Subscription (free or paid) on user register.
    • Integrate SAAS View Helpers in the account management section for your customers.

Frequently Asked Questions

I have a freemium SAAS, can I still use SAAS Ecom?

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.

I am not using Entity Framework Code First, can I use SAAS Ecom?

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.

I want to give my customers a Free trial, but I need to collect their credit card on sign up, how can I do it?

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.

Do you support Paypal or Braintree?

Not yet, it might come on a future release but nothing planned so far.

Can I integrate SAAS Ecom with my invoicing application?

Yes, you can do that integration on the controller handling the WebHooks from Stripe.

Is SAAS Ecom being used by any Real Project?

Yes at the moment SAAS Ecom is used by:

  • Photonube: Fremium SAAS for professional photographers.
  • Fluxifi: Twitter analytics SAAS
  • If you're using SAAS in any project, let me know to add you here.

Contribute

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.