-
Notifications
You must be signed in to change notification settings - Fork 448
/
identity_verificationreport.go
206 lines (180 loc) · 9.51 KB
/
identity_verificationreport.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
//
//
// File generated from our OpenAPI spec
//
//
package stripe
import "encoding/json"
type IdentityVerificationReportDocumentErrorCode string
const (
IdentityVerificationReportDocumentErrorCodeDocumentExpired IdentityVerificationReportDocumentErrorCode = "document_expired"
IdentityVerificationReportDocumentErrorCodeDocumentTypeNotSupported IdentityVerificationReportDocumentErrorCode = "document_type_not_supported"
IdentityVerificationReportDocumentErrorCodeDocumentUnverifiedOther IdentityVerificationReportDocumentErrorCode = "document_unverified_other"
)
type IdentityVerificationReportDocumentStatus string
const (
IdentityVerificationReportDocumentStatusUnverified IdentityVerificationReportDocumentStatus = "unverified"
IdentityVerificationReportDocumentStatusVerified IdentityVerificationReportDocumentStatus = "verified"
)
type IdentityVerificationReportDocumentType string
const (
IdentityVerificationReportDocumentTypeDrivingLicense IdentityVerificationReportDocumentType = "driving_license"
IdentityVerificationReportDocumentTypeIDCard IdentityVerificationReportDocumentType = "id_card"
IdentityVerificationReportDocumentTypePassport IdentityVerificationReportDocumentType = "passport"
)
type IdentityVerificationReportIDNumberErrorCode string
const (
IdentityVerificationReportIDNumberErrorCodeIDNumberInsufficientDocumentData IdentityVerificationReportIDNumberErrorCode = "id_number_insufficient_document_data"
IdentityVerificationReportIDNumberErrorCodeIDNumberMismatch IdentityVerificationReportIDNumberErrorCode = "id_number_mismatch"
IdentityVerificationReportIDNumberErrorCodeIDNumberUnverifiedOther IdentityVerificationReportIDNumberErrorCode = "id_number_unverified_other"
)
type IdentityVerificationReportIDNumberIDNumberType string
const (
IdentityVerificationReportIDNumberIDNumberTypeBRCPF IdentityVerificationReportIDNumberIDNumberType = "br_cpf"
IdentityVerificationReportIDNumberIDNumberTypeSGNRIC IdentityVerificationReportIDNumberIDNumberType = "sg_nric"
IdentityVerificationReportIDNumberIDNumberTypeUSSSN IdentityVerificationReportIDNumberIDNumberType = "us_ssn"
)
type IdentityVerificationReportIDNumberStatus string
const (
IdentityVerificationReportIDNumberStatusUnverified IdentityVerificationReportIDNumberStatus = "unverified"
IdentityVerificationReportIDNumberStatusVerified IdentityVerificationReportIDNumberStatus = "verified"
)
type IdentityVerificationReportOptionsDocumentAllowedType string
const (
IdentityVerificationReportOptionsDocumentAllowedTypeDrivingLicense IdentityVerificationReportOptionsDocumentAllowedType = "driving_license"
IdentityVerificationReportOptionsDocumentAllowedTypeIDCard IdentityVerificationReportOptionsDocumentAllowedType = "id_card"
IdentityVerificationReportOptionsDocumentAllowedTypePassport IdentityVerificationReportOptionsDocumentAllowedType = "passport"
)
type IdentityVerificationReportSelfieErrorCode string
const (
IdentityVerificationReportSelfieErrorCodeSelfieDocumentMissingPhoto IdentityVerificationReportSelfieErrorCode = "selfie_document_missing_photo"
IdentityVerificationReportSelfieErrorCodeSelfieFaceMismatch IdentityVerificationReportSelfieErrorCode = "selfie_face_mismatch"
IdentityVerificationReportSelfieErrorCodeSelfieManipulated IdentityVerificationReportSelfieErrorCode = "selfie_manipulated"
IdentityVerificationReportSelfieErrorCodeSelfieUnverifiedOther IdentityVerificationReportSelfieErrorCode = "selfie_unverified_other"
)
type IdentityVerificationReportSelfieStatus string
const (
IdentityVerificationReportSelfieStatusUnverified IdentityVerificationReportSelfieStatus = "unverified"
IdentityVerificationReportSelfieStatusVerified IdentityVerificationReportSelfieStatus = "verified"
)
type IdentityVerificationReportType string
const (
IdentityVerificationReportTypeDocument IdentityVerificationReportType = "document"
IdentityVerificationReportTypeIDNumber IdentityVerificationReportType = "id_number"
)
type IdentityVerificationReportParams struct {
Params `form:"*"`
}
type IdentityVerificationReportListParams struct {
ListParams `form:"*"`
Created *int64 `form:"created"`
CreatedRange *RangeQueryParams `form:"created"`
Type *string `form:"type"`
VerificationSession *string `form:"verification_session"`
}
type IdentityVerificationReportDocumentDOB struct {
Day int64 `json:"day"`
Month int64 `json:"month"`
Year int64 `json:"year"`
}
type IdentityVerificationReportDocumentError struct {
Code IdentityVerificationReportDocumentErrorCode `json:"code"`
Reason string `json:"reason"`
}
type IdentityVerificationReportDocumentExpirationDate struct {
Day int64 `json:"day"`
Month int64 `json:"month"`
Year int64 `json:"year"`
}
type IdentityVerificationReportDocumentIssuedDate struct {
Day int64 `json:"day"`
Month int64 `json:"month"`
Year int64 `json:"year"`
}
type IdentityVerificationReportDocument struct {
Address *Address `json:"address"`
DOB *IdentityVerificationReportDocumentDOB `json:"dob"`
Error *IdentityVerificationReportDocumentError `json:"error"`
ExpirationDate *IdentityVerificationReportDocumentExpirationDate `json:"expiration_date"`
Files []string `json:"files"`
FirstName string `json:"first_name"`
IssuedDate *IdentityVerificationReportDocumentIssuedDate `json:"issued_date"`
IssuingCountry string `json:"issuing_country"`
LastName string `json:"last_name"`
Number string `json:"number"`
Status IdentityVerificationReportDocumentStatus `json:"status"`
Type IdentityVerificationReportDocumentType `json:"type"`
}
type IdentityVerificationReportIDNumberDOB struct {
Day int64 `json:"day"`
Month int64 `json:"month"`
Year int64 `json:"year"`
}
type IdentityVerificationReportIDNumberError struct {
Code IdentityVerificationReportIDNumberErrorCode `json:"code"`
Reason string `json:"reason"`
}
type IdentityVerificationReportIDNumber struct {
DOB *IdentityVerificationReportIDNumberDOB `json:"dob"`
Error *IdentityVerificationReportIDNumberError `json:"error"`
FirstName string `json:"first_name"`
IDNumber string `json:"id_number"`
IDNumberType IdentityVerificationReportIDNumberIDNumberType `json:"id_number_type"`
LastName string `json:"last_name"`
Status IdentityVerificationReportIDNumberStatus `json:"status"`
}
type IdentityVerificationReportOptionsDocument struct {
AllowedTypes []IdentityVerificationReportOptionsDocumentAllowedType `json:"allowed_types"`
RequireIDNumber bool `json:"require_id_number"`
RequireLiveCapture bool `json:"require_live_capture"`
RequireMatchingSelfie bool `json:"require_matching_selfie"`
}
type IdentityVerificationReportOptionsIDNumber struct{}
type IdentityVerificationReportOptions struct {
Document *IdentityVerificationReportOptionsDocument `json:"document"`
IDNumber *IdentityVerificationReportOptionsIDNumber `json:"id_number"`
}
type IdentityVerificationReportSelfieError struct {
Code IdentityVerificationReportSelfieErrorCode `json:"code"`
Reason string `json:"reason"`
}
type IdentityVerificationReportSelfie struct {
Document string `json:"document"`
Error *IdentityVerificationReportSelfieError `json:"error"`
Selfie string `json:"selfie"`
Status IdentityVerificationReportSelfieStatus `json:"status"`
}
type IdentityVerificationReport struct {
APIResource
Created int64 `json:"created"`
Document *IdentityVerificationReportDocument `json:"document"`
ID string `json:"id"`
IDNumber *IdentityVerificationReportIDNumber `json:"id_number"`
Livemode bool `json:"livemode"`
Object string `json:"object"`
Options *IdentityVerificationReportOptions `json:"options"`
Selfie *IdentityVerificationReportSelfie `json:"selfie"`
Type IdentityVerificationReportType `json:"type"`
VerificationSession string `json:"verification_session"`
}
type IdentityVerificationReportList struct {
APIResource
ListMeta
Data []*IdentityVerificationReport `json:"data"`
}
// UnmarshalJSON handles deserialization of an IdentityVerificationReport.
// This custom unmarshaling is needed because the resulting
// property may be an id or the full struct if it was expanded.
func (i *IdentityVerificationReport) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
i.ID = id
return nil
}
type identityVerificationReport IdentityVerificationReport
var v identityVerificationReport
if err := json.Unmarshal(data, &v); err != nil {
return err
}
*i = IdentityVerificationReport(v)
return nil
}