checkStripePortalLInkExists in shared/constants.ts

I'm using OpenSaas with with wasp 0.13.2 and WSL2. 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/login/test_...'
const customerPortalProdUrl = undefined

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
const customerPortalTestUrl = 'https//billing.stripe.com/p/login/test_...'
const customerPortalProdUrl = undefined

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
isDev and checkStripePortalLinkExists are not defined and throw an error.
OpenSaaS.sh
Stripe Integration
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
4 Replies
kapa.ai
kapa.ai8mo ago
Hi @Louis Deconinck. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, it seems that there might be some confusion regarding the isDev and checkStripePortalLinkExists functions. These functions are not defined in the provided code snippet, and they are not mentioned in the provided knowledge sources. The isDev function is typically used to check if the current environment is a development environment. If it's not defined in your project, you might need to define it yourself or import it from a library if it's a part of one. The checkStripePortalLinkExists function seems to be a custom function that checks if the Stripe portal link exists. If it's not defined in your project, you might need to implement this function yourself. However, without more context or information, it's hard to provide a more specific solution. I would recommend checking the rest of your project's code to see if these functions are defined elsewhere. If they're not, you might need to implement them yourself or consult the OpenSaaS or Wasp documentation or community for more guidance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Louis Deconinck, 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?
Louis Deconinck
Louis DeconinckOP8mo ago
@Wasp Team Any idea how to deal with missing isDev and checkStripePortalLinkExists in sec/shared/constants.ts file when following OpenSaas docs. Do we have to implement these functions ourselves? Like this?
const development = true;

// isDev function checks if the current environment is development
function isDev() {
return development;
}

// checkStripePortalLinkExists function checks if the Stripe portal link exists
function checkStripePortalLinkExists(link: string | undefined) {
if (!link) {
throw new Error("Stripe customer portal link is not set");
}
}
const development = true;

// isDev function checks if the current environment is development
function isDev() {
return development;
}

// checkStripePortalLinkExists function checks if the Stripe portal link exists
function checkStripePortalLinkExists(link: string | undefined) {
if (!link) {
throw new Error("Stripe customer portal link is not set");
}
}
Vinny (@Wasp)
Vinny (@Wasp)8mo ago
Ah this looks like a mistake. We removed this check recently I believe but forgot to remove it from the docs So you can just ignore that portion of the docs. You should see the customer portal link in .env.client instead @Louis Deconinck do you mind submitting an issue on the github repo about this? I’m on vacation and will fix it when I return.
Filip
Filip8mo ago
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...
Want results from more Discord servers?
Add your server