Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix HOBBY_SUBSCRIPTION_PRICE_ID, PRO_SUBSCRIPTION_PRICE_ID and CREDITS_PRICE_ID env vars with STRIPE_ ? #145

Closed
Martinsos opened this issue May 23, 2024 · 8 comments
Assignees
Labels

Comments

@Martinsos
Copy link
Member

These are in .env.server, they are next to STRIPE_ env vars, but are not prefixed with STRIPE_. Why is that so? Are these not Stripe specific? Because of id part, it sounds to me like that are specific for Stripe, that id is id on Stripe.

If they are not specific for Stripe then ok, but if they are, we should prefix them also right?

@rugs07
Copy link

rugs07 commented Jun 10, 2024

I am also getting errors here about which ID to put here? Also onclick my page isnt redirecting to stripe payment page

@vincanger
Copy link
Collaborator

vincanger commented Jun 10, 2024

Hi @rugs07 have you setup stripe as explained here https://docs.opensaas.sh/guides/stripe-integration ?

If so, can you share the console log statements coming from the server?

@vincanger
Copy link
Collaborator

vincanger commented Jun 10, 2024

yeah these are specific to Stripe and should be prefixed with STRIPE_ @Martinsos. I've assigned myself and will take care of it later today

@vincanger vincanger self-assigned this Jun 10, 2024
@rugs07
Copy link

rugs07 commented Jun 11, 2024

Hi @rugs07 have you setup stripe as explained here https://docs.opensaas.sh/guides/stripe-integration ?

If so, can you share the console log statements coming from the server?

Sure vincanger,The console log statements are as below
Failed to load resource: the server responded with a status of 400 (Bad Request)
http://localhost:3001/operations/stripe-payment
index.tsx:86 Stripe Tax has not been activated on your account. Please visit https://stripe.com/docs/tax/set-up to get started.
Also I have setup the product in my stripe and have also followed the steps given on docs, but I am unable to find what to write here, export enum TierIds {
HOBBY = 'hobby-tier',
PRO = 'pro-tier',
CREDITS = 'credits',
}
from my stripe product file, I have price_ID, Product_ID and product_name, I have tried all it isnt working and I have also checked my keys all are correct

@vincanger
Copy link
Collaborator

@rugs07 the error is telling you that stripe tax is not activated on your account. I think for some countries this is necessary or you can deactivate it in the stripeUtils.ts like this:

    return await stripe.checkout.sessions.create({
      line_items: [
        {
          price: priceId,
          quantity: 1,
        },
      ],
      mode: mode,
      success_url: `${DOMAIN}/checkout?success=true`,
      cancel_url: `${DOMAIN}/checkout?canceled=true`,
      automatic_tax: { enabled: false }, // changed to FALSE
      customer_update: {
        address: 'auto',
      },
      customer: customerId,
    });
    ```

@rugs07
Copy link

rugs07 commented Jun 12, 2024

@rugs07 the error is telling you that stripe tax is not activated on your account. I think for some countries this is necessary or you can deactivate it in the stripeUtils.ts like this:

    return await stripe.checkout.sessions.create({
      line_items: [
        {
          price: priceId,
          quantity: 1,
        },
      ],
      mode: mode,
      success_url: `${DOMAIN}/checkout?success=true`,
      cancel_url: `${DOMAIN}/checkout?canceled=true`,
      automatic_tax: { enabled: false }, // changed to FALSE
      customer_update: {
        address: 'auto',
      },
      customer: customerId,
    });
    ```

Also what about this part?
here, export enum TierIds {
HOBBY = 'hobby-tier',
PRO = 'pro-tier',
CREDITS = 'credits',
}

@Martinsos
Copy link
Member Author

@rugs07 it might be useful if you go to our Discord Server and ask this question there in #questions, it is a better place for helping with using OpenSaas, and other community members are more likely to help, while here it is more about technical aspects of open saas itself.

https://discord.gg/rzdnErX

@vincanger
Copy link
Collaborator

PR --> #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants