Base solution for your next web application
Open Closed

What are the recommended best practices for setting up recurring billing with Stripe #12607


User avatar
0
eric_pulaski created

We are integrating Stripe with our ASP.NET Zero application. What is the recommended way to

a. Setup recurring billing and connect an Edition to a product in Stripe? For monthly billing, I’m guessing that the Subscription end date would get reset every month each time the user successfully completes a monthly payment in Stripe? Do we need to write custom code to do this in the Stripe event handler in ASP.NET Zero, or is there a way to set this up without customizing the event handling code in ASP.NET Zero?

b. Setup the purchase of add on SKUs other than Upgrades to a new Edition. For example, if we wanted to charge customers for “Add-on Users” using a Feature for “User count”. It looks like this would all need to be through custom code we would need to write, but I’m just wondering if there are any build in-features (for example, a way to offer a “Additional Users” when the user goes to upgrade their subscription, without writing all the code from scratch. We would like to modify the ASP.NET Zero code as little as possible, but we do need to support an add-on SKU that’s the user can purchase that is not an Edition upgrade.

Thanks in advance for your additional help!

Best,

-Eric

P.S.: This is a duplicate question of the one I asked in an "answer" to #12601, but I did not get a reply yet, and I was not sure if it was going to be seen because it was an "answer", so I created this new support question. Sorry for the duplication.

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi Eric,

    With this integration, you don't have to manually configure anything. You just need to configure Stripe credentials in appsettings.json file. When someone subscribes to an Edition, ASP.NET Zero creates a product on your Stripe account and a customer (with the Purchaser's info) and subscribes customer to that product and charges the first payment.

    After 1 month (If subscription is monthly), Stripe tries to charge the customer and if it succeeds, Stripe sends a webhook to your ASP.NET Zero app and your app updates customer's (a Tenant in ASP.NET Zero) information (EditionId basically).

    For Stripe integration, you can check https://docs.aspnetzero.com/aspnet-core-mvc/latest/Features-Mvc-Core-Subscription-Stripe

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)