intacct_ruby 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ca274310bbba02e3f4b67129889e3f4637f8e3b
4
- data.tar.gz: 7ded8a9810638848329bb04915d737f6f651a5bc
3
+ metadata.gz: 94288978f189f8f67b07129def8ad0d71f711b98
4
+ data.tar.gz: 22898d8bb78457506c557cd53834fb1c70186e1b
5
5
  SHA512:
6
- metadata.gz: 78356517fa12e7491017be5e2edc1fbadf997e412c3c10db258309ce4c607ad03b2cd70bb3e6795a300b88fc8b1ecc97f493b683ed21cee0d087d5c0921520a7
7
- data.tar.gz: 287d025755f77bdff9e7e624158cecec13598dfe24acac78e6b7da66dadd286bfd9ad55aa561069cd5cb0f9cd185f33dc14f6bf8e224ce47a2fee860456fe6f1
6
+ metadata.gz: c245c5bac43937e578dbe42d8638e54eb5befd9813abed0be88b1b65c02668ac6d89d33386c4b35b3006cb4483fceb244a2b9c433848d39b36b1b280a1b52bca
7
+ data.tar.gz: fd5b9fafbf8bb15f34d027682ad3b15c1788950f41c9250cf2f20348ed411fcfac440cbb84fab68b3cedaad33c65a8bec4bd1b3145eb29a14976b5fe12761748
@@ -0,0 +1,11 @@
1
+ ### Expected Behavior
2
+
3
+ [Please give a detailed explanation of what you expected to happen. Include relevant links to the supporting Intacct documentation and code snippets as appropriate.]
4
+
5
+ ### Actual Behavior
6
+
7
+ [Please give a detailed explanation of what actually happens. Include code snippets as appropriate.]
8
+
9
+ ### Steps to reproduce
10
+
11
+ [Please give a walkthrough of the steps that got you to the problem. Include a link to a public gist/repo, an inline code sample, or a failing test!]
@@ -0,0 +1,25 @@
1
+ ### Contributor Self-Check:
2
+
3
+ * [ ] My commits and messages [are solid](https://chris.beams.io/posts/git-commit/)
4
+ * [ ] I have included tests that check success and failure
5
+ * [ ] I have updated the README as appropriate
6
+
7
+ ### Which GitHub Issues does this PR address?
8
+
9
+ [Copy/paste or search for your issue number by typing #]
10
+
11
+ ### What does this PR do?
12
+
13
+ [Describe the problem and/or circumstances that lead to this PR. If this information is already laid out in the issue that you've linked, just copy/paste any necessary background info.]
14
+
15
+ ### How do I manually test this?
16
+
17
+ [Detail is key! It might even be nice to set up some sample data for your tester.]
18
+
19
+ ### Additional Comments
20
+
21
+ [This section is optional. Use it to give the maintainers a "heads ups!" about the code you've written.]
22
+
23
+ ### GIF for how this PR makes me feel
24
+
25
+ ![](GIF_URL)
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.9
4
+ - 2.3.6
5
+ - 2.4.3
6
+ - 2.5.0
7
+ script:
8
+ - bundle exec rspec
9
+
10
+ notifications:
11
+ slack: privateprep:xsf8aYrl93oAPZbWnfEJ7b7u
@@ -0,0 +1,11 @@
1
+ # 1.8.0 (March 8, 2018)
2
+
3
+ * Allow for varying cases in calls for calls other than :create and :update ([@bezoar17](https://github.com/bezoar17) in [#9](https://github.com/privateprep/intacct-ruby/pull/9) and [#13](https://github.com/privateprep/intacct-ruby/pull/13))
4
+ * Adds templates for Issues and PRs ([@danielpowell4](https://github.com/danielpowell4) in [#10](https://github.com/privateprep/intacct-ruby/pull/10))
5
+ * Bumps ruby version to 2 ([@danielpowell4](https://github.com/danielpowell4) in [#12](https://github.com/privateprep/intacct-ruby/pull/12))
6
+ * Connects dev pipeline to Travis CI ([@danielpowell4](https://github.com/danielpowell4) in [#12](https://github.com/privateprep/intacct-ruby/pull/12))
7
+
8
+ # Pre 1.8.0
9
+
10
+ This log was not maintained as the gem was private.
11
+ Huge thanks to [@jzornow](https://github.com/jzornow). Without him, this project would never have gotten off the ground!
data/README.md CHANGED
@@ -1,16 +1,19 @@
1
- [ ![Codeship Status for jzornow/intacct-ruby](https://app.codeship.com/projects/161bbcb0-037f-0135-febb-660dbc75d940/status?branch=master)](https://app.codeship.com/projects/213338)
1
+ [![Build Status](https://travis-ci.org/privateprep/intacct-ruby.svg?branch=master)](https://travis-ci.org/privateprep/intacct-ruby)
2
2
 
3
3
  # IntacctRuby
4
4
 
5
5
  A wrapper for [Intacct's API](https://developer.intacct.com/wiki/functions-object), which tries to stay as close as it can to the syntax and philosophy of the API itself.
6
6
 
7
7
  ## The Power of Multi-Function Api Calls
8
+
8
9
  Unlike the other Gems out in the Rubyverse, this library supports one of the Intacct API's most powerful features: multi-function API calls.
9
10
 
10
11
  ### Why Does This Matter?
12
+
11
13
  In an ERP system like Intacct, you'll probably want to perform multiple actions at once, like debiting one account and crediting another, or creating several associated records simulatenously. The more calls you make, the longer it will take to see a response. That's just a fact. But if you can bundle all of those actions together into a single call, you lower the load on both your system and Intacct's servers and guarantee yourself a quicker response. Intacct's entire API is built around this idea, and `IntacctRuby` translates that philosophy into Ruby.
12
14
 
13
- ### How Do It Do?
15
+ ### Putting Gem to Use
16
+
14
17
  Let's say you want to create a project and a customer associated with that project simultaneously. The Intacct API would tell you to create a call with a `<create><CUSTOMER>` function followed by a `<create><PROJECT>` function. So let's do it!
15
18
 
16
19
  ```ruby
@@ -18,27 +21,29 @@ Let's say you want to create a project and a customer associated with that proje
18
21
  # for more information.
19
22
  request = IntacctRuby::Request.new(REQUEST_OPTS)
20
23
 
21
- request.create :customer, {
22
- customerid: '1',
23
- first_name: 'Han',
24
- last_name: 'Solo',
25
- type: 'Person',
26
- email1: 'han@solo.com',
27
- status: 'active'
24
+ request.create :CUSTOMER, {
25
+ CUSTOMERID: '1',
26
+ FIRST_NAME: 'Han',
27
+ LAST_NAME: 'Solo',
28
+ TYPE: 'Person',
29
+ EMAIL1: 'han@solo.com',
30
+ STATUS: 'active'
28
31
  }
29
32
 
30
- request.create :project, {
31
- projectid: '1',
32
- name: 'Get Chewie a Haircut',
33
- projectcategory: 'Improve Wookie Hygene',
34
- customerid: '1',
35
- shampoo: 'true', # a custom field
36
- blowdry: 'false' # a custom field
33
+ request.create :PROJECT, {
34
+ PROJECTID: '1',
35
+ NAME: 'Get Chewie a Haircut',
36
+ PROJECTCATEGORY: 'Improve Wookie Hygene',
37
+ CUSTOMERID: '1',
38
+ SHAMPOO: 'true', # a custom field
39
+ BLOWDRY: 'false' # a custom field
37
40
  }
38
41
 
39
42
  request.send
40
43
  ```
41
44
 
45
+ **Note:** Here `:CUSTOMER` and `:PROJECT` are object-types which are tagged just after the function tag `create` and are case-sensitive along with the extra-parameters(CUSTOMERID, FIRST_NAME ..)
46
+
42
47
  This will fire off a request that looks something like this:
43
48
 
44
49
  ```xml
@@ -76,18 +81,94 @@ This will fire off a request that looks something like this:
76
81
  </operation>
77
82
  </request>
78
83
  ```
84
+
85
+ ### Read Requests
86
+
87
+ The read requests follow a slightly different pattern. The object-type is mentioned inside the object tag as seen here [Intacct List Vendors](https://developer.intacct.com/api/accounts-payable/vendors/#list-vendors). The following code will read all vendor objects.
88
+
89
+ ```ruby
90
+ request = IntacctRuby::Request.new(REQUEST_OPTS)
91
+
92
+ # Object-Type VENDOR is sent through extra-parameters and not as the first argument.
93
+ request.readByQuery nil, {
94
+ object: 'VENDOR',
95
+ query: '',
96
+ fields: '*',
97
+ pagesize: 100
98
+ }
99
+
100
+ request.send
101
+ ```
102
+
103
+ **Note:** Clean up the query argument before using it in readByQuery function as mentioned here [Intacct Illegal characters in XML](https://developer.intacct.com/web-services/queries/#illegal-characters-in-xml).
104
+ So, something like `query: "BATCH_DATE > '02/14/2018'"` should be `query: "BATCH_DATE &gt; '02/14/2018'"`
105
+
106
+ This will fire off a request that looks something like this:
107
+
108
+ ```xml
109
+ <?xml version="1.0" encoding="UTF-8"?>
110
+ <request>
111
+ <control><!-- Authentication Params --></control>
112
+ <operation transaction="true">
113
+ <authentication><!-- Authentication Params --></authentication>
114
+ <content>
115
+ <function controlid="readByQuery-2017-08-03 17:02:40 UTC">
116
+ <readByQuery>
117
+ <object>VENDOR</object>
118
+ <fields>*</fields>
119
+ <query></query>
120
+ <pagesize>100</pagesize>
121
+ </readByQuery>
122
+ </function>
123
+ </content>
124
+ </operation>
125
+ </request>
126
+ ```
127
+
128
+ Similarly, for pagination use the `readMore` function as mentioned here [Intacct Paginate Results](https://developer.intacct.com/web-services/queries/#paginate-results)
129
+
130
+ ```ruby
131
+ request = IntacctRuby::Request.new(REQUEST_OPTS)
132
+
133
+ request.readMore nil, {
134
+ resultId: '7765623332WU1hh8CoA4QAAHxI9i8AAAAA5'
135
+ }
136
+
137
+ request.send
138
+ ```
139
+
140
+ This will fire off a request that looks something like this:
141
+
142
+ ```xml
143
+ <?xml version="1.0" encoding="UTF-8"?>
144
+ <request>
145
+ <control><!-- Authentication Params --></control>
146
+ <operation transaction="true">
147
+ <authentication><!-- Authentication Params --></authentication>
148
+ <content>
149
+ <function controlid="readMore-2017-08-03 17:02:40 UTC">
150
+ <readMore>
151
+ <resultId>7765623332WU1hh8CoA4QAAHxI9i8AAAAA5</resultId>
152
+ </readMore>
153
+ </function>
154
+ </content>
155
+ </operation>
156
+ </request>
157
+ ```
158
+
79
159
  If there are function errors (e.g. you omitted a required field) you'll see an error on response. Same if you see an internal server error, or any error outside of the 2xx range.
80
160
 
81
161
  ## Authentication
162
+
82
163
  Before we go any further, make sure you've read the [Intacct API Quickstart Guide](https://developer.intacct.com/web-services/) and [their article on constructing XML Requests](https://developer.intacct.com/web-services/requests/)
83
164
 
84
165
  In IntacctRuby - as with the Intacct API that the gem wraps - your system credentials are pass along with each separate `Request` instance. The functions that define a request are followed by a hash that spells out each piece of information required by Intacct for authentication. These fields are:
85
166
 
86
- - `senderid`
87
- - `sender_password`\*
88
- - `userid`
89
- - `companyid`
90
- - `user_password`\*
167
+ * `senderid`
168
+ * `sender_password`\*
169
+ * `userid`
170
+ * `companyid`
171
+ * `user_password`\*
91
172
 
92
173
  \* _In [Intacct's documentation](https://developer.intacct.com/wiki/constructing-web-services-request), these are referred to only as `password`. This won't work in Rubyland, though, because we can't have multiple hash entries with the same key._
93
174
 
@@ -104,7 +185,9 @@ IntacctRuby::Request.new(
104
185
  user_password: 'some_user_password_value'
105
186
  )
106
187
  ```
188
+
107
189
  Though, it probably makes more sense to keep all of these in some handy constant for easy reuse:
190
+
108
191
  ```ruby
109
192
  REQUEST_OPTS = {
110
193
  senderid: 'some_senderid_value',
@@ -118,19 +201,23 @@ IntacctRuby::Request.new(REQUEST_OPTS)
118
201
  ```
119
202
 
120
203
  ### Important Notes on Authentication
204
+
121
205
  #### These Are Required!
206
+
122
207
  Obviously, Intacct won't do anything if you don't tell it who you are. To save you the bandwidth, **this gem will throw errors if any of these auth params are not provided.**
123
208
 
124
209
  #### BE SAFE!
210
+
125
211
  Though the examples above show hard-coded username/password pairs, this is a really bad idea to do in production code. Instead, we recommend storing these variables in ENVs, using a tool like [Figaro](https://github.com/laserlemon/figaro) to bring it all together.
126
212
 
127
213
  ## Customizing Calls
128
214
 
129
215
  This gem creates calls using the following defaults:
130
- - **uniqueid:** false,
131
- - **dtdversion:** 3.0,
132
- - **includewhitespace:** false,
133
- - **transaction:** true
216
+
217
+ * **uniqueid:** false,
218
+ * **dtdversion:** 3.0,
219
+ * **includewhitespace:** false,
220
+ * **transaction:** true
134
221
 
135
222
  If you'd like to override any of these, you can do so when you create a new request by adding additional fields to the options hash passed into `Request#new`:
136
223
 
@@ -150,9 +237,11 @@ REQUEST_OPTS.merge!(
150
237
 
151
238
  IntacctRuby::Request.new(REQUEST_OPTS)
152
239
  ```
240
+
153
241
  ## Installation
154
242
 
155
243
  ### The Gem Itself
244
+
156
245
  Add this line to your application's Gemfile:
157
246
 
158
247
  ```ruby
@@ -176,4 +265,3 @@ This project is intended to be a safe, welcoming space for collaboration, and co
176
265
  ## License
177
266
 
178
267
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
179
-
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = IntacctRuby::VERSION
10
10
  spec.authors = ['Jeremy Zornow']
11
11
  spec.email = ['jeremy@zornow.com']
12
- spec.required_ruby_version = '>= 1.9.3'
12
+ spec.required_ruby_version = '>= 2.2.0'
13
13
  spec.summary = 'A Ruby wrapper for the Intacct API'
14
14
  spec.description = 'Allows for multi-function API calls, the ' \
15
15
  'addition of custom fields, and more. All in ' \
@@ -26,11 +26,12 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ['lib']
27
27
 
28
28
  spec.add_development_dependency 'bundler', '~> 1.13'
29
- spec.add_development_dependency 'rake', '~> 10.0'
30
- spec.add_development_dependency 'rspec', '~> 3.0'
31
29
  spec.add_development_dependency 'nokogiri', '~> 1.6', '>= 1.6.8'
32
30
  spec.add_development_dependency 'mocha', '~> 0.13.3'
33
31
  spec.add_development_dependency 'pry-byebug', '~> 3.4', '>= 3.4.2'
32
+ spec.add_development_dependency 'rake', '~> 10.0'
33
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'travis', '~> 1.8', '>= 1.8.8'
34
35
 
35
36
  spec.add_runtime_dependency 'builder', '~> 3.0', '>= 3.0.4'
36
37
  end
@@ -9,6 +9,7 @@ module IntacctRuby
9
9
  readByQuery
10
10
  read
11
11
  readByName
12
+ readMore
12
13
  create
13
14
  update
14
15
  delete
@@ -27,7 +28,7 @@ module IntacctRuby
27
28
 
28
29
  xml.function controlid: controlid do
29
30
  xml.tag!(@function_type) do
30
- xml.tag!(@object_type.upcase) do
31
+ xml.tag!(@object_type) do
31
32
  xml << argument_xml(@arguments)
32
33
  end
33
34
  end
@@ -50,7 +51,7 @@ module IntacctRuby
50
51
  xml = Builder::XmlMarkup.new
51
52
 
52
53
  arguments_to_convert.each do |key, value|
53
- argument_key = key.to_s.upcase
54
+ argument_key = key.to_s
54
55
 
55
56
  xml.tag!(argument_key) do
56
57
  xml << argument_value_as_xml(value)
@@ -1,3 +1,3 @@
1
1
  module IntacctRuby
2
- VERSION = '1.7.0'.freeze
2
+ VERSION = '1.8.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intacct_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Zornow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-11 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,87 +25,107 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.13'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '1.6'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.6.8
34
37
  type: :development
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
- version: '10.0'
43
+ version: '1.6'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.6.8
41
47
  - !ruby/object:Gem::Dependency
42
- name: rspec
48
+ name: mocha
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '3.0'
53
+ version: 0.13.3
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '3.0'
60
+ version: 0.13.3
55
61
  - !ruby/object:Gem::Dependency
56
- name: nokogiri
62
+ name: pry-byebug
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '1.6'
67
+ version: '3.4'
62
68
  - - ">="
63
69
  - !ruby/object:Gem::Version
64
- version: 1.6.8
70
+ version: 3.4.2
65
71
  type: :development
66
72
  prerelease: false
67
73
  version_requirements: !ruby/object:Gem::Requirement
68
74
  requirements:
69
75
  - - "~>"
70
76
  - !ruby/object:Gem::Version
71
- version: '1.6'
77
+ version: '3.4'
72
78
  - - ">="
73
79
  - !ruby/object:Gem::Version
74
- version: 1.6.8
80
+ version: 3.4.2
75
81
  - !ruby/object:Gem::Dependency
76
- name: mocha
82
+ name: rake
77
83
  requirement: !ruby/object:Gem::Requirement
78
84
  requirements:
79
85
  - - "~>"
80
86
  - !ruby/object:Gem::Version
81
- version: 0.13.3
87
+ version: '10.0'
82
88
  type: :development
83
89
  prerelease: false
84
90
  version_requirements: !ruby/object:Gem::Requirement
85
91
  requirements:
86
92
  - - "~>"
87
93
  - !ruby/object:Gem::Version
88
- version: 0.13.3
94
+ version: '10.0'
89
95
  - !ruby/object:Gem::Dependency
90
- name: pry-byebug
96
+ name: rspec
91
97
  requirement: !ruby/object:Gem::Requirement
92
98
  requirements:
93
99
  - - "~>"
94
100
  - !ruby/object:Gem::Version
95
- version: '3.4'
101
+ version: '3.0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '3.0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: travis
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '1.8'
96
116
  - - ">="
97
117
  - !ruby/object:Gem::Version
98
- version: 3.4.2
118
+ version: 1.8.8
99
119
  type: :development
100
120
  prerelease: false
101
121
  version_requirements: !ruby/object:Gem::Requirement
102
122
  requirements:
103
123
  - - "~>"
104
124
  - !ruby/object:Gem::Version
105
- version: '3.4'
125
+ version: '1.8'
106
126
  - - ">="
107
127
  - !ruby/object:Gem::Version
108
- version: 3.4.2
128
+ version: 1.8.8
109
129
  - !ruby/object:Gem::Dependency
110
130
  name: builder
111
131
  requirement: !ruby/object:Gem::Requirement
@@ -134,9 +154,12 @@ executables: []
134
154
  extensions: []
135
155
  extra_rdoc_files: []
136
156
  files:
157
+ - ".github/ISSUE_TEMPLATE.md"
158
+ - ".github/PULL_REQUEST_TEMPLATE.md"
137
159
  - ".gitignore"
138
160
  - ".rspec"
139
- - ".ruby-version"
161
+ - ".travis.yml"
162
+ - CHANGELOG.md
140
163
  - CODE_OF_CONDUCT.md
141
164
  - Gemfile
142
165
  - LICENSE.txt
@@ -189,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
212
  requirements:
190
213
  - - ">="
191
214
  - !ruby/object:Gem::Version
192
- version: 1.9.3
215
+ version: 2.2.0
193
216
  required_rubygems_version: !ruby/object:Gem::Requirement
194
217
  requirements:
195
218
  - - ">="
@@ -197,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
220
  version: '0'
198
221
  requirements: []
199
222
  rubyforge_project:
200
- rubygems_version: 2.4.8
223
+ rubygems_version: 2.6.13
201
224
  signing_key:
202
225
  specification_version: 4
203
226
  summary: A Ruby wrapper for the Intacct API
@@ -1 +0,0 @@
1
- 2.2.6