stripe issues
Hi I'm following the instructions and trying to get the customer portal link activated. "Note that there are variables set aside for your test portal link, as well as a production portal link. You will be warned in the console if you there is no link in the development environment, but the app will throw an error if there is no link in the production environment!"
Please help me understand exactly what I need to have in the constant.ts file to launch
9 Replies
Hi @Arnab. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The
constants.ts
file is where you should paste your Stripe Customer Portal link. This file is located in the src/shared
directory of your project. If you can't find this file, you may need to create it.
Here's an example of what the constants.ts
file might look like:
In this file, STRIPE_CUSTOMER_PORTAL_LINK
is an environment variable that should contain the link to your Stripe Customer Portal. You need to set this environment variable in your .env
file.
Your .env
file might look something like this:
Replace your_stripe_customer_portal_link_here
with the actual link to your Stripe Customer Portal.
Remember, environment variables allow your project to exhibit different behaviors in different environments, such as development, staging, or production. For instance, in development, you may want to use a test Stripe account, while in production, your app should use a real Stripe account. You can read more about environment variables in Wasp here (https://wasp-lang.dev/docs/project/env-vars).
If you're still having trouble, please provide more details about the issues you're encountering so I can provide more targeted assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Arnab, 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?In VScode I'm also getting errors in isDev and checkStripePortalLinkExists
Wohooo @Arnab, you just became a Waspeteer level 1!
checking in I'm still getting error in VScode in my constants.ts. Please help"
const customerPortalTestUrl = undefined
const customerPortalProdUrl = 'https://billing.stripe.com/p/login/hiddeennnnn'
export const STRIPE_CUSTOMER_PORTAL_LINK = isDev ? customerPortalTestUrl : customerPortalProdUrl;
checkStripePortalLinkExists(STRIPE_CUSTOMER_PORTAL_LINK); // throws an error if the link is not set in production
export enum TierIds {
HOBBY = 'hobby-tier',
PRO = 'pro-tier',
CREDITS = 'credits',
}
export const DOCS_URL = 'https://docs.opensaas.sh';
export const BLOG_URL = 'https://docs.opensaas.sh/blog';"
Hi @Arnab, just to be clear, you're talking about OpenSaas?
@Arnab please chekc out this issue -> does this solve your problem? https://github.com/wasp-lang/open-saas/issues/119
GitHub
checkStripePortalLinkExists throws an error · Issue #119 · wasp-lan...
The documentation (https://docs.opensaas.sh/guides/stripe-integration/) says to add this code to the src/shared/constants.ts file: const customerPortalTestUrl = 'https//billing.stripe.com/p/log...
fixed it thank you!
Where is the logic for credits? I'm trying to understand how to for example deduct credits for uploading and image.
@Vinny (@Wasp) one for you
I answered your question here, Arnab https://discord.com/channels/686873244791210014/1239409762526040114