Class: Veryfi::Api::Check
- Inherits:
-
Object
- Object
- Veryfi::Api::Check
- Includes:
- FilePayload, TagOperations
- Defined in:
- lib/veryfi/api/check.rb
Overview
Checks endpoints (/partner/checks/ and
/partner/check-with-document/ for combined check + remittance
extraction).
Constant Summary collapse
- ENDPOINT =
"/partner/checks/"- REMITTANCE_ENDPOINT =
"/partner/check-with-document/"- ASYNC_ENDPOINT =
"/partner/checks/async"
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#all(params = {}) ⇒ Veryfi::Resource
List previously processed checks.
-
#delete(id) ⇒ Veryfi::Resource
Delete a check.
-
#get(id, params = {}) ⇒ Veryfi::Resource
Fetch a single check by id.
-
#initialize(request) ⇒ Check
constructor
A new instance of Check.
-
#process(raw_params) ⇒ Veryfi::Resource
Upload a check image and extract its fields.
-
#process_async(raw_params) ⇒ Object
Async variant of #process — returns immediately while Veryfi processes the check in the background.
-
#process_url(raw_params) ⇒ Veryfi::Resource
URL variant of #process.
-
#process_url_async(raw_params) ⇒ Object
Async variant of #process_url.
-
#process_with_remittance(raw_params) ⇒ Veryfi::Resource
Process a check together with its remittance/stub document.
-
#process_with_remittance_url(raw_params) ⇒ Object
URL variant of #process_with_remittance.
-
#update(id, params) ⇒ Veryfi::Resource
Update writable fields on a processed check.
Methods included from TagOperations
#add_tag, #add_tags, #delete_tag, #delete_tags, #tags
Constructor Details
#initialize(request) ⇒ Check
Returns a new instance of Check.
20 21 22 |
# File 'lib/veryfi/api/check.rb', line 20 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
18 19 20 |
# File 'lib/veryfi/api/check.rb', line 18 def request @request end |
Instance Method Details
#all(params = {}) ⇒ Veryfi::Resource
List previously processed checks.
34 35 36 |
# File 'lib/veryfi/api/check.rb', line 34 def all(params = {}) request.get(ENDPOINT, params) end |
#delete(id) ⇒ Veryfi::Resource
Delete a check.
112 113 114 |
# File 'lib/veryfi/api/check.rb', line 112 def delete(id) request.delete("#{ENDPOINT}#{id}/") end |
#get(id, params = {}) ⇒ Veryfi::Resource
Fetch a single check by id.
43 44 45 |
# File 'lib/veryfi/api/check.rb', line 43 def get(id, params = {}) request.get("#{ENDPOINT}#{id}/", params) end |
#process(raw_params) ⇒ Veryfi::Resource
Upload a check image and extract its fields.
53 54 55 |
# File 'lib/veryfi/api/check.rb', line 53 def process(raw_params) request.post(ENDPOINT, build_file_payload(raw_params)) end |
#process_async(raw_params) ⇒ Object
Async variant of #process — returns immediately while Veryfi processes the check in the background.
87 88 89 |
# File 'lib/veryfi/api/check.rb', line 87 def process_async(raw_params) request.post(ASYNC_ENDPOINT, build_file_payload(raw_params)) end |
#process_url(raw_params) ⇒ Veryfi::Resource
URL variant of #process.
63 64 65 |
# File 'lib/veryfi/api/check.rb', line 63 def process_url(raw_params) request.post(ENDPOINT, raw_params.transform_keys(&:to_sym)) end |
#process_url_async(raw_params) ⇒ Object
Async variant of #process_url.
92 93 94 |
# File 'lib/veryfi/api/check.rb', line 92 def process_url_async(raw_params) request.post(ASYNC_ENDPOINT, raw_params.transform_keys(&:to_sym)) end |
#process_with_remittance(raw_params) ⇒ Veryfi::Resource
Process a check together with its remittance/stub document. Veryfi will OCR both halves and return a single combined response.
76 77 78 |
# File 'lib/veryfi/api/check.rb', line 76 def process_with_remittance(raw_params) request.post(REMITTANCE_ENDPOINT, build_file_payload(raw_params)) end |
#process_with_remittance_url(raw_params) ⇒ Object
URL variant of #process_with_remittance.
81 82 83 |
# File 'lib/veryfi/api/check.rb', line 81 def process_with_remittance_url(raw_params) request.post(REMITTANCE_ENDPOINT, raw_params.transform_keys(&:to_sym)) end |
#update(id, params) ⇒ Veryfi::Resource
Update writable fields on a processed check.
104 105 106 |
# File 'lib/veryfi/api/check.rb', line 104 def update(id, params) request.put("#{ENDPOINT}#{id}/", params) end |