How do you override endpoints
Closed this issue · 3 comments
rayjohnson commented
Zuora requires different end points for sandbox vs. production. How do you over ride the endpoint with our needing to use a whole different wsdl?
anfleene commented
You can override the wsdl endpoint based on RAILS_ENV in an initializer. Our wsdl is setup for the api sandbox so this is what our initializer looks like:
# config/initializers/acitve_zuroa.rb
ActiveZuora.configure(
:username => [ZUORA_USER],
:password => [ZUORA_PASS],
:wsdl => Rails.root.join('config', 'zuora.wsdl').to_s,
)
ActiveZuora::Base.connection.soap_client.wsdl.endpoint.host = "www.zuora.com" if Rails.env.production?
ActiveZuora.generate_classes
Does that answer your question?
jonnymacs commented
@anfleene I work with @rayjohnson - this is exactly what we were looking for - thank you.
anfleene commented
Mind making a PR to add that to our README? Sorry it wasn't documented.