Module: Jumio::Factories

Defined in:
lib/jumio/factories.rb

Class Method Summary collapse

Class Method Details

.scan_denied_fraud(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/jumio/factories.rb', line 24

def self.scan_denied_fraud(options = {})
  Entities::Scan.new({
    document: {
      status: 'DENIED_FRAUD'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
    verification: {
      rejectReason: {
        rejectReasonCode: '106',
        rejectReasonDescription: 'FAKE'
      }
    }
  }.deep_merge(options))
end

.scan_status_failed(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/jumio/factories.rb', line 8

def self.scan_status_failed(options = {})
  Entities::ScanStatus.new({
    timestamp: '2018-10-29T15:56:54.398Z',
    scanReference: 'WEB_UPLOAD',
    status: 'FAILED'
  }.deep_merge(options))
end

.scan_status_pending(options = {}) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/jumio/factories.rb', line 16

def self.scan_status_pending(options = {})
  Entities::ScanStatus.new({
    timestamp: '2018-10-29T15:56:54.398Z',
    scanReference: 'WEB_UPLOAD',
    status: 'PENDING'
  }.deep_merge(options))
end

.scan_with_error_not_readable_id(options = {}) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/jumio/factories.rb', line 174

def self.scan_with_error_not_readable_id(options = {})
  Entities::Scan.new({
    document: {
      status: 'ERROR_NOT_READABLE_ID'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
    verification: {
      rejectReason: {
        rejectReasonCode: '200',
        rejectReasonDescription: 'NOT_READABLE_DOCUMENT'
      }
    }
  }.deep_merge(options))
end

.scan_with_identity_match(options = {}) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/jumio/factories.rb', line 44

def self.scan_with_identity_match(options = {})
  Entities::Scan.new({
    document: {
      status: 'APPROVED_VERIFIED',
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z',
    },
    verification: {
      identityVerification: {
        similarity: 'MATCH',
        validity: 'true'
      }
    }
  }.deep_merge(options))
end

.scan_with_identity_match_and_us_id(options = {}) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/jumio/factories.rb', line 64

def self.scan_with_identity_match_and_us_id(options = {})
  Entities::Scan.new({
    document: {
      address: {
        city: "SAN FRANCISCO",
        country: "USA",
        stateCode: "US-CA",
        streetName: "20TH",
        streetNumber: "560",
        streetSuffix: "ST",
        zip: "94107"
      },
      dob: '1980-01-02',
      expiry: "2022-01-02",
      firstName: 'John',
      issuingCountry: "USA",
      lastName: 'Doe',
      number: 'A1234567',
      status: 'APPROVED_VERIFIED',
      usState: 'CA'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z',
    },
    verification: {
      identityVerification: {
        similarity: 'MATCH',
        validity: 'true'
      }
    }
  }.deep_merge(options))
end

.scan_with_match_not_possible(options = {}) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/jumio/factories.rb', line 100

def self.scan_with_match_not_possible(options = {})
  params = {
    verification: {
      identityVerification: {
        similarity: 'NOT_POSSIBLE',
        validity: 'true'
      }
    }
  }.deep_merge(options)
  scan_with_identity_match(params)
end

.scan_with_no_id_uploaded(options = {}) ⇒ Object



194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/jumio/factories.rb', line 194

def self.scan_with_no_id_uploaded(options = {})
  Entities::Scan.new({
    document: {
      status: 'NO_ID_UPLOADED'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'FAILED',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
  }.deep_merge(options))
end

.scan_with_no_identity_verification(options = {}) ⇒ Object



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/jumio/factories.rb', line 208

def self.scan_with_no_identity_verification(options = {})
  Entities::Scan.new({
    document: {
      status: 'APPROVED_VERIFIED'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
    verification: {
      mrzCheck: 'NOT_AVAILABLE'
    }
  }.deep_merge(options))
end

.scan_with_unacceptable_selfie(reason, options = {}) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/jumio/factories.rb', line 132

def self.scan_with_unacceptable_selfie(reason, options = {})
  Entities::Scan.new({
    document: {
      status: 'APPROVED_VERIFIED'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
    verification: {
      identityVerification: {
        reason: reason,
        similarity: 'NOT_POSSIBLE',
        validity: 'false'
      }
    }
  }.deep_merge(options))
end

.scan_with_unsupported_id_country(options = {}) ⇒ Object



167
168
169
170
171
172
# File 'lib/jumio/factories.rb', line 167

def self.scan_with_unsupported_id_country(options = {})
  params = {
    document: { status: 'DENIED_UNSUPPORTED_ID_COUNTRY' }
  }.deep_merge(options)
  scan_with_unsupported_id_type(params)
end

.scan_with_unsupported_id_type(options = {}) ⇒ Object



153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/jumio/factories.rb', line 153

def self.scan_with_unsupported_id_type(options = {})
  Entities::Scan.new({
    document: {
      status: 'DENIED_UNSUPPORTED_ID_TYPE'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
  }.deep_merge(options))
end

.scan_with_wrong_person(options = {}) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/jumio/factories.rb', line 112

def self.scan_with_wrong_person(options = {})
  Entities::Scan.new({
    document: {
      status: 'APPROVED_VERIFIED'
    },
    transaction: {
      date: '2018-10-29T15:56:54.398Z',
      source: 'WEB_UPLOAD',
      status: 'DONE',
      updatedAt: '2018-10-29T15:56:54.398Z'
    },
    verification: {
      identityVerification: {
        similarity: 'NO_MATCH',
        validity: 'true'
      }
    }
  }.deep_merge(options))
end

.verfication_response(options = {}) ⇒ Object



225
226
227
228
229
230
231
# File 'lib/jumio/factories.rb', line 225

def self.verfication_response(options = {})
  Entities::VerificationResponse.new({
    timestamp: '2018-10-29T15:56:54.398Z',
    transactionReference: 'a527ae56-ea7a-4476-a2de-1a678bd6189d',
    redirectUrl: 'https://netverify.com/web/v4/app?authorizationToken=TOKEN&locale=en-US'
  }.deep_merge(options))
end