Commit 37e23dc9 authored by Jose Ernesto Suarez's avatar Jose Ernesto Suarez

Merge branch 'feat/add-sanbox-urls' into 'master'

Select url based on env

See merge request !6
parents 8c612005 9626a506
......@@ -17,6 +17,11 @@ module Wedoops
}
def initialize(options={})
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_url "https://sandbox.zohoapis.com/oauth/v2/"
end
#build_url(options)
@logger = ::Logger.new(STDOUT)
@options = Hash.new
......
......@@ -6,6 +6,11 @@ module Wedoops
#base_uri "https://accounts.zoho.com/oauth/v2/token"
#headers: {"Authorization" => "Token token=\"111\""}
def initialize(options={})
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_url "https://sandbox.zohoapis.com/oauth/v2/"
end
@logger = ::Logger.new(STDOUT)
@logged_in = false
@options = options
......
......@@ -13,6 +13,11 @@ module Wedoops
# }
def initialize(options={})
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_url "https://sandbox.zohoapis.com/oauth/v2/"
end
options.merge!(grant_type: "refresh_token")
@options={:query => options}
end
......
......@@ -14,6 +14,11 @@ module Wedoops
base_uri 'https://www.zohoapis.com/crm/v2/'
def initialize(options={})
# environment specific settings
if options.has_key?(:environment) && options[:environment] == "sandbox"
self.class.base_url "https://sandbox.zohoapis.com/crm/v2/"
end
#Es un cliennte basico que trabaja a partir de refresh_tokens
@logger = ::Logger.new(STDOUT)
@logged_in = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment