W
Wasp-langβ€’4mo ago
Killshot

Lemon Squeezy Integration into OpenSaas (Alternative to Stripe)

I will be working on integrating Lemon Squeezy with open saas, as stripe is not supported in my country, after i am done i will submit PR to the team for others to use it. If you have already done it or thinking of doing so, feel free to chime in and let's talk it out. Link to LemonSqueezy Docs -- https://docs.lemonsqueezy.com/api
No description
67 Replies
kapa.ai
kapa.aiβ€’4mo ago
Hi @Killshot. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the knowledge sources provided do not contain any information about integrating Lemon Squeezy with OpenSaaS. However, your initiative to integrate it and contribute back to the community is highly appreciated. For any issues or discussions related to Wasp and OpenSaaS, you might want to consider joining the Wasp Discord community (https://discord.com/channels/686873244791210014/). It's a great place to share experiences, ideas, and get help from other community members. Remember to follow the guidelines and best practices for contributing to the project. Good luck with your integration! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Killshot, 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?
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
cc: @skyblade2954
skyblade2954
skyblade2954β€’4mo ago
When do you plan to create this PR? @Killshot
Killshot
Killshotβ€’4mo ago
Will be working gradually on it till the weekend, Will give an update as soon as i can.
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
awesome. here's a link to the related issue in github https://github.com/wasp-lang/open-saas/issues/16
GitHub
add lemonsqueezy payment support Β· Issue #16 Β· wasp-lang/open-saas
Open SaaS currently has subscription payments via Stripe. It would be nice to add similar support for Lemon Squeezy as mentioned by @shengxinjing Process move the action stripePayment from app/src/...
martinsos
martinsosβ€’4mo ago
Awesome, we are here to help out!
Ε lukas MacPrΓ‘sk
Would be good to add Paddle as well
Killshot
Killshotβ€’4mo ago
I talked with a few colleagues and most seem to be Leaning towards Paddle as it has no fees On Payout, while LemonSqueezy charges a bit more. I had to finish some other work this weekend and didn't even get a chance to initiate integration this weekend. But i am actively working on this and will provide an update soon.
MEE6
MEE6β€’4mo ago
Wohooo @Killshot, you just became a Waspeteer level 4!
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
That's great to hear. Thanks for the update!
Killshot
Killshotβ€’4mo ago
I am doing google oauth into my MVP and it seems to be giving a 401 error just after the i am finished doing the login via google.
Killshot
Killshotβ€’4mo ago
No description
Killshot
Killshotβ€’4mo ago
when i login via google it gives a 302 code but just after that i am again being unauthorized --
No description
Killshot
Killshotβ€’4mo ago
No description
Killshot
Killshotβ€’4mo ago
No description
Killshot
Killshotβ€’4mo ago
@kapa.ai can you help?
kapa.ai
kapa.aiβ€’4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Of course, I'd be happy to help! However, I need a bit more information about what you need help with. Could you please provide more details about your question or the issue you're facing? ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Killshot, 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?
Killshot
Killshotβ€’4mo ago
No description
Killshot
Killshotβ€’4mo ago
@kapa.ai I am doing google oauth into my MVP and it seems to be giving a 401 error just after the i am finished doing the login via google. [ Server ] GET /auth/me 401 0.586 ms - 43 [ Server ] GET /auth/me 401 0.902 ms - 43 [ Server ] GET /auth/me 401 0.428 ms - 43 [ Server ] GET /auth/google/login 302 1.207 ms - - [ Server ] GET /auth/me 401 0.827 ms - 43 [ Server ] GET /auth/me 401 0.679 ms - 43 here are the logs.
kapa.ai
kapa.aiβ€’4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The 401 error you're seeing typically indicates an unauthorized request. This could be due to a variety of reasons, such as incorrect or missing authentication credentials. Based on the knowledge sources provided, here are a few things you could check: 1. Environment Variables: Ensure that you have correctly set up your environment variables in the .env.server file. You should have the GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET variables set with the correct values. Source (https://wasp-lang.dev/docs/auth/social-auth/google#4-adding-environment-variables) 2. Google OAuth Configuration: Make sure that you have correctly configured Google OAuth in your Google Cloud account. The redirect URI should be correctly set to point to your client. Source (https://discord.com/channels/686873244791210014/1208366712450195466) 3. Auth Methods in main.wasp: Check your main.wasp file, specifically the auth methods section. If you're using Google OAuth, you should have google:{} added in the methods. Source (https://discord.com/channels/686873244791210014/1208366712450195466) If you've checked all of these and are still encountering the issue, it might be helpful to provide more context or consider reaching out to the Wasp community on their Discord server (https://discord.com/channels/686873244791210014/) for more specific help. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Killshot, 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?
skyblade2954
skyblade2954β€’4mo ago
Why are you doing Google Auth? Paddle needs Google Auth?
skyblade2954
skyblade2954β€’4mo ago
Go-live checklist - Paddle Developer
Everything you need to do to transition to live when you've set up Paddle in sandbox.
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
@Killshot kapa is almost correct there, but made a mistake. Make sure the redirect url poiints to your server like this http://localhost:3001/auth/google/callback the docs outline this well https://wasp-lang.dev/docs/auth/social-auth/google#3-creating-a-google-oauth-app other than that, Kapa was right. Check your env variables and main.wasp file to make sure it's all set up correctly Also, check your server logs for any errors and share them here if you find any
Killshot
Killshotβ€’4mo ago
i already had the email auth working but also needed to add google auth before i moved on to payments.
Killshot
Killshotβ€’4mo ago
my mind went straight on to here and i did include this in the redirect urls from google, including the nip.io links
No description
skyblade2954
skyblade2954β€’4mo ago
Also for paddle you need, correct URL not localhost.
Killshot
Killshotβ€’4mo ago
Main.wasp is configured properly cause i am able to finish the google auth login but still as soon as it happens, i get logged out again and the only logs i see in terminal is a 401 error as mentioned earlier in this pic, It wouldn't even work with nip.io ? I already have a domain where i could try it out, but i will still be doing lemonsqueezy first as i already have an approved store there. I still have to do signups for Paddle. Appreciate the input though @skyblade2954 anything else i should know before i signup with paddle?
skyblade2954
skyblade2954β€’4mo ago
You can check the link I sent you, I am looking for integrating it to my own project. I am new too. However openSaaS needs a proper Paddle or Lemon Squeezy implementation. Otherwise, project is limited to US. Shipfa.st has lemon squeezy. @Vinny (@Wasp)
Killshot
Killshotβ€’4mo ago
Yes i did, That's why i am doing lemonsqueezy first as paddle requires extensive checks of domains and website. But i am afraid my current problem lies with google oauth.
miho
mihoβ€’4mo ago
If you are using nip.io then you need to make sure that the client is going to the correct server URL, also the server needs to be aware of the correct client URL as outlined here: https://github.com/wasp-lang/learning-materials/blob/main/README.md#testing-wasp-apps-on-local-network Make sure to also follow the Google OAuth instructions in the docs correctly πŸ™‚ https://wasp-lang.dev/docs/auth/social-auth/google If the redirect URL and the env vars are set up correctly, it should work 100%
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
give this a try @Killshot πŸ‘†and let me know
skyblade2954
skyblade2954β€’4mo ago
I think Lemon Squeezy easy to implement, I will buy a domain and try tomorrow.
Killshot
Killshotβ€’4mo ago
yes this worked, Updated the nip.io values in env.client and it finally authorized. (Had to delete user with same email id by running wasp db studio)
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
awesome
Killshot
Killshotβ€’4mo ago
Hey @kapa.ai What's the best way to install dependencies in my wasp project via npm?
kapa.ai
kapa.aiβ€’4mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- In a Wasp project, dependencies are defined in a standard way for JavaScript projects: using the package.json file, located at the root of your project. You can list your dependencies under the dependencies or devDependencies fields. To add a new package, you use npm. For example, to add a package like date-fns, you would use the following command:
npm install date-fns
npm install date-fns
This command will add the package in the dependencies section of your package.json file. Please note that there are some packages in the dependencies section, like react and wasp, that Wasp uses internally. You should not modify or remove these. In the current version of Wasp, if Wasp is already internally using a certain dependency (e.g. React) with a certain version specified, you are not allowed to define that same npm dependency yourself while specifying a different version. If you do that, you will get an error message telling you which exact version you have to use for that dependency. This means Wasp dictates exact versions of certain packages, so for example you can't choose the version of React you want to use. For more details, you can refer to the Wasp documentation on project dependencies (https://wasp-lang.dev/docs/project/dependencies). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Killshot, 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?
martinsos
martinsosβ€’4mo ago
@Killshot you should be able toj ust install them normally, with npm install. As for Google Auth issues -> so you had to update nip.io values! Anything we could have provided in the docs that would have helped you upfront with that? We probably don't want to go as specific as to mention nip, but maybe some general guidelines that would help? Also, you said Had to delete user with same email id by running wasp db studio -> can you elaborate on this, what happened there, why did you have to delete that user?
Killshot
Killshotβ€’4mo ago
nip.io instructions were pretty clear, Nothing in the docs needs change for that i guess. and about the second question, i did email auth first and created user with same email as google email id, then when i again integrated google auth and used the same email account to sign up it said the user already exists.
martinsos
martinsosβ€’4mo ago
Ah yes we don't yet have account merging, ok makes sense! I am asking questions about docs because it seems to me we quite often get questions from devs who misconfigured something on the Google Auth side, so I would love to figure out if we can somehow prevent that hm.
Killshot
Killshotβ€’4mo ago
i did have an open thread here regarding a totally different issue, I have tried many ways but somehow i can't see my wasp app on mobile while local testing. yes even after using the nip.io method. The issue just seems to be for windows wsl, even tried turning oof firewall and antivirus, nothing helped.
nitish30
nitish30β€’4mo ago
Hi, any further updates?
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
Not sure. It seems like progressed stalled on this. I will probably take this over as soon as I can after we release Wasp v0.14 next week
skyblade2954
skyblade2954β€’4mo ago
This is important Vinny, many countries doesn't have the current payment system.
Vinny (@Wasp)
Vinny (@Wasp)β€’4mo ago
Would you like to take over this issue and submit a PR? That would be super helpful. Then we can get it done quicker for all those who have been asking for it. I would love to do it now but unfortunately don't have the time 😦
skyblade2954
skyblade2954β€’4mo ago
I might but PR's are difficult things, I plan to add a different payment system. We will see. I don't want to promise. But I will add Lemon Squeezy to my app. With that I will check if I can create a PR, and you would also make some commit on that PR. We will see.
Filip
Filipβ€’4mo ago
Thanks @skyblade2954, no pressure though. If you can help us, we'll be happy. But it's perfectly fine if you only help yourself πŸ™‚
Killshot
Killshotβ€’4mo ago
They didn't approve my Business verification on LemonSqueezy Side. And thus i felt to wait for it a Bit. As soon as it gets approved i am going to do it.
MEE6
MEE6β€’4mo ago
Wohooo @Killshot, you just became a Waspeteer level 5!
nitish30
nitish30β€’3mo ago
That would be helpful πŸ™‚
Killshot
Killshotβ€’3mo ago
Stripe Buys LemonSqueezy. Explains why they have been so slow in resolving user tickets rather πŸ₯²
Vinny (@Wasp)
Vinny (@Wasp)β€’3mo ago
@here I've got a draft PR of LemonSqueezy integration here: https://github.com/wasp-lang/open-saas/pull/246 You can check it out and use it to integrate lemonsqueezy on your own, but be aware that I haven't fully tested it. Regardless, everything seems to be working, and there are even instructions for testing webhooks locally using ngrok in the PR. I've pushed the draft now because I'm going on vacation next week, and I know some of you are eagerly awaiting this. Feel free to help out and finish off the leftover ToDo's that I've listed in the PR if you're feeling up to it πŸ™‚
GitHub
add lemon squeezy as payment provider by vincanger Β· Pull Request #...
Resolves #103 and Resolves #16 Add lemonsqueezy checkout (operation, util functions, etc) Add webhook and handle necessary events Add operations to pricing page Add ability to access lemonsqu...
No description
skyblade2954
skyblade2954β€’3mo ago
If you finish this before me starting to lemon squeezy, I would be gratefull to you until I die..
neogeofun
neogeofunβ€’3mo ago
Lemon Squeezy seems to have been acquired. By Stripe! πŸ˜„
Vinny (@Wasp)
Vinny (@Wasp)β€’3mo ago
yes but I think the product will remain the way it is for quite some time so I went ahead with the integration
Killshot
Killshotβ€’3mo ago
Really good work vinny, I didn't go ahead because they are still asking me for various documents and my ticket is still pending with the support, They have been really slow in replying to me. But i will test it out when i get the time and let you know if anything's bugging. Really good work man. Same πŸ˜…
Vinny (@Wasp)
Vinny (@Wasp)β€’3mo ago
No worries
Killshot
Killshotβ€’3mo ago
How's weekend going boss? Mine's about to end in few hours πŸ˜…
Vinny (@Wasp)
Vinny (@Wasp)β€’2mo ago
Ok its finally been implemented. More info here: https://docs.opensaas.sh/guides/payments-integration/
OpenSaaS.sh
Payments Integration
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Killshot
Killshotβ€’2mo ago
what do i need to do to update my project files from wasp? i am on version 14 but don't see PaymentProcessor file @kapa.ai what do i need to do to update my project files from wasp? i am on version 14 but don't see PaymentProcessor file
kapa.ai
kapa.aiβ€’2mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- To update your Wasp project, you need to follow a few steps: 1. Update Wasp CLI: The current way to update Wasp is to run the installer again with the following command: curl -sSL <https://get.wasp-lang.dev/installer.sh> | sh. If you already have Wasp installed, it will tell you to run it a bit differently to overwrite the files. Source (https://github.com/wasp-lang/wasp/issues/616) 2. Migrate Your Project: If you're migrating from an older version to a newer one, you need to follow the migration guide provided by Wasp. For example, if you're migrating from version 0.11.X to 0.12.X, you can follow the migration guide from 0.11.X to 0.12.X (https://wasp-lang.dev/docs/migrate-from-0-11-to-0-12). If you're migrating to version 0.13.X, make sure to read the migration guide from 0.12.X to 0.13.X (https://wasp-lang.dev/docs/migrate-from-0-12-to-0-13) after you finish the first one. Source (https://wasp-lang.dev/docs/migrate-from-0-11-to-0-12) 3. Rebuild Your App: After making updates, you need to rebuild your app by running wasp build. Source (https://wasp-lang.dev/docs/advanced/deployment/manually#updates--redeploying) As for the PaymentProcessor file, it's not mentioned in the provided knowledge sources. If it's a file you're expecting to see after the update, it might be worth checking the specific documentation for the version you're updating to, or reaching out to the Wasp community for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Killshot, 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?
Vinny (@Wasp)
Vinny (@Wasp)β€’2mo ago
Hey. You don't get the Open SaaS updates via the Wasp version. To get Lemon Squeezy feature, you have a few options: - if you haven't started customizing the template yet, then just start a new project with wasp new -t saas and it will give you all the new code - if you have started working on your SaaS and custimizing the template, you have two options: 1. just go to the Open SaaS repo and copy-paste the relevant code into your project (best if you've made significant changes to the template) 2. start a new project and copy-paste your custimized code into it (best if you haven't made many changes to the template yet)
Killshot
Killshotβ€’2mo ago
I decided to go with second bullet point option 1, and while i see no error on recompilation, I do keep getting "[ Server ] GET /auth/me 304 6.325 ms - - [ Server ] User with ID 123... does not have a LemonSqueezy customer portal URL [ Server ] POST /operations/get-customer-portal-url 200 6.654 ms - 45" i did update the env variable with store ids and variant ids, if i go to pricing page and click buy now i also get proper buying checkout page, but i can't help wonder if there's something wrong as i keep getting the above mentioned lines in my console... I have deleted all the irrelevant stripe code and directories.
Vinny (@Wasp)
Vinny (@Wasp)β€’2mo ago
ah. for Lemon Squeezy, a user gets assigned a personal customer portal URL on checkout (after they pay) maybe I should clarify this somewhere you could change this console.log statement in the lemon squeezy paymentProcessor file
console.log(`User with ID ${args.userId} does not yet have a LemonSqueezy customer portal URL. This will be assigned after the first successful payment.`);
console.log(`User with ID ${args.userId} does not yet have a LemonSqueezy customer portal URL. This will be assigned after the first successful payment.`);
Killshot
Killshotβ€’2mo ago
Ah okay, got it.
Vinny (@Wasp)
Vinny (@Wasp)β€’2mo ago
sorry for the confusion
Killshot
Killshotβ€’2mo ago
Naah man, No worries at all, Was finally able to figure it out and your clarification helped a ton.
Vinny (@Wasp)
Vinny (@Wasp)β€’2mo ago
great πŸ™‚
Want results from more Discord servers?
Add your server