Stripe problem, cannot change API keys once connected

Hello, I put the Stripe test API keys in Sharetribe Admin panel. They are connected but it seems that they cannot be changed after connection? Please help…

Hi Tommy,

You can change them from console.
You can reach me at mn.saeed91@gmail.com
Skype: mohammad.nadeem391

Regards
Mo. Nadeem
Ruby on Rails & Sharetribe customisation Developer

Hello, ypu mean editing config.yml?

You can indeed edit things via your Rails Console or database, however in practice you should first set them null and input them again from the UI to make sure that the validation process goes smoothly with Stripe.

Are you changing the Stripe keys because your generated new ones, or because you want to use a new Stripe account?

If the latter, this is a bit more challenging as you’ll have to disconnect all the Sellers accounts! They don’t existing in the new Stripe account, so providers would have to connect their bank details again, and you’ll have to manage pending payouts manually. In that situation, editing keys is not trivial at all :wink:

Hello! I am changing the Stripe keys. It seems I must drop the database and create new, but I am having some trouble with it as I am not so fluent with Rails. It needs more than just dropping and creating in mySQL?

Now I got it.

RAILS_ENV=production rake db:drop DISABLE_DATABASE_ENVIRONMENT_CHECK=1

for dropping database

RAILS_ENV=production bundle exec rake db:create
RAILS_ENV=production bundle exec rake db:structure:load
RAILS_ENV=production bundle exec rake ts:index

Then you get fresh start. Luckly my marketplace wasn’y published yet!

That was quite extreme to delete everything and start from scratch :smiley:

But good to hear that it worked for you. Keep up the good work!

I am just starting and learning so it was no loss :slight_smile: And good practice, now I am more careful and aware with Stripe!

I know this is old, but I looked at this recently while struggling with Tommi’s problem. I trust this is a recurring problem because of updates to Stripe’s API and the need to switch between test and live keys.

The solution is to wipe the keys from the database, ideally using Adminer (or, if you’re a pervert, phpMyAdmin). The table is “payment_settings”. The keys should just be cleared, then filled out again from the admin UI.

The private key is partly encrypted, so it’s better to avoid inputting it directly. Here are four fields to clear:
api_private_key: clear
api_publishable_key: wipe completely
api_verified: change to 0
api_visible_private_key: delete everything

I can confirm that clearing the data from these fields allowed successful reentry of Stripe details.

2 Likes

@jeremyevinced, I used a sequel pro to access the database but I am unable to make the changes you indicated.

Anyone with the knowledge on how to edits the parameters in a database management client like sequel pro?

Thank you in advance!