How to test billing
I've connected my stripe account in the billing tab and in Stripe I switched to test mode. I just want to test out the payments and stuff but I get the error shown in the screenshot. Is there some additional setting I have to change in Kinde? Right now my environment is not live.

19 Replies
Hi there,
The error you're seeing indicates that your Kinde environment is connected to Stripe's live mode, but you're trying to use test card details. To fix this, you need to ensure you're working in the correct Kinde environment.
1. Switch to your non-production environment in Kinde - Make sure you're in your test/development environment, not your production environment
2. Connect Stripe in the test environment - Go to Settings > Environment > Billing in your non-production environment and connect your Stripe account there
3. Verify the environment setup - When you're in the test environment and go through the Stripe onboarding flow, you'll be prompted through a test flow where you can continue or select Return to Kinde
After switching to your non-production environment and connecting Stripe there, you should be able to test payments using Stripe's test card numbers without encountering the live mode error.
Please let me know if you have further questions.
This is what's showing up beside my environment in Kinde, so this is a non-product environment correct?

If it is a non-production environment then I had already connected the stripe account with it in the "Not live" mode. Was there something else I was supposed to do before that?
No, "Not Live" doesn't mean it's not a production environment.
When it says the production environment, it's the default environment you got when you first signed up to Kinde and must be used as your production environment. You cannot delete the production environment or add additional production environments
production vs non-production - determines the environment's role and capabilities
Please check this document.
https://docs.kinde.com/build/environments/environments/
That seems to work, I created a new environment that doesn't say "Not live" and when I was connecting stripe it specifically said at the top that it's creating a test account with test data. I'm facing another problem though now where when the user registers for a new account they aren't redirected to the checkout page. I didn't have this issue with my previous environment. I've made the pricing table live, the stripe account says "Connected" and in the billing experience checkbox I've turned it in to show the pricing table, but they automatically just get rerouted directly to the dashboard of the website.

The issue is likely that you need to pass the pricing table code in your registration URL or SDK configuration. Even though you've made the pricing table live and enabled the billing experience, users won't see the checkout flow unless you specifically include the pricing table parameter
The most common issue is that the pricing table code isn't being passed in the registration flow, so users bypass the billing step entirely. Check your registration URL or SDK configuration to ensure it includes the pricing table parameter.
https://www.youtube.com/watch?v=67SRr5cLmQA&t=270s I was referencing this video here and it seems like they had just added the registration link and it automatically rerouted them to the payments page
ByteGrad
YouTube
NEW: Add Stripe Payments To Next.js In 2 Minutes! (Billing / Stripe...
Next.js Billing & Authentication has never been easier
👉 Get $50 Kinde credit (sponsored): https://kinde.com/bytegrad-nextjs-billing/
👉 React & Next.js Course: https://bytegrad.com/courses/professional-react-nextjs
Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
👉 Check out Kinde for auth and more https://bit.ly/3...
is there something else I need to add on the dashboard in Kinde?
I also have this option checked in the pricing table

That's the right thing you checked.
Also verify these settings:
1. Billing experience setting: Go to Settings > Environment > Billing and ensure Show the pricing table when customers sign up is enabled . If this is switched off, pricing tables will be hidden in the sign up flow.
2. Plan status: Make sure your plans are published .
3. Pricing table status: Confirm your pricing table is set to Live



They're all turned on
hmm, let's check a few more things.
Check pricing table display logic
The pricing table is shown when a new user registers. However, there are specific conditions based on your billing model:
- B2C (User-based): A pricing table is shown when a new user registers or an existing user marked as a billing customer signs in but isn't on a plan yet
- B2B (Org-based): A pricing table is shown when a new organization registers (with is_create_org parameter)
Since this worked in your previous environment, compare:
- Plan group settings between environments
- Billing model configuration (B2C vs B2B)
- Application settings in the new environment
If none of these resolve the issue, you might want to check if there are any differences in how the new environment is configured compared to your previous working environment, particularly around plan groups and billing model settings.
The problem was with the group settings, initially the "This group is for" option was set to "Organizations" so I created a new group and set it to Users which now makes the billing work! Thank you so much for the help, I really appreciate it.

Awesome, I am glad to hear you solved the problem.
Please don't hesitate to reach out with any further questions.
I was also trying to check if the user has paid or not and when they haven't do you know how i can re route them to the billing page? Like right now if I register a new user, go to the billing page, then go back to the landing page of the website and login then I have full access to the site without paying. I want to make so that in my Next JS middleware if the user hasn't paid then I can redirect them to that page or just delete the user so they can go through the registration flow and pay through there. Do you know how I can do this?
Hi there,
I am sorry for not responding sooner.
Could you let me know if you are using App router or Pages router in your Nextjs app?
For checking payment status and redirecting users in Next.js middleware, you can implement custom authorization logic using Kinde's middleware capabilities.
To track payment status, you'll need to:
1. Set up a custom permission like access:paid in your Kinde dashboard
2. Grant this permission to users after successful payment
3. Use the Kinde Management API to update user permissions when payment is processed
FYI, https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#set-up-middleware
Hey, thanks a lot for the response. This code helps a lot cause I've been doing my middleware differently where I was just using Next JS's middleware function instead of the withAuth function. I had also opened another question on the forum here #How to redirect user to the billing page with some more details on the issue.
Awesome, I will take a look.