Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Vesta URL config explicit and add optional logger config #4

Merged
merged 6 commits into from
Jan 19, 2017

Conversation

jacksonh
Copy link
Contributor

@jacksonh jacksonh commented Jan 19, 2017

Vesta recently changed their URL configs for the sandbox, so the JSON and JSONP URLs have different domains. Since there are now 4 possible URL combos, its easier to just allow explicitly setting the URLs instead of having the underlying system join paths.

A typical setup might look something like this now:

VSafe.configure do |config|
  config.sandbox_url = 'https://sanboxdomain.com/GatewayProxy/Service'
  config.sandbox_jsonp_url  = 'https://sandbox-otherdomain.com/GatewayProxyJSON/Service'
  config.production_url = ''https://production.com/GatewayProxyJSON/Service'
  config.production_jsonp_url = ''https://production.com/GatewayProxyJSON/Service'
  config.logger = Rails.logger
end

I setup all the URLs based on the previous defaults, so if Vesta hasn't changed your URLs this should just work for you.

This PR also adds the option to pass a logger down to HTTParty. Doing config.logger = Rails.logger will set the HTTParty logger when making requests and give nice request/response logging.

@ngan
Copy link
Contributor

ngan commented Jan 19, 2017

Hey @jacksonh this looks good, can you update the README as well?

@jacksonh
Copy link
Contributor Author

Thanks! Will do!

@jacksonh
Copy link
Contributor Author

@ngan alright, updated the docs. Let me know how that looks.

@ngan ngan merged commit 173ec67 into listia:master Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants