Class: Veryfi::Api::BankStatementSplit
- Inherits:
-
Object
- Object
- Veryfi::Api::BankStatementSplit
- Includes:
- FilePayload
- Defined in:
- lib/veryfi/api/bank_statement_split.rb
Overview
Bank-statement splitting endpoints (/partner/bank-statements-set/).
Use these when you have a single file containing multiple bank statements (e.g. an annual archive PDF). Veryfi will split the file and process each statement separately; you receive a collection that references the individual BankStatement ids it produced.
Constant Summary collapse
- ENDPOINT =
"/partner/bank-statements-set/"
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#all(params = {}) ⇒ Veryfi::Resource
List previously processed bank-statement sets.
-
#get(id, params = {}) ⇒ Veryfi::Resource
Fetch a single bank-statement set by id.
-
#initialize(request) ⇒ BankStatementSplit
constructor
A new instance of BankStatementSplit.
-
#process(raw_params) ⇒ Veryfi::Resource
Upload a multi-statement file and split-and-process it.
-
#process_url(raw_params) ⇒ Veryfi::Resource
URL variant of #process.
Constructor Details
#initialize(request) ⇒ BankStatementSplit
Returns a new instance of BankStatementSplit.
18 19 20 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 18 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
16 17 18 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 16 def request @request end |
Instance Method Details
#all(params = {}) ⇒ Veryfi::Resource
List previously processed bank-statement sets.
26 27 28 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 26 def all(params = {}) request.get(ENDPOINT, params) end |
#get(id, params = {}) ⇒ Veryfi::Resource
Fetch a single bank-statement set by id.
35 36 37 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 35 def get(id, params = {}) request.get("#{ENDPOINT}#{id}", params) end |
#process(raw_params) ⇒ Veryfi::Resource
Upload a multi-statement file and split-and-process it.
45 46 47 48 49 50 51 52 53 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 45 def process(raw_params) params = raw_params.transform_keys(&:to_sym) file_path = params.delete(:file_path) file_name = params.delete(:file_name) payload = file_payload(file_path, file_name).merge(params) request.post(ENDPOINT, payload) end |
#process_url(raw_params) ⇒ Veryfi::Resource
URL variant of #process.
61 62 63 |
# File 'lib/veryfi/api/bank_statement_split.rb', line 61 def process_url(raw_params) request.post(ENDPOINT, raw_params.transform_keys(&:to_sym)) end |