Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zoholib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gems
zoholib
Commits
98c0a948
Commit
98c0a948
authored
Aug 19, 2021
by
Chantal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make url env dependant
parent
deca87c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
adamo2_client.rb
lib/zoholib/adamo2_client.rb
+15
-4
version.rb
lib/zoholib/version.rb
+1
-1
No files found.
lib/zoholib/adamo2_client.rb
View file @
98c0a948
...
@@ -12,14 +12,24 @@ module Wedoops
...
@@ -12,14 +12,24 @@ module Wedoops
include
HTTParty
include
HTTParty
debug_output
$stdout
debug_output
$stdout
base_uri
'https://zoho-adaptor-uat.adamo.es/'
#
base_uri 'https://zoho-adaptor-uat.adamo.es/'
#base_uri 'https://zoho-adaptor-staging.adamo.es/'
#base_uri 'https://zoho-adaptor-staging.adamo.es/'
#
base_uri 'https://zoho-adaptor.adamo.es'
base_uri
'https://zoho-adaptor.adamo.es'
http_proxy
"prx.wedoops.io"
,
"443"
,
"adamo"
,
"fSJxGqibztyvGPb9"
http_proxy
"prx.wedoops.io"
,
"443"
,
"adamo"
,
"fSJxGqibztyvGPb9"
attr_reader
:subdomain
,
:uri
attr_reader
:subdomain
,
:uri
def
initialize
def
initialize
(
options
=
{})
if
options
.
has_key?
(
:environment
)
&&
options
[
:environment
]
==
"development"
self
.
class
.
base_uri
'https://zoho-adaptor-uat.adamo.es/'
@password
=
'7KqI8FWVVfPayhcvYo9wxoUHZf3U0HWxYIuouyLizyF2N'
elsif
options
.
has_key?
(
:environment
)
&&
options
[
:environment
]
==
"production"
self
.
class
.
base_uri
'https://zoho-adaptor.adamo.es'
@password
=
'7KqI8FWVVfPayhcvYo9wxoUHZf3U0HWxYIuouyLizyF2N'
else
self
.
class
.
base_uri
'https://zoho-adaptor-staging.adamo.es/'
@password
=
'ZnsVmfSZwxq7KH1FquCIG8P9UrKDixHRAhci4UuYpRdzZ'
end
@logger
=
::
Logger
.
new
(
STDOUT
)
@logger
=
::
Logger
.
new
(
STDOUT
)
set_key
set_key
end
end
...
@@ -31,6 +41,7 @@ module Wedoops
...
@@ -31,6 +41,7 @@ module Wedoops
def
search_by_id
(
id
)
def
search_by_id
(
id
)
resultado
=
self
.
class
.
get
(
"/v1/leads/
#{
id
}
"
,
headers
:{
'Content-Type'
=>
'application/json'
,
'x-apikey'
=>
"
#{
@key
}
"
})
resultado
=
self
.
class
.
get
(
"/v1/leads/
#{
id
}
"
,
headers
:{
'Content-Type'
=>
'application/json'
,
'x-apikey'
=>
"
#{
@key
}
"
})
pp
resultado
if
resultado
.
key?
(
"message"
)
if
resultado
.
key?
(
"message"
)
return
resultado
[
"message"
]
return
resultado
[
"message"
]
else
else
...
@@ -69,7 +80,7 @@ module Wedoops
...
@@ -69,7 +80,7 @@ module Wedoops
def
set_key
def
set_key
#@password = 'ZnsVmfSZwxq7KH1FquCIG8P9UrKDixHRAhci4UuYpRdzZ' ##Staging password
#@password = 'ZnsVmfSZwxq7KH1FquCIG8P9UrKDixHRAhci4UuYpRdzZ' ##Staging password
@password
=
'7KqI8FWVVfPayhcvYo9wxoUHZf3U0HWxYIuouyLizyF2N'
##Production (uat) password
#
@password = '7KqI8FWVVfPayhcvYo9wxoUHZf3U0HWxYIuouyLizyF2N' ##Production (uat) password
@salt
=
(
DateTime
.
now
.
strftime
(
"%s"
).
to_i
/
86400
).
to_s
@salt
=
(
DateTime
.
now
.
strftime
(
"%s"
).
to_i
/
86400
).
to_s
@key
=
Digest
::
SHA1
.
hexdigest
(
@password
+
@salt
)
@key
=
Digest
::
SHA1
.
hexdigest
(
@password
+
@salt
)
end
end
...
...
lib/zoholib/version.rb
View file @
98c0a948
# frozen_string_literal: true
# frozen_string_literal: true
module
Wedoops
module
Wedoops
module
Zoholib
module
Zoholib
VERSION
=
'0.
4.2
'
VERSION
=
'0.
5.0
'
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment