Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Changelog

## v0.2.1 April ?? 2017
## v0.2.1 May ?? 2017

### Features:
* Add certificate option to DocusignRest::Client#get_combined_document_from_envelope (Shane Stanford)
* Memoize base_url after successful login attempt. This prevents problems in production when Docusign returns a different subdomain on login as discussed in [here](https://github.com/jondkinney/docusign_rest/pull/102) (Tom Copeland)

### Misc:
* Replace monkeypatch with argument usage (Jean-Philippe Moal)
Expand Down
10 changes: 8 additions & 2 deletions lib/docusign_rest/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DocusignRest
class Client
# Define the same set of accessors as the DocusignRest module
attr_accessor *Configuration::VALID_CONFIG_KEYS
attr_accessor :docusign_authentication_headers, :acct_id
attr_accessor :docusign_authentication_headers, :acct_id, :base_url

def initialize(options={})
# Merge the config values from the module and those passed to the client.
Expand Down Expand Up @@ -80,7 +80,12 @@ def headers(user_defined_headers={})
#
# Returns a parsed URI object
def build_uri(url)
URI.parse("#{endpoint}/#{api_version}#{url}")
uri_string = if base_url
"#{base_url}#{url}"
else
"#{endpoint}/#{api_version}#{url}"
end
URI.parse(uri_string)
end


Expand Down Expand Up @@ -190,6 +195,7 @@ def get_account_id
hashed_response = JSON.parse(response)
login_accounts = hashed_response['loginAccounts']
@acct_id ||= login_accounts.first['accountId']
@base_url = login_accounts.first['baseUrl']
end

acct_id
Expand Down