W
Wasp-lang•2w ago
samim

Remove Credits

Hi, I deployed the opensaas template on fly and created 3 plans (all of them subscriptions). However, by logging in, the user got 3 credits, how can I change that? He should have no subscriptions by default and once he buys one, it should be displayed there.
4 Replies
kapa.ai
kapa.ai•2w ago
Hi @samim. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To address your question about removing the default credits and modifying the subscription behavior in the OpenSaaS template, I'll need to provide some context and suggestions based on the available information. The OpenSaaS template includes a credit system by default, which is why new users are getting 3 credits upon logging in. To remove this and adjust the subscription behavior, you'll need to make some modifications to the codebase. Here are some steps you can take: 1. Remove default credits: Look for any code that assigns default credits to new users. This is likely in the user creation or registration process. Remove or comment out this code. 2. Modify subscription logic: Update the subscription-related code to ensure that users don't have any active subscriptions by default. This may involve modifying the user model and the subscription handling logic. 3. Update the UI: Ensure that the user interface doesn't display any credits or active subscriptions for new users until they actually purchase a plan. 4. Adjust Stripe integration: Make sure your Stripe integration is set up to handle your subscription plans correctly. However, it's important to note that the OpenSaaS template has undergone some changes recently, particularly in how it handles credits and subscriptions. As mentioned in the Discord support thread (https://discord.com/channels/686873244791210014/1205328655300038766), there have been updates to the credit system and subscription model. Given these changes and the specifics of your implementation, you might need to carefully review and modify several parts of the codebase to achieve your desired behavior. Unfortunately, I don't have enough detailed information about the exact current structure of the OpenSaaS template to provide more specific code changes. If you're having trouble making these modifications, you might want to consider: 1. Reviewing the latest OpenSaaS documentation for any updated guidance on subscription handling. 2. Reaching out to the Wasp community or maintainers for more specific advice on customizing the template for your needs. 3. If the credit system is deeply integrated and difficult to remove, you might need to consider starting with a more basic Wasp template and building your subscription system from scratch. Remember, when making these changes, be careful to test thoroughly to ensure you haven't broken any existing functionality. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @samim, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
samim
samimOP•2w ago
well, this is extremely difficult for me to do so, since I am not a developer and don't know how to modify the code so it still keeps running 😩
Vinny (@Wasp)
Vinny (@Wasp)•2w ago
@samim In the schema.prisma file, the default amount of credits is set to 3, so you have to remove the default field or set it to 0
martinsos
martinsos•2w ago
@samim unfortunately Wasp is currently made for developers, so you will need to be or become a developer to be able to use it! We are happy to help if you get stuck somewhere, but we are limited with our time so we can't help with too much stuff, you have to do the dev on your own.
Want results from more Discord servers?
Add your server