qbo_api 1.7.0 → 1.7.1
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/.env.example_app.oauth1 +2 -0
 - data/.env.example_app.oauth2 +2 -0
 - data/.env.test +6 -0
 - data/.travis.yml +8 -1
 - data/README.md +16 -29
 - data/lib/qbo_api/version.rb +1 -1
 - metadata +5 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 368838159586d1ffaf77d1618d13838cecbccbab
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 6caa3bae70dabfc99de0260fdd6845c21658f392
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 515b977dbe1ddd7ac9ba90fa9715d594a58307114141013b48a7c4d6ae9f6fb9995434c597a9a3e73ffe6316b2c3e5701936b7db66b079ba59a02793663f9414
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 41af9ba95cd96304e225d8f3d4b892f84475c6f1bb78d57c6be79d3ad178df1a185aba1a52808e966aa7ec2f1683535db643d1d6ae520784cd426e9b0ab8b84b
         
     | 
    
        data/.env.test
    ADDED
    
    
    
        data/.travis.yml
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,8 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # QboApi
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Ruby client for the QuickBooks Online API version 3.
         
     | 
| 
       4 
     | 
    
         
            -
            - Built on top of the excellent Faraday gem. 
     | 
| 
       5 
     | 
    
         
            -
            - JSON only support. 
     | 
| 
      
 4 
     | 
    
         
            +
            - Built on top of the excellent Faraday gem.
         
     | 
| 
      
 5 
     | 
    
         
            +
            - JSON only support.
         
     | 
| 
       6 
6 
     | 
    
         
             
              - Please don't ask about XML support. [Intuit has stated](https://github.com/ruckus/quickbooks-ruby/issues/257#issuecomment-126834454) that JSON is the primary data format for the QuickBooks API (v3 and beyond). This gem will specialize in JSON only. The [`quickbooks-ruby`](https://github.com/ruckus/quickbooks-ruby) gem has fantastic support for those who favor XML.
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Features specs built directly against a QuickBooks Online Sandbox via the VCR gem.
         
     | 
| 
       8 
8 
     | 
    
         
             
            - Robust error handling.
         
     | 
| 
         @@ -10,9 +10,9 @@ Ruby client for the QuickBooks Online API version 3. 
     | 
|
| 
       10 
10 
     | 
    
         
             
            ## Tutorials and Screencasts
         
     | 
| 
       11 
11 
     | 
    
         
             
            - <a href="http://minimul.com/introducing-a-new-ruby-quickbooks-online-client.html" target="_blank">Why qbo_api is a better choice </a> than the <a href="https://github.com/ruckus/quickbooks-ruby" target="_blank">quickbooks-ruby</a> gem.
         
     | 
| 
       12 
12 
     | 
    
         
             
            - <a href="http://minimul.com/getting-started-with-the-modern-ruby-quickbooks-online-client-qbo_api-part-1.html" target="_blank">Part 1</a>: Learn how to spin up the <a href="https://github.com/minimul/qbo_api#spin-up-an-example">example app</a>.
         
     | 
| 
       13 
     | 
    
         
            -
            - <a href="http://minimul.com/the-modern-ruby-quickbooks-client-part-2.html" target="_blank">Part 2</a>: <a href="https://github.com/minimul/qbo_api#running-the-specs">Running the specs</a> to aid you in understanding a QuickBooks API transaction. 
     | 
| 
      
 13 
     | 
    
         
            +
            - <a href="http://minimul.com/the-modern-ruby-quickbooks-client-part-2.html" target="_blank">Part 2</a>: <a href="https://github.com/minimul/qbo_api#running-the-specs">Running the specs</a> to aid you in understanding a QuickBooks API transaction.
         
     | 
| 
       14 
14 
     | 
    
         
             
            - <a href="http://minimul.com/the-modern-ruby-quickbooks-client-contributing.html" target="_blank">Part 3</a>: <a href="https://github.com/minimul/qbo_api#creating-new-specs-or-modifying-existing-spec-that-have-been-recorded-using-the-vcr-gem">Contributing to the gem</a>.
         
     | 
| 
       15 
     | 
    
         
            -
            ### Important Note: The videos are out of date. 
     | 
| 
      
 15 
     | 
    
         
            +
            ### Important Note: The videos are out of date.
         
     | 
| 
       16 
16 
     | 
    
         
             
            If you signed up for a Intuit developer account after July 17th, 2017 then you will have to
         
     | 
| 
       17 
