| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package WebService::Async::Onfido::Check; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 2 |  |  | 2 |  | 18 | use strict; | 
|  | 2 |  |  |  |  | 28 |  | 
|  | 2 |  |  |  |  | 80 |  | 
| 4 | 2 |  |  | 2 |  | 13 | use warnings; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 61 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 | 2 |  |  | 2 |  | 14 | use parent qw(WebService::Async::Onfido::Base::Check); | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 11 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | our $VERSION = '0.003';    # VERSION | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | =head1 NAME | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | WebService::Async::Onfido::Check - represents data for Onfido | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | =cut | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 2 |  |  | 2 |  | 129 | use Log::Any qw($log); | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 21 |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | sub as_string { | 
| 21 | 0 |  |  | 0 | 0 | 0 | my ($self) = @_; | 
| 22 |  |  |  |  |  |  |  | 
| 23 | 0 |  |  |  |  | 0 | return sprintf 'Check %s, result was %s (created %s as ID %s)', $self->status, $self->result, $self->created_at, $self->id; | 
| 24 |  |  |  |  |  |  | } | 
| 25 |  |  |  |  |  |  |  | 
| 26 | 0 |  | 0 | 0 | 0 | 0 | sub applicant { return shift->{applicant} // die 'no applicant defined' } | 
| 27 |  |  |  |  |  |  |  | 
| 28 | 2 |  |  | 2 | 0 | 16 | sub onfido { return shift->{onfido} } | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | sub reports { | 
| 31 | 1 |  |  | 1 | 0 | 1705 | my ($self, %args) = @_; | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | # return Ryu::Source->from($self->{reports}) if $self->{reports}; | 
| 34 |  |  |  |  |  |  | return $self->onfido->report_list( | 
| 35 |  |  |  |  |  |  | check_id => $self->id, | 
| 36 |  |  |  |  |  |  | %args | 
| 37 | 1 |  |  | 2 |  | 5 | )->map(sub { $log->debugf('Have report %s', $_->as_string); $_->{check} = $self; $_ }); | 
|  | 2 |  |  |  |  | 84 |  | 
|  | 2 |  |  |  |  | 19 |  | 
|  | 2 |  |  |  |  | 28 |  | 
| 38 |  |  |  |  |  |  | } | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | 1; | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | __END__ | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | =head1 AUTHOR | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | deriv.com C<< DERIV@cpan.org >> | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | =head1 LICENSE | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | Copyright deriv.com 2019. Licensed under the same terms as Perl itself. | 
| 51 |  |  |  |  |  |  |  |