stripe a similar object exists in test mode, but a live mode key was used to make this request

Viewed 2789

This is less a question and more of an answer to this issue that caused me several hours of aggravation. I did find the solution online but not in a direct or easy place.

It turns out that the problem actually had nothing to do with whether I was using test or live keys on my site.

I had deployed my code to heroku, updated my env to match the live keys and received the error listed in the title of this thread.

The solution is actually pretty simple and the problem actually exists in stripe not my code.

I had defined Subscription Plans in test, I then had to create new plans for the live version (no import ability, but that is a frustration for another day).

The problem is that you actually have to go back into your test plans, temporarily rename them, and then rename them back.

So if I have Plan-A in test and I create Plan-A in live, I then need to rename Plan-A in test to something else like Plan-A1. Then I can rename it back to Plan-A and Stripe then works properly.

Anyway, I hope this solves the issues for others because it is really annoying to try to figure out what is wrong and blaming your code is not always the case.

0 Answers
Related