diff --git a/.gitignore b/.gitignore index 2c43bd7..a198dab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store /.bundle/ /.yardoc /Gemfile.lock diff --git a/lib/eversign/client.rb b/lib/eversign/client.rb index 9be3438..45a3c35 100644 --- a/lib/eversign/client.rb +++ b/lib/eversign/client.rb @@ -155,10 +155,12 @@ def send_reminder_for_document(document_hash, signer_id) private def append_sdk_id (body) - unless body.nil? + begin bodyHash = JSON.parse(body) bodyHash['client'] = 'ruby-sdk' return bodyHash.to_json + rescue + return body end end @@ -173,6 +175,7 @@ def execute_request(method, path, body = nil, multipart = false) body = append_sdk_id(body) + @faraday.send(method) do |request| request.url path request.body = body if body