0

On localhost everything is ok but on heroku I'm getting some errors.

On Heroku :

enter image description here

and card input is missing:

enter image description here

And on localhost:

enter image description here

I believe is something with Api key but I don't understand what I did wrong:

config/initializers/stripe.rb :


Stripe.api_key = Rails.application.secrets.stripe_private_key
StripeEvent.signing_secret = Rails.application.secrets.stripe_webhook_secret

StripeEvent.configure do |config|
  config.subscribe "charge." do |event|
    Webhooks::Charge.new(event).call
  end
end

secrets.yml:

development:
stripe_private_key: 'sk_test_*********'
stripe_public_key: 'pk_test_**********'
stripe_webhook_secret: 'whsec_**********'

in production I'm using the same test keys because I didn't setup live keys

production:
stripe_private_key: 'sk_test_********'
stripe_public_key: 'pk_test_*********'
stripe_webhook_secret: 'whsec_*********'

if I'm pushing submit button on heroku : enter image description here

Thank you for your time.

Update:

enter image description here

I have multiple because I tried so manny things.

ovi_tsb
  • 17
  • 1
  • 8

1 Answers1

0

Your secrets.yml file is likely non-existant on your production server. It should be in your .gitignore, of course, but you need to make sure those secrets are available somehow on Heroku as well.

See this answer for some ideas on how to do that.

taintedzodiac
  • 2,658
  • 1
  • 18
  • 16