qbo_api 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ci.yaml +29 -0
- data/README.md +42 -19
- data/lib/qbo_api/error.rb +19 -5
- data/lib/qbo_api/version.rb +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5332ce0a487a0012e3cb020426155b5d8a1775497e32e3f43883c8da46417684
|
4
|
+
data.tar.gz: 4bc7672f4a4e5b3ef937cd1ba23940da15343da38401243b2665b8b9bf910455
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93b46a7ec5c979914e5e7046304bea8df3504e1c60e0168acf4ba8b3f756f7816b292ccc92fd57cce03629febfa6ac957124dfd2da3cc9854e8fa8e90c20d534
|
7
|
+
data.tar.gz: '04531594e0155c2cec1306e4c19ce53eb0f7b15f25e56ba860702ae773afcffa9942e0d26fdfc538b5ed831e4a1007e99b718437f9e15096bb95a9a597aeb6c1'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches: [ master ]
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
rspec:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
env:
|
12
|
+
RUBYOPT: "-W:deprecated" # show warnings, deprecations only
|
13
|
+
FARADAY_VERSION: ${{ matrix.faraday }}
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby: [ '2.7', '3.0', '3.1', '3.2' ]
|
18
|
+
faraday: [ '~> 1.0', '~> 2.0' ]
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v4
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Run RSpec
|
27
|
+
run: |
|
28
|
+
cp .env.test .env
|
29
|
+
bundle exec rspec spec/
|
data/README.md
CHANGED
@@ -81,7 +81,7 @@ QboApi.request_id = true
|
|
81
81
|
resp = qbo_api.create(:bill, payload: bill_hash, params: { requestid: qbo_api.uuid })
|
82
82
|
# Works with .get, .create, .update, .query methods
|
83
83
|
```
|
84
|
-
-
|
84
|
+
- By default, this client runs against the current "base" or major version of the QBO API. This client does not run against the latest QBO API [minor version](https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/minor-versions) by default. To run all requests with a specific minor version, you must specify it:
|
85
85
|
```ruby
|
86
86
|
QboApi.minor_version = 8
|
87
87
|
```
|
@@ -132,6 +132,12 @@ QboApi.minor_version = 8
|
|
132
132
|
p response['status'] # => "Deleted"
|
133
133
|
```
|
134
134
|
|
135
|
+
NOTE: If you are deleting a journal entry you have to use the following syntax with the underscore, even though this is inconsistent with how you create journal entries.
|
136
|
+
```ruby
|
137
|
+
response = qbo_api.delete(:journal_entry, id: 145)
|
138
|
+
p response['status'] # => "Deleted"
|
139
|
+
```
|
140
|
+
|
135
141
|
### Deactivate (only works for name list entities)
|
136
142
|
```ruby
|
137
143
|
response = qbo_api.deactivate(:employee, id: 55)
|
@@ -329,29 +335,46 @@ See [docs](https://developer.intuit.com/docs/0100_quickbooks_online/0100_essenti
|
|
329
335
|
p qbo_api.is_transaction_entity?(:customer) # => false
|
330
336
|
p qbo_api.is_name_list_entity?(:vendors) # => true
|
331
337
|
```
|
332
|
-
##
|
338
|
+
## Spin up an example
|
333
339
|
- <a href="http://minimul.com/access-the-quickbooks-online-api-with-oauth2.html" target="_blank">Check out this article on spinning up the example</a>.
|
334
|
-
|
335
|
-
-
|
340
|
+
|
341
|
+
- Create a Intuit developer account at [https://developer.intuit.com](https://developer.intuit.com)
|
342
|
+
- Create an app in the intuit developer backend
|
343
|
+
- Go to [myapps](https://developer.intuit.com/app/developer/myapps)
|
344
|
+
- Create an app with both the `Accounting` & `Payments` selected.
|
345
|
+
|
346
|
+
- Setup the app and gather credentials
|
347
|
+
- Go to the [Development Dashboard](https://developer.intuit.com/app/developer/dashboard)
|
348
|
+
- Click on your App name
|
349
|
+
- Click "Keys & credentials" under Development Settings in left menu
|
350
|
+
- Copy the 'Client ID' and the 'Client Secret'
|
351
|
+
- Add a Redirect URI: `http://localhost:9393/oauth2-redirect` (or whatever PORT= is in your .env)
|
352
|
+
- Create a new Sandbox Company by clicking on "View Sandbox companies"
|
353
|
+
Don't use it for anything else besides testing this app.
|
354
|
+
- Copy the 'Company ID' for use later
|
355
|
+
1. Within 'Sandbox Company_US_1' click on the COG -> Additional info
|
356
|
+
2. Copy the 'Company ID'
|
357
|
+
|
358
|
+
- Setup qbo_api
|
359
|
+
- `git clone git://github.com/minimul/qbo_api && cd qbo_api`
|
360
|
+
- `bundle`
|
361
|
+
|
336
362
|
- Create a `.env` file
|
337
363
|
- `cp .env.example_app.oauth2 .env`
|
338
|
-
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
-
|
346
|
-
Don't use it for anything else besides testing this app.
|
347
|
-
-. Copy the 'Company ID' to your .env as QBO_API_COMPANY_ID
|
348
|
-
- Start up the example app
|
364
|
+
- Edit your .env and enter the following
|
365
|
+
```
|
366
|
+
export QBO_API_CLIENT_ID=[YOUR CLIENT ID]
|
367
|
+
export QBO_API_CLIENT_SECRET=[YOUR CLIENT SECRET]
|
368
|
+
export QBO_API_COMPANY_ID=[YOUR COMPANY ID]
|
369
|
+
```
|
370
|
+
|
371
|
+
- Start up the example app and test
|
349
372
|
- `ruby example/oauth2.rb`
|
350
|
-
- Go to `http://localhost:9393/oauth2`
|
351
|
-
- Use the `Connect to QuickBooks` button to connect to your QuickBooks sandbox, which you receive when signing up at [https://developer.intuit.com](https://developer.intuit.com).
|
352
|
-
- After successfully connecting to your sandbox go to :
|
353
|
-
- `http://localhost:9393/oauth2/customer/5`
|
373
|
+
- Go to `http://localhost:9393/oauth2`
|
374
|
+
- Use the `Connect to QuickBooks` button to connect to your QuickBooks sandbox, which you receive when signing up at [https://developer.intuit.com](https://developer.intuit.com).
|
375
|
+
- After successfully connecting to your sandbox go to `http://localhost:9393/oauth2/customer/5`
|
354
376
|
- You should see "Dukes Basketball Camp" displayed
|
377
|
+
|
355
378
|
- Checkout [`example/oauth2.rb`](https://github.com/minimul/qbo_api/blob/master/example/oauth2.rb)
|
356
379
|
to see what is going on under the hood.
|
357
380
|
|
data/lib/qbo_api/error.rb
CHANGED
@@ -13,11 +13,25 @@ class QboApi
|
|
13
13
|
class Error < StandardError
|
14
14
|
attr_reader :fault
|
15
15
|
|
16
|
-
def initialize(errors =
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
def initialize(errors = {})
|
17
|
+
@fault = errors
|
18
|
+
super(errors[:error_body])
|
19
|
+
end
|
20
|
+
|
21
|
+
def fault_type
|
22
|
+
fault.dig(:error_body, 0, :fault_type)
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_code
|
26
|
+
fault.dig(:error_body, 0, :error_code)
|
27
|
+
end
|
28
|
+
|
29
|
+
def error_message
|
30
|
+
fault.dig(:error_body, 0, :error_message)
|
31
|
+
end
|
32
|
+
|
33
|
+
def error_detail
|
34
|
+
fault.dig(:error_body, 0, :error_detail)
|
21
35
|
end
|
22
36
|
end
|
23
37
|
|
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: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Pelczarski
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -164,7 +164,7 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
-
description:
|
167
|
+
description:
|
168
168
|
email:
|
169
169
|
- christian@minimul.com
|
170
170
|
executables: []
|
@@ -173,6 +173,8 @@ extra_rdoc_files: []
|
|
173
173
|
files:
|
174
174
|
- ".env.example_app.oauth2"
|
175
175
|
- ".env.test"
|
176
|
+
- ".github/dependabot.yml"
|
177
|
+
- ".github/workflows/ci.yaml"
|
176
178
|
- ".gitignore"
|
177
179
|
- ".travis.yml"
|
178
180
|
- Gemfile
|
@@ -204,7 +206,7 @@ homepage: https://github.com/minimul/qbo_api
|
|
204
206
|
licenses:
|
205
207
|
- MIT
|
206
208
|
metadata: {}
|
207
|
-
post_install_message:
|
209
|
+
post_install_message:
|
208
210
|
rdoc_options: []
|
209
211
|
require_paths:
|
210
212
|
- lib
|
@@ -219,8 +221,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
221
|
- !ruby/object:Gem::Version
|
220
222
|
version: '0'
|
221
223
|
requirements: []
|
222
|
-
rubygems_version: 3.
|
223
|
-
signing_key:
|
224
|
+
rubygems_version: 3.3.26
|
225
|
+
signing_key:
|
224
226
|
specification_version: 4
|
225
227
|
summary: Ruby JSON-only client for QuickBooks Online API v3. Built on top of the Faraday
|
226
228
|
gem.
|