qbo_api 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/example/base.rb +1 -0
- data/lib/qbo_api/api_methods.rb +8 -0
- data/lib/qbo_api/entity.rb +13 -0
- data/lib/qbo_api/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: a9e249e7e48339a74b585f7afd97711407c8b814c0670e417b4792b465e59515
|
4
|
+
data.tar.gz: ef17013bf8fd40513f0f4ddb7ffa9653baa2b686f7091a1ba82a8f0cfb79e9ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c31a1c1e627e8f1677323d74e959bb377338984c8cd73c49ebdb95253a97986e7634e20ced251a67e18321bda1827d67e759add75dece2bcb052b2411132bcba
|
7
|
+
data.tar.gz: b8c46643f89b9be3e285dd4d8e9bf030af7b75b3872e21937afc6d0c5bfbe59c23038e9bc4431f1efa762888f408d240dd0149c4035f9e19a35ee63c1dbf2847
|
data/README.md
CHANGED
@@ -372,8 +372,8 @@ for how to install ngrok and what it is.
|
|
372
372
|
Add the token to your .env as QBO_API_VERIFIER_TOKEN
|
373
373
|
|
374
374
|
- In another tab, create a customer via the API:
|
375
|
-
`bundle exec ruby -rqbo_api -rdotenv -e 'Dotenv.load; p QboApi.new(access_token: ENV.fetch("
|
376
|
-
(You'll also need to have added the QBO_API_COMPANY_ID and
|
375
|
+
`bundle exec ruby -rqbo_api -rdotenv -e 'Dotenv.load; p QboApi.new(access_token: ENV.fetch("QBO_API_ACCESS_TOKEN"), realm_id: ENV.fetch("QBO_API_COMPANY_ID")).create(:customer, payload: { DisplayName: "TestCustomer" })'`
|
376
|
+
(You'll also need to have added the QBO_API_COMPANY_ID and QBO_API_ACCESS_TOKEN to your .env)
|
377
377
|
|
378
378
|
There could be a delay of up to a minute before the webhook fires.
|
379
379
|
|
data/example/base.rb
CHANGED
data/lib/qbo_api/api_methods.rb
CHANGED
@@ -58,6 +58,14 @@ class QboApi
|
|
58
58
|
request(:post, entity: entity, path: entity_path(entity), payload: payload)
|
59
59
|
end
|
60
60
|
|
61
|
+
def void(entity, id:)
|
62
|
+
err_msg = "Void is only for voidable transaction entities. Use .delete or .deactivate instead"
|
63
|
+
raise QboApi::NotImplementedError.new, err_msg unless is_voidable_transaction_entity?(entity)
|
64
|
+
path = add_params_to_path(path: entity_path(entity), params: { operation: :void })
|
65
|
+
payload = set_update(entity, id)
|
66
|
+
request(:post, entity: entity, path: path, payload: payload)
|
67
|
+
end
|
68
|
+
|
61
69
|
private
|
62
70
|
|
63
71
|
def get_query_str(entity, query_filter_args)
|
data/lib/qbo_api/entity.rb
CHANGED
@@ -20,6 +20,19 @@ class QboApi
|
|
20
20
|
sym.to_s.split('_').collect(&:capitalize).join
|
21
21
|
end
|
22
22
|
|
23
|
+
def is_voidable_transaction_entity?(entity)
|
24
|
+
voidable_transaction_entities.include?(singular(entity))
|
25
|
+
end
|
26
|
+
|
27
|
+
def voidable_transaction_entities
|
28
|
+
%w{
|
29
|
+
BillPayment
|
30
|
+
Invoice
|
31
|
+
Payment
|
32
|
+
SalesReceipt
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
23
36
|
def is_transaction_entity?(entity)
|
24
37
|
transaction_entities.include?(singular(entity))
|
25
38
|
end
|
data/lib/qbo_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qbo_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Pelczarski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|