finapps 5.0.25 → 5.0.30

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +2 -1
  3. data/RELEASES.md +40 -0
  4. data/finapps.gemspec +1 -1
  5. data/lib/finapps.rb +6 -1
  6. data/lib/finapps/rest/client.rb +14 -8
  7. data/lib/finapps/rest/consumers.rb +3 -1
  8. data/lib/finapps/rest/documents_orders.rb +88 -0
  9. data/lib/finapps/rest/documents_orders_notifications.rb +14 -0
  10. data/lib/finapps/rest/esign_templates.rb +11 -0
  11. data/lib/finapps/rest/signed_documents_downloads.rb +15 -0
  12. data/lib/finapps/rest/verix/verix_documents.rb +21 -0
  13. data/lib/finapps/rest/verix/verix_pdf_documents.rb +15 -0
  14. data/lib/finapps/version.rb +1 -1
  15. data/spec/rest/consumers_spec.rb +24 -1
  16. data/spec/rest/documents_orders_notifications_spec.rb +40 -0
  17. data/spec/rest/documents_orders_spec.rb +272 -0
  18. data/spec/rest/esign_templates_spec.rb +20 -0
  19. data/spec/rest/signed_documents_downloads_spec.rb +35 -0
  20. data/spec/rest/verix/verix_documents_spec.rb +52 -0
  21. data/spec/rest/verix/verix_pdf_documents_spec.rb +35 -0
  22. data/spec/rest/verix/verix_records_spec.rb +3 -14
  23. data/spec/support/fake_api.rb +74 -8
  24. data/spec/support/fixtures/documents_order.json +75 -0
  25. data/spec/support/fixtures/documents_orders.json +32 -0
  26. data/spec/support/fixtures/esign_templates.json +6 -0
  27. data/spec/support/fixtures/invalid_order_id.json +5 -0
  28. data/spec/support/fixtures/invalid_signature_id.json +5 -0
  29. data/spec/support/fixtures/sign_url.json +4 -0
  30. data/spec/support/fixtures/signed_document.pdf +0 -0
  31. data/spec/support/fixtures/verix/document/document.pdf +0 -0
  32. data/spec/support/fixtures/verix/document/list.json +36 -0
  33. data/spec/support/fixtures/verix/document/show.json +35 -0
  34. data/spec/support/fixtures/verix/record/create.json +25 -17
  35. data/spec/support/fixtures/verix/record/list.json +121 -45
  36. metadata +80 -56
  37. data/lib/finapps/rest/statements.rb +0 -16
  38. data/spec/rest/statements_spec.rb +0 -42
  39. data/spec/support/fixtures/fake_pdf_statement.json +0 -3
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FinApps
4
- module REST
5
- class Statements < FinAppsCore::REST::Resources
6
- def show(account_id, document_id)
7
- not_blank(account_id, :account_id)
8
- not_blank(document_id, :document_id)
9
-
10
- path =
11
- "accounts/#{ERB::Util.url_encode(account_id)}/statement/#{ERB::Util.url_encode(document_id)}"
12
- super nil, path
13
- end
14
- end
15
- end
16
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helpers/client'
4
-
5
- RSpec.describe FinApps::REST::Statements do
6
- include SpecHelpers::Client
7
- subject { FinApps::REST::Statements.new(client) }
8
-
9
- describe '#show' do
10
- context 'when missing account_id' do
11
- let(:show) { subject.show(nil, 'valid_id') }
12
- it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
13
- end
14
-
15
- context 'when missing document_id' do
16
- let(:show) { subject.show('valid_id', nil) }
17
- it { expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) }
18
- end
19
-
20
- context 'when valid ids are provided' do
21
- let(:show) { subject.show('valid_id', 'valid_id') }
22
- it { expect { show }.not_to raise_error }
23
- it('returns an array') { expect(show).to be_a(Array) }
24
- it('performs a get and returns the response') do
25
- expect(show[RESULTS]).to have_key(:data)
26
- end
27
- it('returns no error messages') do
28
- expect(show[ERROR_MESSAGES]).to be_empty
29
- end
30
- end
31
-
32
- context 'when invalid ids are provided' do
33
- let(:show) { subject.show('invalid_id', 'valid_id') }
34
- it { expect { show }.not_to raise_error }
35
- it('returns an array') { expect(show).to be_a(Array) }
36
- it('results is nil') { expect(show[RESULTS]).to be_nil }
37
- it('error messages array is populated') do
38
- expect(show[ERROR_MESSAGES].first.downcase).to eq('resource not found')
39
- end
40
- end
41
- end
42
- end
@@ -1,3 +0,0 @@
1
- {
2
- "data": "pdf data here"
3
- }