Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: paid users #4834

Closed
2 tasks done
DankMemeGuy opened this issue Dec 9, 2022 · 9 comments
Closed
2 tasks done

🚀 Feature: paid users #4834

DankMemeGuy opened this issue Dec 9, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@DankMemeGuy
Copy link

🔖 Feature description

Users have the option to pay a one-time or subscription fee. Or could be mandatory.

I can't see a way to implement this right now with AppWrite, maybe I overlooked something?

🎤 Pitch

The use case is pretty obvious, but if a service is premium, or has a premium tier, users should be able to pay a one time or reoccurring fee to access the service. For example, maybe a web app has a free tier of like 10 uses, then afterwards it's 10$ a month.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@stnguyen90
Copy link
Contributor

Are you asking about how to implement an app that has this? This should be doable with Appwrite. In the simplest approach, I would add the user to a team that grants access if they are a paid customer.

@DankMemeGuy
Copy link
Author

Are you asking about how to implement an app that has this? This should be doable with Appwrite. In the simplest approach, I would add the user to a team that grants access if they are a paid customer.

That's the solution I had thought of. What I was thinking is actually more so ingrained into AppWrite itself. For example, this is how Firebase does it https://firebase.google.com/codelabs/stripe-firebase-extensions#0 and https://github.com/stripe/stripe-firebase-extensions/tree/master/firestore-stripe-payments it's directly engrained into the service.

On Firebase, when you install that "Run Subscription Payments with Stripe" extension, you then gain the ability to:

  1. createCustomer: Creates a Stripe customer object when a new user signs up.
  2. createCheckoutSession: Creates a Checkout session to collect the customer's payment details.
  3. createPortalLink: Creates links to the customer portal for the user to manage their payment & subscription details.
  4. handleWebhookEvents: Handles Stripe webhook events to keep subscription statuses in sync and update custom claims.
  5. onUserDeleted: Deletes the Stripe customer object and cancels all their subscriptions when the user is deleted in Firebase Authentication.
  6. onCustomerDataDeleted: Deletes the Stripe customer object and cancels all their subscriptions when the customer doc in Cloud Firestore is deleted.

having this built into AppWrite would allow for things like monthly subscriptions easily, since right now to implement a paid service the money application, lets say Stripe, has to verify the transaction then send a request back and then you have to set a new permission for that user, but also set an expiry for when the paid service ends. Then you need to build out a way to manage all that stuff, check out page, cancelation page, summary/billing history, etc. On the admin side, you don't ever get to easily see how many paid users you have, no stats around paid vs free, or anything regarding paid content vs free content, etc.

Am I making sense here?

@merabtenei
Copy link

@DankMemeGuy I don't think this is a priority for Appwrite, the main objective of Appwrite is to provide you with the building blocks that will allow you to build something like that. You can do all what you mentioned using Appwrite as a backend but you'll have to write a lot of code by yourself.
In a few words, think of Appwrite as Firebase, and you'll have to build something like stripe-firebase-extension for Appwrite by yourself.

@DankMemeGuy
Copy link
Author

Sure if AppWrite doesn't want to do it, but then there should be a way to have 'plugins' like what Firebase has. Developers can create plugins that can be 'plug-and-play' into AppWrite installations. A basic idea like paid users/SaaS would easily be used by many people and having developers each write their own implementation of something basic when instead a developer could just create a plugin that other developers could use.

@Shubhampratapsingh
Copy link

@DankMemeGuy yes this feature will be important. If we have client sdk it will reduce work.
Something like this i suggested: "https://userbase.com/docs/sdk/purchase-subscription/".
If we can also have client sdk for subscription, it will be helpful.

@dbjpanda
Copy link

+1

@eldadfux
Copy link
Member

eldadfux commented Jun 3, 2023

We're planing to add a more generic feature called User Labels. This will allow developers to add labels to users using the Appwrite Console or API key. Labels will also be added as a new permission type so you could restrict access to users using a specific label.

This feature should enable many new use cases, one of the is to create a function that is triggered by stripe every time a user pay, and you could give them a label like pro, premium or whatever works to your use case.

@stnguyen90 stnguyen90 added enhancement New feature or request and removed feature labels Mar 20, 2024
@DrSocket
Copy link

DrSocket commented May 7, 2024

+1 great idea for the plugins!

@stnguyen90
Copy link
Contributor

Closing as labels have been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants