quickbooks-ruby 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/quickbooks/service/access_token.rb +10 -19
- data/lib/quickbooks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 730a52a7a389c718c9395dadf184c2bf15b095ae6690e27554c2ff7e03446bf6
|
|
4
|
+
data.tar.gz: 4b536bbcb3949c2541714add495391e17099e67dde701485cadfcc1723c77612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78486c69d1de4ad4dcaa8d7baab2b02085be2fb33fd9d0c6f8d2ccdafba77f9f904d38812f0921315cc47c09c53a52093c1b0b89d4d0934d93a328eb12994564
|
|
7
|
+
data.tar.gz: f4922a3b8debbb50f48adc34e6174997d9e27042402a142beb3ab408526b25177edee086b034dcd12fa94b278e647ed5a1749679d1e22571df50eb421a59fc76
|
|
@@ -3,8 +3,7 @@ module Quickbooks
|
|
|
3
3
|
class AccessToken < BaseService
|
|
4
4
|
|
|
5
5
|
RENEW_URL = "https://appcenter.intuit.com/api/v1/connection/reconnect"
|
|
6
|
-
|
|
7
|
-
DISCONNECT_URL_OAUTH2 = "https://developer.api.intuit.com/v2/oauth2/tokens/revoke"
|
|
6
|
+
DISCONNECT_URL = "https://developer.api.intuit.com/v2/oauth2/tokens/revoke"
|
|
8
7
|
|
|
9
8
|
# https://developer.intuit.com/docs/0025_quickbooksapi/0053_auth_auth/oauth_management_api#Reconnect
|
|
10
9
|
def renew
|
|
@@ -22,26 +21,18 @@ module Quickbooks
|
|
|
22
21
|
|
|
23
22
|
# https://developer.intuit.com/docs/0025_quickbooksapi/0053_auth_auth/oauth_management_api#Disconnect
|
|
24
23
|
def disconnect
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Quickbooks::Model::AccessTokenResponse.from_xml(response.plain_body)
|
|
29
|
-
end
|
|
30
|
-
elsif oauth_v2?
|
|
31
|
-
conn = Faraday.new
|
|
32
|
-
conn.basic_auth oauth.client.id, oauth.client.secret
|
|
33
|
-
response = conn.post(DISCONNECT_URL_OAUTH2, token: oauth.refresh_token || oauth.token)
|
|
24
|
+
conn = Faraday.new
|
|
25
|
+
conn.basic_auth oauth.client.id, oauth.client.secret
|
|
26
|
+
response = conn.post(DISCONNECT_URL, token: oauth.refresh_token || oauth.token)
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
end
|
|
28
|
+
if response.success?
|
|
29
|
+
Quickbooks::Model::AccessTokenResponse.new(error_code: "0")
|
|
30
|
+
else
|
|
31
|
+
Quickbooks::Model::AccessTokenResponse.new(
|
|
32
|
+
error_code: response.status.to_s, error_message: response.reason_phrase
|
|
33
|
+
)
|
|
42
34
|
end
|
|
43
35
|
end
|
|
44
|
-
|
|
45
36
|
end
|
|
46
37
|
end
|
|
47
38
|
end
|
data/lib/quickbooks/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: quickbooks-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cody Caughlan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-01-
|
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oauth2
|