Skip to content

Commit

Permalink
Optionally override the Savon wsdl endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlaprade authored and iloveitaly committed Mar 4, 2021
1 parent 05bc883 commit 75bac9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/netsuite/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def attributes
def connection(params={}, credentials={})
client = Savon.client({
wsdl: cached_wsdl || wsdl,
endpoint: endpoint,
read_timeout: read_timeout,
open_timeout: open_timeout,
namespaces: namespaces,
Expand Down Expand Up @@ -94,6 +95,18 @@ def api_version=(version)
attributes[:api_version] = version
end

def endpoint=(endpoint)
attributes[:endpoint] = endpoint
end

def endpoint(endpoint=nil)
if endpoint
self.endpoint = endpoint
else
attributes[:endpoint]
end
end

def sandbox=(flag)
if attributes[:sandbox] != flag
attributes[:wsdl] = nil
Expand Down

0 comments on commit 75bac9d

Please sign in to comment.