Make a new price in strpie
I made a few prices for my stripe subscriptoin plans but i want to adapt them, however some of them have been used so i have to make a new price. What do i need to change in order to succesfully make a new price and use it on my saas.
11 Replies
Hi @Sven. 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, I can help you with setting up a new price for your Stripe subscription plans in your Wasp SaaS application.
When you create a new price in Stripe, you'll need to update your environment variables in your Wasp application to reference the new price ID. Here's what you need to do:
1. First, create your new price in the Stripe dashboard
2. Get the price ID from Stripe (it will look something like
price_1OXkv5AHms7vVycMvx4PzB0N
)
3. Update your .env
file with the new price ID
From the knowledge sources, it appears that the OpenSaaS template uses environment variables like SUBSCRIPTION_PRICE_ID
, HOBBY_SUBSCRIPTION_PRICE_ID
, or PRO_SUBSCRIPTION_PRICE_ID
to reference Stripe prices.
For example, your .env
file might contain something like:
The code that uses these price IDs is in your server actions, where it creates a checkout session:
If you're using multiple subscription tiers, you'll need to make sure your code correctly references the appropriate price ID for each tier.
If you're having issues with the implementation, you might want to check out the latest version of the OpenSaaS template, as there might be updates that handle multiple subscription tiers more elegantly.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?And how do i sett he secrets when deploying @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on your previous question about Stripe pricing, I understand you're now asking about setting secrets when deploying your Wasp application. Here's how to set environment variables (including secrets) when deploying:
Setting Secrets When Deploying
The method depends on your deployment platform:
For Fly.io
If you're using the Wasp CLI for deployment:
Or for multiple secrets at once:
If deploying manually:
Deploying Manually - Fly.io
For Heroku
Deploying Manually - Heroku
For Railway
Go to the Railway dashboard, open the
Settings
and go to the Variables
tab to add your secrets.
Deploying Manually - Railway
Important Notes:
1. For client-side environment variables (prefixed with REACT_APP_
), you need to provide them during the build process:
Defining Env Vars in Production
2. Never store secrets in client-side environment variables as they'll be publicly readable.
3. For Stripe webhook secrets in production, you'll need to create a webhook in the Stripe dashboard pointing to your server URL and then add the webhook secret to your server environment variables.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?"deploy": "REACT_APP_EXTENSION_ID=XX REACT_APP_GOOGLE_ANALYTICS_ID=XXX REACT_APP_API_URL=XXX wasp deploy fly deploy"
This is my command in package.json how do i adap to also update secrets @kapa.ai
Let me check the knowledge base for you again. One moment! :books:
----------------------
I see you're trying to update server-side secrets while deploying your Wasp app to Fly.io. Your current command correctly sets client-side environment variables (prefixed with
REACT_APP_
), but server-side secrets need to be handled differently.
For server-side secrets, you have two options:
Option 1: Set secrets before deployment
Then run your deployment command:
Option 2: Set secrets during initial deployment
If you're doing the initial deployment with launch
, you can use the --server-secret
flag:
Deploying with the Wasp CLI
Important notes:
1. Your current approach for client-side variables is correct. The REACT_APP_
prefixed variables are embedded into the client code during build time.
Defining Env Vars in Production
2. Server-side secrets should never be included directly in your package.json as they would be visible in your code repository.
3. You can verify your server secrets were set correctly with:
Deploying with the Wasp CLI
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?@kapa.ai how do i integrate a free trial in my pricing options
Let me check the knowledge base for you again. One moment! :books:
----------------------
Based on the knowledge sources, I can help you integrate a free trial into your Wasp application's pricing options.
According to a Discord support thread, you can add a trial period to your Stripe subscriptions by using the
trial_period_days
parameter when creating a subscription. This is documented in the Stripe API.
One community member shared their solution:
I found a way around this: I just add trial_period_days when creating a subscription, here's the doc: https://docs.stripe.com/api/subscriptions/create#create_subscription-trial_period_daysTo implement this in your Wasp application, you would need to modify your server-side code where you create the Stripe checkout session. Specifically, you would add the
subscription_data
parameter with the trial_period_days
field when creating the checkout session.
Here's how you might modify your code:
You'll also want to make sure your application correctly handles the trial status in your UI. You can check the subscription status in your webhook handler to determine if a user is in a trial period.
Remember to test this thoroughly using Stripe's test mode before deploying to production.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?@Wasp Team anyone that can help me witht his problem on
how to setup a 7day free trial?
And how to notify customer that trial is ending?
take ur time
tho
Please @ me
Hey @Sven this is quite non-Wasp/OpenSaaS specific -> it is more about Stripe and how stuff work there, and just general React / node.
@Vinny (@Wasp) might be able to help, but he is traveling at the moment, and the rest of the team doesn't know Stripe well enough.
I actually suggest you would get a better answer by asking GPT probably than us!
But if you have something more Wasp or Open-Saas specific, let us know.
I’ve never done this before. I’d also refer to stripe docs here @Sven
Ah okay thanks