17 
     | 
    
         
             
            follow <a href='#OAuth2-example'>OAuth2: Spin up an example</a>
         
     | 
| 
       18 
18 
     | 
    
         
             
            ## The Book
         
     | 
| 
         @@ -79,7 +79,7 @@ Or install it yourself as: 
     | 
|
| 
       79 
79 
     | 
    
         
             
            Intuit will be [requiring](https://developer.intuit.com/hub/blog/2017/08/03/upgrading-your-apps-to-support-tls-1-2) API client connections to be negotiated over TLS1.2 by December 31st, 2017. Using the default HTTP client (Net::HTTP) with Faraday this is the case with QboApi, however, if you are using another HTTP client you may need to directly set the TLS version negotiation manually.
         
     | 
| 
       80 
80 
     | 
    
         | 
| 
       81 
81 
     | 
    
         
             
            ### DateTime serialization
         
     | 
| 
       82 
     | 
    
         
            -
            Some QBO entities have attributes of type DateTime (e.g., Time Activities with StartTime and EndTime). All DateTimes passed to the QBO API must be serialized in ISO 8601 format. 
     | 
| 
      
 82 
     | 
    
         
            +
            Some QBO entities have attributes of type DateTime (e.g., Time Activities with StartTime and EndTime). All DateTimes passed to the QBO API must be serialized in ISO 8601 format.
         
     | 
| 
       83 
83 
     | 
    
         
             
            If ActiveSupport is loaded, you can achieve proper serialization with the following configuration:
         
     | 
| 
       84 
84 
     | 
    
         
             
            ```ruby
         
     | 
| 
       85 
85 
     | 
    
         
             
            ActiveSupport::JSON::Encoding.use_standard_json_time_format = true
         
     | 
| 
         @@ -145,7 +145,7 @@ QboApi.minor_version = 8 
     | 
|
| 
       145 
145 
     | 
    
         | 
| 
       146 
146 
     | 
    
         
             
            ### Update
         
     | 
| 
       147 
147 
     | 
    
         
             
            ```ruby
         
     | 
| 
       148 
     | 
    
         
            -
              customer = { 
     | 
| 
      
 148 
     | 
    
         
            +
              customer = {
         
     | 
| 
       149 
149 
     | 
    
         
             
                DisplayName: 'Jack Doe',
         
     | 
| 
       150 
150 
     | 
    
         
             
                PrimaryPhone: {
         
     | 
| 
       151 
151 
     | 
    
         
             
                  FreeFormNumber: "(415) 444-1234"
         
     | 
| 
         @@ -205,9 +205,9 @@ QboApi.minor_version = 8 
     | 
|
| 
       205 
205 
     | 
    
         
             
            ```ruby
         
     | 
| 
       206 
206 
     | 
    
         
             
              payload = {"AttachableRef":
         
     | 
| 
       207 
207 
     | 
    
         
             
                          [
         
     | 
| 
       208 
     | 
    
         
            -
                            {"EntityRef": 
     | 
| 
      
 208 
     | 
    
         
            +
                            {"EntityRef":
         
     | 
| 
       209 
209 
     | 
    
         
             
                              {
         
     | 
| 
       210 
     | 
    
         
            -
                                "type": "Invoice", 
     | 
| 
      
 210 
     | 
    
         
            +
                                "type": "Invoice",
         
     | 
| 
       211 
211 
     | 
    
         
             
                                "value": "111"
         
     | 
| 
       212 
212 
     | 
    
         
             
                              }
         
     | 
| 
       213 
213 
     | 
    
         
             
                            }
         
     | 
| 
         @@ -237,7 +237,7 @@ Be aware that any errors will not raise a `QboApi::Error`, but will be returned 
     | 
|
| 
       237 
237 
     | 
    
         
             
            ### Change data capture (CDC) query
         
     | 
| 
       238 
238 
     | 
    
         
             
            ```ruby
         
     | 
| 
       239 
239 
     | 
    
         
             
              response = qbo_api.cdc(entities: 'estimate', changed_since: '2011-10-10T09:00:00-07:00')
         
     | 
| 
       240 
     | 
    
         
            -
              # You can also send in a Time object e.g. changed_since: Time.now 
     | 
| 
      
 240 
     | 
    
         
            +
              # You can also send in a Time object e.g. changed_since: Time.now
         
     | 
| 
       241 
241 
     | 
    
         
             
              expect(response['CDCResponse'].size).to eq 1
         
     | 
| 
       242 
242 
     | 
    
         
             
              ids = response['CDCResponse'][0]['QueryResponse'][0]['Estimate'].collect{ |e| e['Id'] }
         
     | 
| 
       243 
243 
     | 
    
         
             
              p ids
         
     | 
| 
         @@ -299,7 +299,7 @@ See [docs](https://developer.intuit.com/docs/0100_quickbooks_online/0100_essenti 
     | 
|
| 
       299 
299 
     | 
    
         | 
| 
       300 
300 
     | 
    
         
             
            ### Respond to an error
         
     | 
| 
       301 
301 
     | 
    
         
             
            ```ruby
         
     | 
| 
       302 
     | 
    
         
            -
              customer = { DisplayName: 'Weiskopf Consulting' } 
     | 
| 
      
 302 
     | 
    
         
            +
              customer = { DisplayName: 'Weiskopf Consulting' }
         
     | 
| 
       303 
303 
     | 
    
         
             
              begin
         
     | 
| 
       304 
304 
     | 
    
         
             
                response = qbo_api.create(:customer, payload: customer)
         
     | 
| 
       305 
305 
     | 
    
         
             
              rescue QboApi::BadRequest => e
         
     | 
| 
         @@ -327,7 +327,7 @@ See [docs](https://developer.intuit.com/docs/0100_quickbooks_online/0100_essenti 
     | 
|
| 
       327 
327 
     | 
    
         
             
              qbo_api.all(:vendor, max: 5).each do |v|
         
     | 
| 
       328 
328 
     | 
    
         
             
                p v['DisplayName']
         
     | 
| 
       329 
329 
     | 
    
         
             
              end
         
     | 
| 
       330 
     | 
    
         
            -
             
     | 
| 
      
 330 
     | 
    
         
            +
             
     | 
| 
       331 
331 
     | 
    
         
             
              # retrieves all customers by groups of 2 using a custom select query
         
     | 
| 
       332 
332 
     | 
    
         
             
              where = "WHERE Id IN ('5', '6', '7', '8', '9', '10')"
         
     | 
| 
       333 
333 
     | 
    
         
             
              qbo_api.all(:customer, max: 2, select: "SELECT * FROM Customer #{where}").each do |c|
         
     | 
| 
         @@ -349,14 +349,11 @@ See [docs](https://developer.intuit.com/docs/0100_quickbooks_online/0100_essenti 
     | 
|
| 
       349 
349 
     | 
    
         
             
            - `git clone git://github.com/minimul/qbo_api && cd qbo_api`
         
     | 
| 
       350 
350 
     | 
    
         
             
            - `bundle`
         
     | 
| 
       351 
351 
     | 
    
         
             
            - Create a `.env` file
         
     | 
| 
      
 352 
     | 
    
         
            +
              - `cp .env.example_app.oauth2 .env`
         
     | 
| 
       352 
353 
     | 
    
         
             
              - If needed create an account at [https://developer.intuit.com](https://developer.intuit.com)
         
     | 
| 
       353 
354 
     | 
    
         
             
              - Click `Get started coding`
         
     | 
| 
       354 
355 
     | 
    
         
             
              - Create an app with both the `Accounting` & `Payments` selected.
         
     | 
| 
       355 
356 
     | 
    
         
             
              - Go to the `Development` tab and copy and paste the client id and client secret into the `.env` file.
         
     | 
| 
       356 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       357 
     | 
    
         
            -
            export QBO_API_CLIENT_ID=<Your QuickBooks Apps Client ID>
         
     | 
| 
       358 
     | 
    
         
            -
            export QBO_API_CLIENT_SECRET=<Your QuickBooks Apps Client Secret>
         
     | 
| 
       359 
     | 
    
         
            -
            ```
         
     | 
| 
       360 
357 
     | 
    
         
             
            - Note: the `.env` file will be automatically loaded after you run the next step.
         
     | 
| 
       361 
358 
     | 
    
         
             
            - Start up the example app
         
     | 
| 
       362 
359 
     | 
    
         
             
              - `ruby example/app.rb`
         
     | 
| 
         @@ -373,14 +370,11 @@ export QBO_API_CLIENT_SECRET=<Your QuickBooks Apps Client Secret> 
     | 
|
| 
       373 
370 
     | 
    
         
             
            - `git clone git://github.com/minimul/qbo_api && cd qbo_api`
         
     | 
| 
       374 
371 
     | 
    
         
             
            - `bundle`
         
     | 
| 
       375 
372 
     | 
    
         
             
            - Create a `.env` file
         
     | 
| 
      
 373 
     | 
    
         
            +
              - `cp .env.example_app.oauth1 .env`
         
     | 
| 
       376 
374 
     | 
    
         
             
              - If needed create an account at [https://developer.intuit.com](https://developer.intuit.com)
         
     | 
| 
       377 
375 
     | 
    
         
             
              - Click `Get started coding`
         
     | 
| 
       378 
376 
     | 
    
         
             
              - Create an app with both the `Accounting` & `Payments` selected.
         
     | 
| 
       379 
377 
     | 
    
         
             
              - Go to the `Development` tab and copy and paste the consumer key and secret into the `.env` file.
         
     | 
| 
       380 
     | 
    
         
            -
            ```ruby
         
     | 
| 
       381 
     | 
    
         
            -
            export QBO_API_CONSUMER_KEY=<Your QuickBooks apps consumer key>
         
     | 
| 
       382 
     | 
    
         
            -
            export QBO_API_CONSUMER_SECRET=<Your QuickBooks apps consumer secret>
         
     | 
| 
       383 
     | 
    
         
            -
            ```
         
     | 
| 
       384 
378 
     | 
    
         
             
            - Note: the `.env` file will be automatically loaded after you run the next step.
         
     | 
| 
       385 
379 
     | 
    
         
             
            - Start up the example app
         
     | 
| 
       386 
380 
     | 
    
         
             
              - `ruby example/app.rb`
         
     | 
| 
         @@ -403,17 +397,10 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/minimu 
     | 
|
| 
       403 
397 
     | 
    
         
             
            - `git clone git://github.com/minimul/qbo_api && cd qbo_api`
         
     | 
| 
       404 
398 
     | 
    
         
             
            - `bundle`
         
     | 
| 
       405 
399 
     | 
    
         
             
            - Create a `.env` file
         
     | 
| 
       406 
     | 
    
         
            -
              -  
     | 
| 
       407 
     | 
    
         
            -
             
     | 
| 
       408 
     | 
    
         
            -
            export QBO_API_CONSUMER_KEY=
         
     | 
| 
       409 
     | 
    
         
            -
            export QBO_API_CONSUMER_SECRET=
         
     | 
| 
       410 
     | 
    
         
            -
            export QBO_API_ACCESS_TOKEN=
         
     | 
| 
       411 
     | 
    
         
            -
            export QBO_API_ACCESS_TOKEN_SECRET=
         
     | 
| 
       412 
     | 
    
         
            -
            export QBO_API_OAUTH2_ACCESS_TOKEN=
         
     | 
| 
       413 
     | 
    
         
            -
            export QBO_API_COMPANY_ID=12345
         
     | 
| 
       414 
     | 
    
         
            -
            ```
         
     | 
| 
      
 400 
     | 
    
         
            +
              - `cp .env.test .env`
         
     | 
| 
      
 401 
     | 
    
         
            +
              - Update it if your are making HTTP requests.
         
     | 
| 
       415 
402 
     | 
    
         
             
            - `bundle exec rspec spec/`
         
     | 
| 
       416 
     | 
    
         
            -
             
     | 
| 
      
 403 
     | 
    
         
            +
             
     | 
| 
       417 
404 
     | 
    
         
             
            #### Creating new specs or modifying existing spec that have been recorded using the VCR gem.
         
     | 
| 
       418 
405 
     | 
    
         
             
            - All specs that require interaction with the API must be recorded against your personal QuickBooks sandbox. More coming on how to create or modifying existing specs against your sandbox.
         
     | 
| 
       419 
406 
     | 
    
         
             
            - <a href="http://minimul.com/the-modern-ruby-quickbooks-client-contributing.html" target="_blank">Check out this tutorial and screencast on contributing to qbo_api</a>.
         
     | 
    
        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: 1.7. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.7.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: 2018- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-03-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -255,6 +255,9 @@ executables: [] 
     | 
|
| 
       255 
255 
     | 
    
         
             
            extensions: []
         
     | 
| 
       256 
256 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       257 
257 
     | 
    
         
             
            files:
         
     | 
| 
      
 258 
     | 
    
         
            +
            - ".env.example_app.oauth1"
         
     | 
| 
      
 259 
     | 
    
         
            +
            - ".env.example_app.oauth2"
         
     | 
| 
      
 260 
     | 
    
         
            +
            - ".env.test"
         
     | 
| 
       258 
261 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       259 
262 
     | 
    
         
             
            - ".travis.yml"
         
     | 
| 
       260 
263 
     | 
    
         
             
            - Gemfile
         
     |