Base solution for your next web application
Open Closed

New Custom Feature - Subscriptions #1520


User avatar
0
kythor created

I want my users to be able to buy a subscription on my site.

Am I correct if I say I need to add a new Feature for this?

Could you help me on my way to creating something like this?


5 Answer(s)
  • User Avatar
    0
    paddyfink created

    Hello,

    I implemented a feature like that. Basically this is it what I do. I use Stripe as the payment Gateway.

    Let say you have 2 plans : Basic and Premium. Each plan correspond to an Edition in my application and in stripe. I implemented a custom Edition class and I add a property for the price. I've created an eventhandler on Edition Creation. So each time I create a Edition, I create a plan in stripe with the same Id and the Same name and the same price . Then you have to build a interface for the users to choose a stripe plan and subscribe to it. When a user subscribe, since the Id are the same, you get the corresponding Edition and you add the tenant to that Edition.

    Of course you have to configure your edition to have the desired features.

    Let me know if you need more info

  • User Avatar
    0
    kythor created

    thanks for the reply, but I'm not sure if I need editions. This is what I try to setup:

    I only need one tenant now, this is the main portal site. Here users can register. The portal is a video-on-demand, livestream site. much like livebasketball.tv, but for a domestic league. So the users should be able to subscribe to a plan (both one time and recurrent payments) and be able to view on-demand content and livestreams. I will be using Braintree as payment processor. Easy integration here.

    So I'm thinking of building a new feature "subscriptions", adding this to the backend interface for administration purposes. On the frontend the only thing needed is a way to attach the SubscriptionId and payment info to a user.

    I have allready started building the feature, using the new "chat feature" as reference, so I hope I'm on the right track here?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    In your case, if there is a single tenant, you cannot use Features. Because Features are grouped in editions and editions cannot be assigned directly to users. You can assign editions to tenants.

    You can define a permission in your case and check that permission for necessary parts of your web page.

    In the future you might need some extra permisisons for subscribed users, so it's better to create a Role named "Subscribed" (or something like that :)) and group permissions in this role. Then assign this role to Subscribed users.

  • User Avatar
    0
    kythor created

    thanks for the reply, but it's a bit confusing. To be clear, I'm using multi-tenancy. But only to be future proof. At this time, I will only be using the default tenant for my portal.

    I want to users to be able to subscribe to a plan, after payment through Braintree, they will have access to certain parts of the portal.

    So I need a table where I store the different subscription plans, a table to store the user-subscription-payment info. I could create a new permission for every plan, that's a good idea I think. But I need to be able to manage this information through the back end. And when a user has payed for a plan, it will automatically add a record to the user-sub-payment table and set the right permission.

    Do I even need features or editions, can't I just add this custom functionality without using the aspnetzero infrastructure? Not that I really want to, but I need to work fast now...deadline is coming...

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Since you wanted to assign subscriptions to users not tenants, you dont need features and editions.

    Of course you can do it without depending of aspnetzero infrastructure, but in that way you need to check subscriptions of user for necessary parts of your application.