lipseys 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lipseys/soap_client.rb +2 -2
- data/lib/lipseys/user.rb +18 -6
- data/lib/lipseys/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d5a48bba48849118345bc5003c5e977e1a2134
|
4
|
+
data.tar.gz: 314670efa9e926b32119710c2ca09654ba54b789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca79581dd4a12db3b625302fe2fbb542f3069a96523fe5afcfac12d233a661c67f40c994aefeea38af317ef7b4dcf84be7796d497ef1afafafe6e3a4f35b54a
|
7
|
+
data.tar.gz: 94e383501b78bd0149bde36736555b9d31100f84a456759166328a0e3c8931ad32ef69248d93f536f023ed3fcaae869a9db7a8e60e89d3e47c9025b1b2eabe73
|
data/lib/lipseys/soap_client.rb
CHANGED
data/lib/lipseys/user.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
module Lipseys
|
2
|
-
class User <
|
2
|
+
class User < SoapClient
|
3
|
+
|
4
|
+
API_URL = 'https://www.lipseys.com/API/validate.asmx?WSDL'
|
3
5
|
|
4
6
|
def initialize(options = {})
|
5
7
|
requires!(options, :email, :password)
|
@@ -7,11 +9,21 @@ module Lipseys
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def authenticated?
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
validate[:success]
|
13
|
+
end
|
14
|
+
|
15
|
+
def validate
|
16
|
+
body = { Credentials: { EmailAddress: @options[:email], Password: @options[:password] } }
|
17
|
+
response = soap_client(API_URL).call(:validate_dealer, message: body)
|
18
|
+
|
19
|
+
result = response.body[:validate_dealer_response][:validate_dealer_result]
|
20
|
+
|
21
|
+
{
|
22
|
+
success: (result[:success] == 'Y'),
|
23
|
+
description: result[:return_desc],
|
24
|
+
}
|
25
|
+
rescue Savon::Error => e
|
26
|
+
{ success: false, description: e.to_s }
|
15
27
|
end
|
16
28
|
|
17
29
|
end
|
data/lib/lipseys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lipseys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|