Open Closed

How to enable subscription plan in 4.4 #1689


User avatar
0
lan.dang created
  • ABP Framework version: v4.4.0
  • UI type: MVC / Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

As release note, in version 4.4 we will have subscription plan to allow user pay for new tenant (which is same as ASPNETBoilder Zero), right? After upgrade to version 4.4 I do not see this change. Could you have a document or any help on step by step to enable this feature in existing application?

Thanks


12 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @lan.dang

    Firstly you have to complete configuration with following documentation: https://docs.abp.io/en/commercial/latest/modules/payment#subscriptions

    After that, you have 2 options;

    • You can use standalone for your own purposes via following same documentation
    • Or Saas module has logic of subscriptioning to Editions.

    Tenant-Edition Subscription

    if you install both Volo.Saas & Volo.Payment modules properly, you'll see Plan Management and a Plan Selection dropdown in Edition modal:

    You can inject ISubscriptionAppSerivce and create a subscription:

    public class IndexModel : PageModel
    {
        public EditionDto Edition { get; set; }
    
        protected ISubscriptionAppService SubscriptionAppService { get; }
    
        protected ICurrentTenant CurrentTenant { get; }
    
        public IndexModel(
            ISubscriptionAppService subscriptionAppService,
            ICurrentTenant currentTenant)
        {
            SubscriptionAppService = subscriptionAppService;
            CurrentTenant = currentTenant;
        }
    
        public async Task<IActionResult> OnPostAsync(Guid editionId)
        {
            var paymentRequest = await SubscriptionAppService.CreateSubscriptionAsync(editionId, CurrentTenant.GetId());
    
            return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);
        }
    }
    

    Saas Service will track updates, endings or any changes at subscription and updates tenant edition.

  • User Avatar
    0
    lan.dang created

    Hi @enisn,

    My project is UI Blazor and I already added module payment &saas to project

    But when I run application, I could not see Plan management and Edition management does not have Plan

    Did I miss anything?

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Can you try add Volo.Payment.Admin.* packages into your projects if not exist:

    • Volo.Payment.Admin.Application -> YourProject.Application
    • Volo.Payment.Admin.Application.Contracts -> YourProject.Application.Contracts
    • Volo.Payment.Admin.HttpApi -> YourProject.HttpApi
    • Volo.Payment.Admin.HttpApi.Client -> YourProject.HttpApi.Client
    • Volo.Payment.Admin.Blazor.WebAssembly or Volo.Payment.Admin.Blazor.Server -> YourProject.Blazor

    Then you have to create a plan, you can follow Payment > Payment Plans menu to configure it.

    To configure your plans properly, please follow this documentation: https://docs.abp.io/en/commercial/latest/modules/payment#subscriptions

  • User Avatar
    0
    lan.dang created

    I already added Volo.Payment.Admin.* to project, *Then you have to create a plan, you can follow Payment > Payment Plans menu to configure it. >> * I do not see it in menu, what is access link I can configure in menu?

    I tried this link but it is not correct https://localhost:44307/saas/host/payments

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    I've tried with Blazor UI and it works

    I can share my sample project with you:

    SupportPayment.zip

  • User Avatar
    0
    learnabp created

    Dont really understand how ABP has build the Subscription & Payment System!

    the documentation is no good in explaining how it is implemented!

    How can a tenant be created using subscrition & payment from the Public Site ??

    Also why is the Payment Menu shown in a Tenant where they can add payment gateway? shouldn't it only be avalible to the host??

    see below i am logged in as a "Test Tenant" and i can see the Payment Menu and can change the Plans as a Tenant admin

  • User Avatar
    0
    lan.dang created

    It is same for me, I would like to allow tenant register by select plan which should be created by host but this feature is just used for tenant only

  • User Avatar
    0
    learnabp created

    Can we please have a response from someone from ABP??

    We we have to build our own page to create the tenant .... looks like the subscription system you have built is for tenant that are mannually created and why can the tenant specify his own payment gateway shouldn't this be restricted to the Host??

  • User Avatar
    0
    learnabp created

    still no response we need a working example of the Subscription and Payment system which creates a tenant ... happy to do a video for community if you explain how we can achive this

    please respond!

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @learnabp

    We'll release a documentation about Tenant - Edition subscription as soon as possible.

    Dont really understand how ABP has build the Subscription & Payment System!

    the documentation is no good in explaining how it is implemented!

    How can a tenant be created using subscrition & payment from the Public Site ??

    Also why is the Payment Menu shown in a Tenant where they can add payment gateway? shouldn't it only be avalible to the host??

    see below i am logged in as a "Test Tenant" and i can see the Payment Menu and can change the Plans as a Tenant admin

    For now, there is no public view implementation for subscription. You can make your own Pricing/Subscription page and then you can start a subscription with ISubscriptionService.

    We don't plan to make a Public UI, becuse there are many use cases, we can't handle all of them at once.

  • User Avatar
    0
    petri.uusitalo created

    Hello @enisn,

    I was also testing this feature and has some questions before you manage to create teh docs about it.

    You said earlier that SaaS service will track the changes and update tenant editions. What exactly is updated by the payment module when it receives events for subscriptions via webhooks?

    I created a test env. and hooked up the webhooks and event forwarding via Stripe CLI. From the Stripe CLI I can see that events are coming and from ABP app logs I can see that it has received the request and something is happening. But by looking at the db tables I cannot find what exactly it updates there?

    For e.g. if subscription is cancelled -> event is received by Stripe CLI and it forwards it to local ABP app /payment/stripe/webhook URL, then what I should see that was changed?

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    We have published a section on Saas Documentation about it.

    https://docs.abp.io/en/commercial/latest/modules/saas#tenant-edition-subscription

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11