W
Wasp16mo ago
Manan

Stripe not working in my Saas Template Project.

I have added a test product in stripe and added the appropriate keys in the .env.server file but it is not working and the error is not giving much information.
No description
17 Replies
miho
miho16mo ago
Please check the error in your terminal
Manan
MananOP16mo ago
The backend should be running on port 3001 right?
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
yes try restarting the wasp dev server as I mentioned in the other question and provide some details as to what errors youre seeing in your terminal @Manan
Manan
MananOP16mo ago
Restarted the project multiple times.
Manan
MananOP16mo ago
No description
No description
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
ok well its obviously an issue with your stripe payment operation. try adding some console.log statements and debugging to figure out where the error is happening 1. make sure you've got the test api key and price id (not product id) from your stripe dashboard. follow the instructions in the hackathon rules page or in the stripe docs
Manan
MananOP16mo ago
Already done and verified.
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
2. make sure you have a logged in user ( try console.log(context.user) in your stripe payment operation) 3. add other console.logs to see where the error could be happening
Manan
MananOP16mo ago
I think this is the problem. I am using google auth but not storing the data. Can you point me to a doc or something for that?
MEE6
MEE616mo ago
Wohooo @Manan, you just became a Waspeteer level 3!
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
i don't know what this means use the Postgres database by following the instructions in the template install docker desktop run wasp db start in a seperate terminal window
Manan
MananOP16mo ago
After google login, we have to store the user details to the database right?
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
actually your server is showing you that this is the problem, because stripePayment is giving you a 401 error and in the stripePayment operation we have this:
export const stripePayment: StripePayment<void, StripePaymentResult> = async (_args, context) => {
if (!context.user) {
throw new HttpError(401);
}
export const stripePayment: StripePayment<void, StripePaymentResult> = async (_args, context) => {
if (!context.user) {
throw new HttpError(401);
}
Manan
MananOP16mo ago
Yes. I understood the problem. Let me dig through the docs. Thanks.
Vinny (@Wasp)
Vinny (@Wasp)16mo ago
cool!
Manan
MananOP16mo ago
I'll DM you the client link, can you take a quick look into that? How's the project for the saas-a-thon.
Manan
MananOP16mo ago
Automatic tax was not setup in stripe. And it's not available for my country right now. I removed this line (48) from src>server>actions.ts and it worked finally.
No description
No description

Did you find this page helpful?