Stripe Error with Live Mode

You can dynamically specify the price ID. One way to do it between live and dev modes would be to save the live price id in your live bubble DB and the test mode price id in your dev mode bubble DB.

Create a thing of type Subscription. Add a field called Stripe Price ID. Then when you are subscribing the user to a plan click on dynamically specify plan. In Stripe Plan Name simply Do a search for Subscription’s Stripe Price ID.

Just make sure that you save your live price ID in the live bubble DB and you’re golden.

3 Likes

Yeah. I have done this method as well, especially when you need multiple price choices or discount codes. :+1::blush:

1 Like

The dynamic plan saved me! Thank you so much

2 Likes

I’m having the same issue with the stripe plugin after pasting data from live to test. When a purchase is made in the test mode an error message says"
Stripe error: No such customer: ‘cus_xxxxxxxxxxxx’; a similar object exists in live mode, but a test mode key was used to make this request.

Is there a work around for this? Are there any other errors I should lookout for in test or live mode that would be related to this?

Hey @siders :wave:

It says it’s your key. Can you share a screenshot of your workflow so we can see how to help? :blush:

Ah, thank you. Here is the workflow step that has the issue. There were no issues when it was initially set up - was working in both test and live. Now it’s not working in test, after I’ve copied data from live to test mode… and I’m also concerned how this error might impact the live version

Hmm :thinking:

In your Stripe plugin settings do you have a separate test and live key added?

yes, the test and live versions of the stripe plugin both worked great until I copied my live bubble data into test. Now when I try to run an order in the test version on my user account i get the Stripe error message noted above.

Yeah. That makes sense. Your customer ID was made in live but now you are using the test key in dev mode so it won’t work. You would have to create a user in test mode and then you can do the process. It can’t switch back and forth like that. That’s why it isn’t working. :blush:

Thank you for your help. Should I also avoid using stripe test mode with a user account that exists in both the test mode and the live mode? I’m concerned about the issue happening in the live mode, if a customer ID already exists in test mode.

1 Like

You’re welcome.

I think maybe just don’t copy your database from test to live.

Keep the databases separate. :blush:

OK haha, I have the same issue, ie “a similar object exists in live mode, but a test mode key was used to make this request”

I cant seem to figure out what is wrong. I have my live keys set correctly in the plug in settings and my test keys set as well in the development fields. I dont use the workflows to subscribe users on the front end, (Do i have to?) i only modify users with the data i receive from the webhooks connected to Stripe. (When a user’s checkout session is completed, plan is changed, etc,)

I made a brand new user in live mode, and made a completely new product in stripe. I was able to complete the checkout with the new product in stripe, and it redirects to my app. When i try to open a portal session, it gives that same error code above. I guess i still cant figure out where the error can be resolved, as everything is in live mode, and im not even using anything in test or development mode, and i made a fresh customer ID to test. Here is the error in the logs when the checkout session is completed. Note: the difference is the “no subscription exists, a similar object exists in live mode yada yada yada”
^i noticed in the logs that it runs my “update subscription” backend workflow before it runs the “subscribed” backend workflow, is that the subscription issue? Why does it make all these requests with a “test key”?

This one is so frustrating! Thanks for any help or advice, i know this one is a lot


I think there might be an issue with the order since it does say anonymous user in the logs. Try breaking them down in parts, one at a time, then once you have them all working, then put them all together. Does that help? :blush:

1 Like

Thanks @J805 ! I will try and just start over and that should fix it

1 Like