veritrans / veritrans-ruby

Ruby library for Veritrans payment gateway (Indonesia)
http://docs.veritrans.co.id/en/welcome/index.html
Apache License 2.0
44 stars 28 forks source link

Can you use Environment Variable for API_KEY and API_SECRET? #23

Closed glaksmono closed 8 years ago

glaksmono commented 8 years ago

https://github.com/veritrans/veritrans-ruby#edit-api-keys-in-configveritransyml

Not a good practice if we have to hardcode this on the .yml file

Can we do the following:

staging:
  client_key: <%= ENV['VERITRANS_CLIENT_KEY'] %>
  server_key: <%= ENV['VERITRANS_SERVER_KEY'] %>
  api_host: https://api.sandbox.veritrans.co.id

production:
  client_key: <%= ENV['VERITRANS_CLIENT_KEY'] %>
  server_key: <%= ENV['VERITRANS_SERVER_KEY'] %>
  api_host: https://api.veritrans.co.id

Or we need to hard-code it for now?

yocki-s commented 8 years ago

Hi @glaksmono

Yes you can do that. The point for us is, please make sure you are using right key and endpoint. ex: If you use sandbox endpoint, please make sure you are using sandbox key.

bprayudha commented 8 years ago

@yocki-s I believe this commit can fix this issue but it's not released yet on rubygems.org.

yocki-s commented 8 years ago

hi @bprayudha

Thanks for your information. i will check this

Paxa commented 8 years ago

Hi @glaksmono I just released new version 2.1.1 with that feature. Please try