Skip to content

Commit

Permalink
SDK-1722: Add ID document comparison to demo
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston committed Sep 15, 2020
1 parent 411f898 commit f0fce91
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples/doc_scan/app/controllers/yoti_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def index
.with_manual_check_never
.build
)
.with_requested_check(
Yoti::DocScan::Session::Create::RequestedIdDocumentComparisonCheck
.builder
.build
)
.with_requested_task(
Yoti::DocScan::Session::Create::RequestedTextExtractionTask
.builder
Expand All @@ -45,6 +50,28 @@ def index
.with_error_url("#{request.base_url}/error")
.build
)
.with_required_document(
Yoti::DocScan::Session::Create::RequiredIdDocument
.builder
.with_filter(
Yoti::DocScan::Session::Create::OrthogonalRestrictionsFilter
.builder
.with_included_document_types(['PASSPORT'])
.build
)
.build
)
.with_required_document(
Yoti::DocScan::Session::Create::RequiredIdDocument
.builder
.with_filter(
Yoti::DocScan::Session::Create::OrthogonalRestrictionsFilter
.builder
.with_included_document_types(['DRIVING_LICENCE'])
.build
)
.build
)
.build

create_session = Yoti::DocScan::Client.create_session(session_spec)
Expand Down
23 changes: 23 additions & 0 deletions examples/doc_scan/app/views/yoti/success.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,29 @@
</div>
</div>
<% end %>

<% if @session_result.id_document_comparison_checks.count.positive? %>
<div class="card">
<div class="card-header" id="comparison-checks">
<h3 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse"
data-target="#collapse-comparison-checks" aria-expanded="true"
aria-controls="collapse-comparison-checks">
ID Document Comparison Checks
</button>
</h3>
</div>

<div id="collapse-comparison-checks" class="collapse" aria-labelledby="comparison-checks">
<div class="card-body">
<% @session_result.id_document_comparison_checks.each do |check| %>
<%= render partial: "check", locals: {check: check} %>
<% end %>
</div>
</div>
</div>
<% end %>

</div>
</div>
</div>
Expand Down

0 comments on commit f0fce91

Please sign in to comment.