veryfi 0.1.0 → 0.1.4

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.
data/docs/Gemfile.lock ADDED
@@ -0,0 +1,282 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (6.0.4.1)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 0.7, < 2)
7
+ minitest (~> 5.1)
8
+ tzinfo (~> 1.1)
9
+ zeitwerk (~> 2.2, >= 2.2.2)
10
+ addressable (2.8.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ coffee-script (2.4.1)
13
+ coffee-script-source
14
+ execjs
15
+ coffee-script-source (1.11.1)
16
+ colorator (1.1.0)
17
+ commonmarker (0.17.13)
18
+ ruby-enum (~> 0.5)
19
+ concurrent-ruby (1.1.9)
20
+ dnsruby (1.61.7)
21
+ simpleidn (~> 0.1)
22
+ em-websocket (0.5.2)
23
+ eventmachine (>= 0.12.9)
24
+ http_parser.rb (~> 0.6.0)
25
+ ethon (0.14.0)
26
+ ffi (>= 1.15.0)
27
+ eventmachine (1.2.7)
28
+ execjs (2.8.1)
29
+ faraday (1.7.1)
30
+ faraday-em_http (~> 1.0)
31
+ faraday-em_synchrony (~> 1.0)
32
+ faraday-excon (~> 1.1)
33
+ faraday-httpclient (~> 1.0.1)
34
+ faraday-net_http (~> 1.0)
35
+ faraday-net_http_persistent (~> 1.1)
36
+ faraday-patron (~> 1.0)
37
+ faraday-rack (~> 1.0)
38
+ multipart-post (>= 1.2, < 3)
39
+ ruby2_keywords (>= 0.0.4)
40
+ faraday-em_http (1.0.0)
41
+ faraday-em_synchrony (1.0.0)
42
+ faraday-excon (1.1.0)
43
+ faraday-httpclient (1.0.1)
44
+ faraday-net_http (1.0.1)
45
+ faraday-net_http_persistent (1.2.0)
46
+ faraday-patron (1.0.0)
47
+ faraday-rack (1.0.0)
48
+ ffi (1.15.3)
49
+ forwardable-extended (2.6.0)
50
+ gemoji (3.0.1)
51
+ github-pages (219)
52
+ github-pages-health-check (= 1.17.7)
53
+ jekyll (= 3.9.0)
54
+ jekyll-avatar (= 0.7.0)
55
+ jekyll-coffeescript (= 1.1.1)
56
+ jekyll-commonmark-ghpages (= 0.1.6)
57
+ jekyll-default-layout (= 0.1.4)
58
+ jekyll-feed (= 0.15.1)
59
+ jekyll-gist (= 1.5.0)
60
+ jekyll-github-metadata (= 2.13.0)
61
+ jekyll-mentions (= 1.6.0)
62
+ jekyll-optional-front-matter (= 0.3.2)
63
+ jekyll-paginate (= 1.1.0)
64
+ jekyll-readme-index (= 0.3.0)
65
+ jekyll-redirect-from (= 0.16.0)
66
+ jekyll-relative-links (= 0.6.1)
67
+ jekyll-remote-theme (= 0.4.3)
68
+ jekyll-sass-converter (= 1.5.2)
69
+ jekyll-seo-tag (= 2.7.1)
70
+ jekyll-sitemap (= 1.4.0)
71
+ jekyll-swiss (= 1.0.0)
72
+ jekyll-theme-architect (= 0.2.0)
73
+ jekyll-theme-cayman (= 0.2.0)
74
+ jekyll-theme-dinky (= 0.2.0)
75
+ jekyll-theme-hacker (= 0.2.0)
76
+ jekyll-theme-leap-day (= 0.2.0)
77
+ jekyll-theme-merlot (= 0.2.0)
78
+ jekyll-theme-midnight (= 0.2.0)
79
+ jekyll-theme-minimal (= 0.2.0)
80
+ jekyll-theme-modernist (= 0.2.0)
81
+ jekyll-theme-primer (= 0.6.0)
82
+ jekyll-theme-slate (= 0.2.0)
83
+ jekyll-theme-tactile (= 0.2.0)
84
+ jekyll-theme-time-machine (= 0.2.0)
85
+ jekyll-titles-from-headings (= 0.5.3)
86
+ jemoji (= 0.12.0)
87
+ kramdown (= 2.3.1)
88
+ kramdown-parser-gfm (= 1.1.0)
89
+ liquid (= 4.0.3)
90
+ mercenary (~> 0.3)
91
+ minima (= 2.5.1)
92
+ nokogiri (>= 1.10.4, < 2.0)
93
+ rouge (= 3.26.0)
94
+ terminal-table (~> 1.4)
95
+ github-pages-health-check (1.17.7)
96
+ addressable (~> 2.3)
97
+ dnsruby (~> 1.60)
98
+ octokit (~> 4.0)
99
+ public_suffix (>= 3.0, < 5.0)
100
+ typhoeus (~> 1.3)
101
+ html-pipeline (2.14.0)
102
+ activesupport (>= 2)
103
+ nokogiri (>= 1.4)
104
+ http_parser.rb (0.6.0)
105
+ i18n (0.9.5)
106
+ concurrent-ruby (~> 1.0)
107
+ jekyll (3.9.0)
108
+ addressable (~> 2.4)
109
+ colorator (~> 1.0)
110
+ em-websocket (~> 0.5)
111
+ i18n (~> 0.7)
112
+ jekyll-sass-converter (~> 1.0)
113
+ jekyll-watch (~> 2.0)
114
+ kramdown (>= 1.17, < 3)
115
+ liquid (~> 4.0)
116
+ mercenary (~> 0.3.3)
117
+ pathutil (~> 0.9)
118
+ rouge (>= 1.7, < 4)
119
+ safe_yaml (~> 1.0)
120
+ jekyll-avatar (0.7.0)
121
+ jekyll (>= 3.0, < 5.0)
122
+ jekyll-coffeescript (1.1.1)
123
+ coffee-script (~> 2.2)
124
+ coffee-script-source (~> 1.11.1)
125
+ jekyll-commonmark (1.3.1)
126
+ commonmarker (~> 0.14)
127
+ jekyll (>= 3.7, < 5.0)
128
+ jekyll-commonmark-ghpages (0.1.6)
129
+ commonmarker (~> 0.17.6)
130
+ jekyll-commonmark (~> 1.2)
131
+ rouge (>= 2.0, < 4.0)
132
+ jekyll-default-layout (0.1.4)
133
+ jekyll (~> 3.0)
134
+ jekyll-feed (0.15.1)
135
+ jekyll (>= 3.7, < 5.0)
136
+ jekyll-gist (1.5.0)
137
+ octokit (~> 4.2)
138
+ jekyll-github-metadata (2.13.0)
139
+ jekyll (>= 3.4, < 5.0)
140
+ octokit (~> 4.0, != 4.4.0)
141
+ jekyll-mentions (1.6.0)
142
+ html-pipeline (~> 2.3)
143
+ jekyll (>= 3.7, < 5.0)
144
+ jekyll-optional-front-matter (0.3.2)
145
+ jekyll (>= 3.0, < 5.0)
146
+ jekyll-paginate (1.1.0)
147
+ jekyll-readme-index (0.3.0)
148
+ jekyll (>= 3.0, < 5.0)
149
+ jekyll-redirect-from (0.16.0)
150
+ jekyll (>= 3.3, < 5.0)
151
+ jekyll-relative-links (0.6.1)
152
+ jekyll (>= 3.3, < 5.0)
153
+ jekyll-remote-theme (0.4.3)
154
+ addressable (~> 2.0)
155
+ jekyll (>= 3.5, < 5.0)
156
+ jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
157
+ rubyzip (>= 1.3.0, < 3.0)
158
+ jekyll-sass-converter (1.5.2)
159
+ sass (~> 3.4)
160
+ jekyll-seo-tag (2.7.1)
161
+ jekyll (>= 3.8, < 5.0)
162
+ jekyll-sitemap (1.4.0)
163
+ jekyll (>= 3.7, < 5.0)
164
+ jekyll-swiss (1.0.0)
165
+ jekyll-theme-architect (0.2.0)
166
+ jekyll (> 3.5, < 5.0)
167
+ jekyll-seo-tag (~> 2.0)
168
+ jekyll-theme-cayman (0.2.0)
169
+ jekyll (> 3.5, < 5.0)
170
+ jekyll-seo-tag (~> 2.0)
171
+ jekyll-theme-dinky (0.2.0)
172
+ jekyll (> 3.5, < 5.0)
173
+ jekyll-seo-tag (~> 2.0)
174
+ jekyll-theme-hacker (0.2.0)
175
+ jekyll (> 3.5, < 5.0)
176
+ jekyll-seo-tag (~> 2.0)
177
+ jekyll-theme-leap-day (0.2.0)
178
+ jekyll (> 3.5, < 5.0)
179
+ jekyll-seo-tag (~> 2.0)
180
+ jekyll-theme-merlot (0.2.0)
181
+ jekyll (> 3.5, < 5.0)
182
+ jekyll-seo-tag (~> 2.0)
183
+ jekyll-theme-midnight (0.2.0)
184
+ jekyll (> 3.5, < 5.0)
185
+ jekyll-seo-tag (~> 2.0)
186
+ jekyll-theme-minimal (0.2.0)
187
+ jekyll (> 3.5, < 5.0)
188
+ jekyll-seo-tag (~> 2.0)
189
+ jekyll-theme-modernist (0.2.0)
190
+ jekyll (> 3.5, < 5.0)
191
+ jekyll-seo-tag (~> 2.0)
192
+ jekyll-theme-primer (0.6.0)
193
+ jekyll (> 3.5, < 5.0)
194
+ jekyll-github-metadata (~> 2.9)
195
+ jekyll-seo-tag (~> 2.0)
196
+ jekyll-theme-slate (0.2.0)
197
+ jekyll (> 3.5, < 5.0)
198
+ jekyll-seo-tag (~> 2.0)
199
+ jekyll-theme-tactile (0.2.0)
200
+ jekyll (> 3.5, < 5.0)
201
+ jekyll-seo-tag (~> 2.0)
202
+ jekyll-theme-time-machine (0.2.0)
203
+ jekyll (> 3.5, < 5.0)
204
+ jekyll-seo-tag (~> 2.0)
205
+ jekyll-titles-from-headings (0.5.3)
206
+ jekyll (>= 3.3, < 5.0)
207
+ jekyll-watch (2.2.1)
208
+ listen (~> 3.0)
209
+ jemoji (0.12.0)
210
+ gemoji (~> 3.0)
211
+ html-pipeline (~> 2.2)
212
+ jekyll (>= 3.0, < 5.0)
213
+ kramdown (2.3.1)
214
+ rexml
215
+ kramdown-parser-gfm (1.1.0)
216
+ kramdown (~> 2.0)
217
+ liquid (4.0.3)
218
+ listen (3.7.0)
219
+ rb-fsevent (~> 0.10, >= 0.10.3)
220
+ rb-inotify (~> 0.9, >= 0.9.10)
221
+ mercenary (0.3.6)
222
+ minima (2.5.1)
223
+ jekyll (>= 3.5, < 5.0)
224
+ jekyll-feed (~> 0.9)
225
+ jekyll-seo-tag (~> 2.1)
226
+ minitest (5.14.4)
227
+ multipart-post (2.1.1)
228
+ nokogiri (1.12.4-x86_64-darwin)
229
+ racc (~> 1.4)
230
+ octokit (4.21.0)
231
+ faraday (>= 0.9)
232
+ sawyer (~> 0.8.0, >= 0.5.3)
233
+ pathutil (0.16.2)
234
+ forwardable-extended (~> 2.6)
235
+ public_suffix (4.0.6)
236
+ racc (1.5.2)
237
+ rb-fsevent (0.11.0)
238
+ rb-inotify (0.10.1)
239
+ ffi (~> 1.0)
240
+ rexml (3.2.5)
241
+ rouge (3.26.0)
242
+ ruby-enum (0.9.0)
243
+ i18n
244
+ ruby2_keywords (0.0.5)
245
+ rubyzip (2.3.2)
246
+ safe_yaml (1.0.5)
247
+ sass (3.7.4)
248
+ sass-listen (~> 4.0.0)
249
+ sass-listen (4.0.0)
250
+ rb-fsevent (~> 0.9, >= 0.9.4)
251
+ rb-inotify (~> 0.9, >= 0.9.7)
252
+ sawyer (0.8.2)
253
+ addressable (>= 2.3.5)
254
+ faraday (> 0.8, < 2.0)
255
+ simpleidn (0.2.1)
256
+ unf (~> 0.1.4)
257
+ terminal-table (1.8.0)
258
+ unicode-display_width (~> 1.1, >= 1.1.1)
259
+ thread_safe (0.3.6)
260
+ typhoeus (1.4.0)
261
+ ethon (>= 0.9.0)
262
+ tzinfo (1.2.9)
263
+ thread_safe (~> 0.1)
264
+ unf (0.1.4)
265
+ unf_ext
266
+ unf_ext (0.0.7.7)
267
+ unicode-display_width (1.7.0)
268
+ zeitwerk (2.4.2)
269
+
270
+ PLATFORMS
271
+ x86_64-darwin-19
272
+
273
+ DEPENDENCIES
274
+ github-pages (~> 219)
275
+ jekyll (= 3.9.0)
276
+ minima (~> 2.5)
277
+ tzinfo (~> 1.2)
278
+ tzinfo-data
279
+ wdm (~> 0.1.1)
280
+
281
+ BUNDLED WITH
282
+ 2.2.26
data/docs/_config.yml ADDED
@@ -0,0 +1,50 @@
1
+ # Welcome to Jekyll!
2
+ #
3
+ # This config file is meant for settings that affect your whole blog, values
4
+ # which you are expected to set up once and rarely edit after that. If you find
5
+ # yourself editing this file very often, consider using Jekyll's data files
6
+ # feature for the data you need to update frequently.
7
+ #
8
+ # For technical reasons, this file is *NOT* reloaded automatically when you use
9
+ # 'bundle exec jekyll serve'. If you change this file, please restart the server process.
10
+ #
11
+ # If you need help with YAML syntax, here are some quick references for you:
12
+ # https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
13
+ # https://learnxinyminutes.com/docs/yaml/
14
+ #
15
+ # Site settings
16
+ # These are used to personalize your new site. If you look in the HTML files,
17
+ # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
18
+ # You can create any custom variable you would like, and they will be accessible
19
+ # in the templates via {{ site.myvariable }}.
20
+
21
+ title: Veryfi Ruby SDK
22
+ email: support@veryfi.com
23
+ description: >- # this means to ignore newlines until "baseurl:"
24
+ Veryfi is a Ruby gem for communicating with the Veryfi OCR API
25
+ baseurl: "/veryfi-ruby" # the subpath of your site, e.g. /blog
26
+ url: "https://veryfi.github.io" # the base hostname & protocol for your site, e.g. http://example.com
27
+ github_username: veryfi
28
+ markdown: kramdown
29
+ # Build settings
30
+ theme: minima
31
+
32
+ # Exclude from processing.
33
+ # The following items will not be processed, by default.
34
+ # Any item listed under the `exclude:` key here will be automatically added to
35
+ # the internal "default list".
36
+ #
37
+ # Excluded items can be processed by explicitly listing the directories or
38
+ # their entries' file path in the `include:` list.
39
+ #
40
+ # exclude:
41
+ # - .sass-cache/
42
+ # - .jekyll-cache/
43
+ # - gemfiles/
44
+ # - Gemfile
45
+ # - Gemfile.lock
46
+ # - node_modules/
47
+ # - vendor/bundle/
48
+ # - vendor/cache/
49
+ # - vendor/gems/
50
+ # - vendor/ruby/
@@ -0,0 +1,35 @@
1
+ <footer class="site-footer h-card">
2
+ <data class="u-url" href="{{ "/" | relative_url }}"></data>
3
+
4
+ <div class="wrapper">
5
+
6
+ <div class="footer-col-wrapper">
7
+ <div class="footer-col footer-col-1">
8
+ <ul class="contact-list">
9
+ <li class="p-name">
10
+ {%- if site.author -%}
11
+ {{ site.author | escape }}
12
+ {%- else -%}
13
+ {{ site.title | escape }}
14
+ {%- endif -%}
15
+ </li>
16
+ {%- if site.email -%}
17
+ <li><a class="u-email" href="mailto:{{ site.email }}">{{ site.email }}</a></li>
18
+ {%- endif -%}
19
+ </ul>
20
+ </div>
21
+
22
+ <div class="footer-col footer-col-2">
23
+ {%- include social.html -%}
24
+ </div>
25
+
26
+ <div class="footer-col footer-col-3">
27
+ <p>
28
+ Veryfi is a Ruby gem for communicating with the <a href="https://veryfi.com/api/">Veryfi OCR API</a>
29
+ </p>
30
+ </div>
31
+ </div>
32
+
33
+ </div>
34
+
35
+ </footer>
@@ -0,0 +1,30 @@
1
+ <header class="site-header" role="banner">
2
+
3
+ <div class="wrapper">
4
+ {%- assign default_paths = site.pages | map: "path" -%}
5
+ {%- assign page_paths = site.header_pages | default: default_paths -%}
6
+ <a class="site-title" rel="author" href="{{ "https://github.com/slavakisel/veryfi-ruby" | relative_url }}">{{ site.title | escape }}</a>
7
+
8
+ {%- if page_paths -%}
9
+ <nav class="site-nav">
10
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
11
+ <label for="nav-trigger">
12
+ <span class="menu-icon">
13
+ <svg viewBox="0 0 18 15" width="18px" height="15px">
14
+ <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
15
+ </svg>
16
+ </span>
17
+ </label>
18
+
19
+ <div class="trigger">
20
+ {%- for path in page_paths -%}
21
+ {%- assign my_page = site.pages | where: "path", path | first -%}
22
+ {%- if my_page.title -%}
23
+ <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
24
+ {%- endif -%}
25
+ {%- endfor -%}
26
+ </div>
27
+ </nav>
28
+ {%- endif -%}
29
+ </div>
30
+ </header>
@@ -0,0 +1,273 @@
1
+ ---
2
+ # Feel free to add content and custom Front Matter to this file.
3
+ # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
4
+
5
+ layout: home
6
+ ---
7
+
8
+ - [Minimal example](#minimal-example)
9
+ - [Document API](#document-api)
10
+ - [Line Items API](#line-items-api)
11
+ - [Tags API](#tags-api)
12
+
13
+ ### Minimal example
14
+
15
+ Below is a sample script using <a href="https://www.veryfi.com" target="_blank">**Veryfi**</a> for OCR and extracting data from a document:
16
+
17
+ ```ruby
18
+ require 'veryfi'
19
+
20
+ veryfi_client = Veryfi::Client.new(
21
+ client_id: 'your_client_id',
22
+ client_secret: 'your_client_secret',
23
+ username: 'your_username',
24
+ api_key: 'your_password'
25
+ )
26
+ ```
27
+
28
+ This submits a document for processing (3-5 seconds for a response)
29
+
30
+ ```ruby
31
+ params = {
32
+ file_path: './test/receipt.jpg',
33
+ auto_delete: true,
34
+ boost_mode: false,
35
+ async: false,
36
+ external_id: '123456789',
37
+ max_pages_to_process: 10,
38
+ tags: ['tag1'],
39
+ categories: [
40
+ 'Advertising & Marketing',
41
+ 'Automotive'
42
+ ]
43
+ }
44
+
45
+ response = veryfi_client.document.process(params)
46
+
47
+ puts response
48
+ ```
49
+
50
+ ...or with a URL
51
+
52
+ ```ruby
53
+ params = {
54
+ file_url: "https://raw.githubusercontent.com/veryfi/veryfi-python/master/tests/assets/receipt_public.jpg",
55
+ auto_delete: true,
56
+ boost_mode: false,
57
+ async: false,
58
+ external_id: "123456789",
59
+ max_pages_to_process: 10,
60
+ tags: ["tag1"],
61
+ categories: [
62
+ "Advertising & Marketing",
63
+ "Automotive"
64
+ ]
65
+ }
66
+
67
+ response = veryfi_client.document.process_url(params)
68
+
69
+ puts response
70
+ ```
71
+
72
+ This will produce the following response:
73
+
74
+ ```json
75
+ {
76
+ "abn_number": "",
77
+ "account_number": "",
78
+ "bill_to_address": "2 Court Square\nNew York, NY 12210",
79
+ "bill_to_name": "John Smith",
80
+ "bill_to_vat_number": "",
81
+ "card_number": "",
82
+ "cashback": 0,
83
+ "category": "Repairs & Maintenance",
84
+ "created": "2021-06-28 19:20:02",
85
+ "currency_code": "USD",
86
+ "date": "2019-02-11 00:00:00",
87
+ "delivery_date": "",
88
+ "discount": 0,
89
+ "document_reference_number": "",
90
+ "document_title": "",
91
+ "document_type": "invoice",
92
+ "due_date": "2019-02-26",
93
+ "duplicate_of": 37055375,
94
+ "external_id": "",
95
+ "id": 37187909,
96
+ "img_file_name": "receipt.png",
97
+ "img_thumbnail_url": "https://scdn.veryfi.com/receipts/thumbnail.png",
98
+ "img_url": "https://scdn.veryfi.com/receipts/receipt.png",
99
+ "insurance": "",
100
+ "invoice_number": "US-001",
101
+ "is_duplicate": 1,
102
+ "line_items": [
103
+ {
104
+ "date": "",
105
+ "description": "Front and rear brake cables",
106
+ "discount": 0,
107
+ "id": 68004313,
108
+ "order": 0,
109
+ "price": 100,
110
+ "quantity": 1,
111
+ "reference": "",
112
+ "section": "",
113
+ "sku": "",
114
+ "tax": 0,
115
+ "tax_rate": 0,
116
+ "total": 100,
117
+ "type": "product",
118
+ "unit_of_measure": ""
119
+ },
120
+ {
121
+ "date": "",
122
+ "description": "New set of pedal arms",
123
+ "discount": 0,
124
+ "id": 68004315,
125
+ "order": 1,
126
+ "price": 15,
127
+ "quantity": 2,
128
+ "reference": "",
129
+ "section": "",
130
+ "sku": "",
131
+ "tax": 0,
132
+ "tax_rate": 0,
133
+ "total": 30,
134
+ "type": "product",
135
+ "unit_of_measure": ""
136
+ },
137
+ {
138
+ "date": "",
139
+ "description": "Labor 3hrs",
140
+ "discount": 0,
141
+ "id": 68004316,
142
+ "order": 2,
143
+ "price": 5,
144
+ "quantity": 3,
145
+ "reference": "",
146
+ "section": "",
147
+ "sku": "",
148
+ "tax": 0,
149
+ "tax_rate": 0,
150
+ "total": 15,
151
+ "type": "service",
152
+ "unit_of_measure": ""
153
+ }
154
+ ],
155
+ "notes": "",
156
+ "ocr_text": "\n\fEast Repair Inc.\n1912 Harvest Lane\nNew York, NY 12210\n\nBILL TO\t\tSHIP TO\tRECEIPT #\tUS-001\nJohn Smith\t\tJohn Smith\tRECEIPT DATE\t11/02/2019\n2 Court Square\t3787 Pineview Drive\n\tP.O.#\t2312/2019\nNew York, NY 12210\tCambridge, MA 12210\n\tDUE DATE\t26/02/2019\nReceipt Total\t\t\t$154.06\n\nQTY DESCRIPTION\t\t\tUNIT PRICE\tAMOUNT\n1\tFront and rear brake cables\t\t100.00\t100.00\n2\tNew set of pedal arms\t\t\t15.00\t30.00\n3\tLabor 3hrs\t\t\t\t5.00\t15.00\n\n\tSubtotal\t145.00\n\tSales Tax 6.25%\t9.06\n\nTERMS & CONDITIONS\nPayment is due within 15 days\nPlease make checks payable to: East Repair\n\tJohn Smith\n\tInc.\n",
157
+ "order_date": "",
158
+ "payment_display_name": "",
159
+ "payment_terms": "15 days",
160
+ "payment_type": "",
161
+ "phone_number": "",
162
+ "purchase_order_number": "2312/2019",
163
+ "rounding": 0,
164
+ "service_end_date": "",
165
+ "service_start_date": "",
166
+ "ship_date": "",
167
+ "ship_to_address": "3787 Pineview Drive\nCambridge, MA 12210",
168
+ "ship_to_name": "John Smith",
169
+ "shipping": 0,
170
+ "store_number": "",
171
+ "subtotal": 145,
172
+ "tax": 9.06,
173
+ "tax_lines": [
174
+ {
175
+ "base": 0,
176
+ "name": "Sales",
177
+ "order": 0,
178
+ "rate": 6.25,
179
+ "total": 9.06
180
+ }
181
+ ],
182
+ "tip": 0,
183
+ "total": 154.06,
184
+ "total_weight": "",
185
+ "tracking_number": "",
186
+ "updated": "2021-06-28 19:20:03",
187
+ "vat_number": "",
188
+ "vendor": {
189
+ "address": "1912 Harvest Lane\nNew York, NY 12210",
190
+ "category": "Car Repair",
191
+ "email": "",
192
+ "fax_number": "",
193
+ "name": "East Repair",
194
+ "phone_number": "",
195
+ "raw_name": "East Repair Inc.",
196
+ "vendor_logo": "https://cdn.veryfi.com/logos/tmp/560806841.png",
197
+ "vendor_reg_number": "",
198
+ "vendor_type": "Car Repair",
199
+ "web": ""
200
+ },
201
+ "vendor_account_number": "",
202
+ "vendor_bank_name": "",
203
+ "vendor_bank_number": "",
204
+ "vendor_bank_swift": "",
205
+ "vendor_iban": ""
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ### Document API
212
+
213
+ See [API schema](https://app.swaggerhub.com/apis/Veryfi/verify-api/) for request params and response details.
214
+
215
+ ```ruby
216
+ # Update document
217
+ veryfi_client.document.update(document_id, params)
218
+
219
+ # Delete document by ID
220
+ veryfi_client.document.delete(document_id)
221
+
222
+ # Get document by ID
223
+ veryfi_client.document.get(document_id)
224
+
225
+ # List all documents
226
+ veryfi_client.document.all
227
+ ```
228
+
229
+ ---
230
+
231
+ ### Line Items API
232
+
233
+ See [API schema](https://app.swaggerhub.com/apis/Veryfi/verify-api/) for request params and response details.
234
+
235
+ ```ruby
236
+ # Get document line items
237
+ veryfi_client.line_items.all(document_id)
238
+
239
+ # Get line item by document id and line item id
240
+ veryfi_client.line_items.get(document_id, id)
241
+
242
+ # Create/update/delete document line item
243
+ veryfi_client.line_items.create(document_id, params)
244
+ veryfi_client.line_items.update(document_id, params)
245
+ veryfi_client.line_items.delete(document_id, params)
246
+ ```
247
+
248
+ ---
249
+
250
+ ### Tags API
251
+
252
+ See [API schema](https://app.swaggerhub.com/apis/Veryfi/verify-api/) for request params and response details.
253
+
254
+ ```ruby
255
+ # Tags
256
+ # List all tags
257
+ veryfi_client.tag.all
258
+
259
+ # Delete a tag by ID
260
+ veryfi_client.tag.delete(id)
261
+
262
+ # List all document tags
263
+ veryfi_client.document_tag.all(document_id)
264
+
265
+ # Add tag to document
266
+ veryfi_client.document_tag.add(document_id, name: "tag_name")
267
+
268
+ # Delete tag by document id and tag id
269
+ veryfi_client.document_tag.delete(document_id, id)
270
+
271
+ # Delete all document tags
272
+ veryfi_client.document_tag.delete_all(document_id)
273
+ ```
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "Base64"
3
+ require "base64"
4
4
 
5
5
  module Veryfi
6
6
  module Api
@@ -39,7 +39,7 @@ module Veryfi
39
39
  params = setup_create_params(raw_params)
40
40
 
41
41
  file_content = File.read(params[:file_path])
42
- file_name = File.basename(params[:file_path], ".*")
42
+ file_name = File.basename(params[:file_path])
43
43
  file_data = Base64.encode64(file_content).gsub("\n", "")
44
44
 
45
45
  payload = params.reject { |k| k == :file_path }.merge(
@@ -88,11 +88,11 @@ module Veryfi
88
88
  )
89
89
  end
90
90
 
91
- def default_headers(has_files: false)
91
+ def default_headers
92
92
  {
93
- "User-Agent": "Ruby Veryfi-Ruby/0.1.0",
93
+ "User-Agent": "Ruby Veryfi-Ruby/#{Veryfi::VERSION}",
94
94
  "Accept": "application/json",
95
- "Content-Type": has_files ? "application/x-www-form-urlencoded" : "application/json",
95
+ "Content-Type": "application/json",
96
96
  "Client-Id": client_id,
97
97
  "Authorization": "apikey #{username}:#{api_key}"
98
98
  }