Ruby on Rails: Braintree::AuthenticationError -
hello there have problem braintree implementation! created sandbox account on braintree websites , added gem gemfile:
gem 'braintree', "~> 2.62.0"
create file /initializers/braintree.rb:
braintree::configuration.environment = :sandbox braintree::configuration.merchant_id = env['merchant_id'] braintree::configuration.public_key = env['public_key_b'] braintree::configuration.private_key = env['private_key_b']
(i use figaro gem handle constant: application.yml
merchant_id : "xxxxxxxxxxxxxxxx" public_key_b : "xxxxxxxxxxxxxxxxx" private_key_b : "xxxxxxxxxxxxxxxxxxxxxxxxxx"
)
added route following documentation in routes file:
scope '/api' scope '/v1' scope '/client_token' '/' => braintree::clienttoken.generate end ... end end
now if start server via command rails s following error:
=> booting puma => rails 4.2.5.1 application starting in development on http://localhost:3000 => run `rails server -h` more startup options => ctrl-c shutdown server i, [2016-06-28t11:59:59.271177 #16383] info -- : [braintree] [28/jun/2016 09:59:59 utc] post /merchants/xxxxxxxxxxx/client_token 401 exiting /users/xxxxxxx/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/braintree-2.62.0/lib/braintree/util.rb:51:in `raise_exception_for_status_code': braintree::authenticationerror (braintree::authenticationerror)
what can do?
Comments
Post a Comment