persona_api 0.1.7 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +52 -5
- data/lib/persona_api/client.rb +24 -0
- data/lib/persona_api/objects/database_verification.rb +4 -0
- data/lib/persona_api/objects/government_id_verification.rb +4 -0
- data/lib/persona_api/objects/phone_carrier_verification.rb +4 -0
- data/lib/persona_api/objects/phone_number_verification.rb +4 -0
- data/lib/persona_api/objects/tin_database_verification.rb +4 -0
- data/lib/persona_api/resources/database_verifications.rb +17 -0
- data/lib/persona_api/resources/government_id_verifications.rb +17 -0
- data/lib/persona_api/resources/phone_carrier_verifications.rb +17 -0
- data/lib/persona_api/resources/phone_number_verifications.rb +21 -0
- data/lib/persona_api/resources/tin_database_verifications.rb +17 -0
- data/lib/persona_api/version.rb +1 -1
- data/lib/persona_api.rb +11 -1
- metadata +12 -3
- data/persona_api-0.1.6.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc142f2d3d4b1ea4f61b57a549b47c1589ec6235b758f79dfc9a7425fce30d7e
|
|
4
|
+
data.tar.gz: c5f2530ffc6c82964cea5bdbd1a70fd94d6f58872330900c2c0ab9570c2c4f1f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b3dfb21662215e270f42b6e7c76e271fdd3795f132411ec7af9f419743204444c2bcee1412bccb420047150adce0bb1e2c63e9df46c0855ad78a4cd3b348b6c5
|
|
7
|
+
data.tar.gz: a090952568e4010bf393b609b44e47971fe3bf5ef3af2fb5c3dd297e8a7e24190d00a79bea91a41b1525c23e7eeed7068ab360aaf6e4e9620847d4c1e6314d77
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Or install it yourself with:
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
To access the API, you'll need to create a `
|
|
21
|
+
To access the API, you'll need to create a `PersonaApi::Client` and pass in your API key. You can find your API key in your [Persona dashboard](https://app.withpersona.com/dashboard/api-configuration).
|
|
22
22
|
|
|
23
23
|
```ruby
|
|
24
24
|
client = PersonaApi::Client.new(api_key: ENV["PERSONA_API_KEY"])
|
|
@@ -29,7 +29,7 @@ The client then gives you access to all of the resources.
|
|
|
29
29
|
|
|
30
30
|
The gem attempts to map as closely as possible to the Persona API so that you can easily convert API examples in to gem code.
|
|
31
31
|
|
|
32
|
-
Responses are (in *almost* all cases) created as Objects like `
|
|
32
|
+
Responses are (in *almost* all cases) created as Objects like `PersonaApi::Account`. Having types like `PersonaApi::Inquiry` is useful for understanding the type of object you're working with. They're built using OpenStruct so that data is easily accessible in a Rubyish way.
|
|
33
33
|
|
|
34
34
|
##### Pagination
|
|
35
35
|
|
|
@@ -37,17 +37,17 @@ Responses are (in *almost* all cases) created as Objects like `PersonaAPI::Accou
|
|
|
37
37
|
|
|
38
38
|
```ruby
|
|
39
39
|
results = client.inquiries.list("page[size]": 5)
|
|
40
|
-
#=>
|
|
40
|
+
#=> PersonaApi::Collection
|
|
41
41
|
|
|
42
42
|
results.data
|
|
43
|
-
#=> [#<
|
|
43
|
+
#=> [#<PersonaApi::Inquiry>, #<PersonaApi::Inquiry>]
|
|
44
44
|
|
|
45
45
|
results.next_page
|
|
46
46
|
#=> "inq_NiHBQW47WfdPT58m4VcqFebx"
|
|
47
47
|
|
|
48
48
|
# Retrieve the next page
|
|
49
49
|
client.inquiries.list("page[size]": 5, "page[after]": results.next_page)
|
|
50
|
-
#=>
|
|
50
|
+
#=> PersonaApi::Collection
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### Accounts
|
|
@@ -81,6 +81,14 @@ client.cases.set_status(case_id: "id", {})
|
|
|
81
81
|
client.cases.add_persona_objects(case_id: "id", {})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
### Database Verifications
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
client.database_verifications.create({})
|
|
88
|
+
client.database_verifications.retrieve(ver_id: "id")
|
|
89
|
+
client.database_verifications.submit(ver_id: "id", {})
|
|
90
|
+
```
|
|
91
|
+
|
|
84
92
|
### Documents
|
|
85
93
|
|
|
86
94
|
```ruby
|
|
@@ -100,6 +108,14 @@ client.events.retrive(evt_id:)
|
|
|
100
108
|
client.files.download(file_id:, file_name:)
|
|
101
109
|
```
|
|
102
110
|
|
|
111
|
+
### Government ID Verifications
|
|
112
|
+
|
|
113
|
+
```ruby
|
|
114
|
+
client.government_id_verifications.create({})
|
|
115
|
+
client.government_id_verifications.retrieve(ver_id: "id")
|
|
116
|
+
client.government_id_verifications.submit(ver_id: "id", {})
|
|
117
|
+
```
|
|
118
|
+
|
|
103
119
|
### Inquiries
|
|
104
120
|
|
|
105
121
|
```ruby
|
|
@@ -134,6 +150,29 @@ client.lists.create_name_list({})
|
|
|
134
150
|
client.lists.create_phone_number_list({})
|
|
135
151
|
```
|
|
136
152
|
|
|
153
|
+
### List Items
|
|
154
|
+
|
|
155
|
+
```ruby
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Phone Carrier Verifications
|
|
160
|
+
|
|
161
|
+
```ruby
|
|
162
|
+
client.phone_carrier_verifications.create({})
|
|
163
|
+
client.phone_carrier_verifications.retrieve(ver_id: "id")
|
|
164
|
+
client.phone_carrier_verifications.submit(ver_id: "id", {})
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Phone Number Verifications
|
|
168
|
+
|
|
169
|
+
```ruby
|
|
170
|
+
client.phone_number_verifications.create({})
|
|
171
|
+
client.phone_number_verifications.retrieve(ver_id: "id")
|
|
172
|
+
client.phone_number_verifications.send_sms(ver_id: "id", {})
|
|
173
|
+
client.phone_number_verifications.confirm(ver_id: "id", {})
|
|
174
|
+
```
|
|
175
|
+
|
|
137
176
|
### Reports
|
|
138
177
|
|
|
139
178
|
```ruby
|
|
@@ -147,6 +186,14 @@ client.reports.remove_tag(rep_id: "id", {})
|
|
|
147
186
|
client.reports.set_all_tags(rep_id: "id", {})
|
|
148
187
|
```
|
|
149
188
|
|
|
189
|
+
### TIN Database Verifications
|
|
190
|
+
|
|
191
|
+
```ruby
|
|
192
|
+
client.tin_database_verifications.create({})
|
|
193
|
+
client.tin_database_verifications.retrieve(ver_id: "id")
|
|
194
|
+
client.tin_database_verifications.submit(ver_id: "id", {})
|
|
195
|
+
```
|
|
196
|
+
|
|
150
197
|
### User Audit Logs
|
|
151
198
|
|
|
152
199
|
```ruby
|
data/lib/persona_api/client.rb
CHANGED
|
@@ -24,6 +24,10 @@ module PersonaApi
|
|
|
24
24
|
CasesResource.new(self)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def database_verifications
|
|
28
|
+
DatabaseVerificationsResource.new(self)
|
|
29
|
+
end
|
|
30
|
+
|
|
27
31
|
def documents
|
|
28
32
|
DocumentsResource.new(self)
|
|
29
33
|
end
|
|
@@ -32,6 +36,14 @@ module PersonaApi
|
|
|
32
36
|
EventsResource.new(self)
|
|
33
37
|
end
|
|
34
38
|
|
|
39
|
+
def files
|
|
40
|
+
FilesResource.new(self)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def government_id_verifications
|
|
44
|
+
GovernmentIdVerificationsResource.new(self)
|
|
45
|
+
end
|
|
46
|
+
|
|
35
47
|
def inquiries
|
|
36
48
|
InquiriesResource.new(self)
|
|
37
49
|
end
|
|
@@ -44,10 +56,22 @@ module PersonaApi
|
|
|
44
56
|
ListItemsResource.new(self)
|
|
45
57
|
end
|
|
46
58
|
|
|
59
|
+
def phone_carrier_verifications
|
|
60
|
+
PhoneCarrierVerificationsResource.new(self)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def phone_number_verifications
|
|
64
|
+
PhoneNumberVerificationsResource.new(self)
|
|
65
|
+
end
|
|
66
|
+
|
|
47
67
|
def reports
|
|
48
68
|
ReportsResource.new(self)
|
|
49
69
|
end
|
|
50
70
|
|
|
71
|
+
def tin_database_verifications
|
|
72
|
+
TinDatabaseVerificationsResource.new(self)
|
|
73
|
+
end
|
|
74
|
+
|
|
51
75
|
def user_audit_logs
|
|
52
76
|
UserAuditLogsResource.new(self)
|
|
53
77
|
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PersonaApi
|
|
2
|
+
class DatabaseVerificationsResource < Resource
|
|
3
|
+
def create(**attributes)
|
|
4
|
+
# Database attributes must include a 'verification-template-id' and 'country-code' as well as other fields as laid out
|
|
5
|
+
# in the documentation https://docs.withpersona.com/reference/create-a-database-verification
|
|
6
|
+
DatabaseVerification.new post_request("verification/databases", body: attributes).body.dig("data")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def retrieve(ver_id:)
|
|
10
|
+
DatabaseVerification.new get_request("verification/databases/#{ver_id}").body.dig("data")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def submit(ver_id:, **attributes)
|
|
14
|
+
DatabaseVerification.new post_request("verification/databases/#{ver_id}/submit", body: attributes).body.dig("data")
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PersonaApi
|
|
2
|
+
class GovernmentIdVerificationsResource < Resource
|
|
3
|
+
def create(**attributes)
|
|
4
|
+
# Gov ID attributes must include a 'verification-template-id' as well as other fields as laid out
|
|
5
|
+
# in the documentation https://docs.withpersona.com/reference/create-a-government-id-verification
|
|
6
|
+
GovernmentIdVerification.new post_request("verification/government-ids", body: attributes).body.dig("data")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def retrieve(ver_id:)
|
|
10
|
+
GovernmentIdVerification.new get_request("verification/government-ids/#{ver_id}").body.dig("data")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def submit(ver_id:, **attributes)
|
|
14
|
+
GovernmentIdVerification.new post_request("verification/government-ids/#{ver_id}/submit", body: attributes).body.dig("data")
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PersonaApi
|
|
2
|
+
class PhoneCarrierVerificationsResource < Resource
|
|
3
|
+
def create(**attributes)
|
|
4
|
+
# Database attributes must include a 'verification-template-id' as well as other fields as laid out
|
|
5
|
+
# in the documentation https://docs.withpersona.com/reference/create-a-phone-carrier-database-verification
|
|
6
|
+
PhoneCarrierVerification.new post_request("verification/database-phone-carriers", body: attributes).body.dig("data")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def retrieve(ver_id:)
|
|
10
|
+
PhoneCarrierVerification.new get_request("verification/database-phone-carriers/#{ver_id}").body.dig("data")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def submit(ver_id:, **attributes)
|
|
14
|
+
PhoneCarrierVerification.new post_request("verification/database-phone-carriers/#{ver_id}/submit", body: attributes).body.dig("data")
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module PersonaApi
|
|
2
|
+
class PhoneNumberVerificationsResource < Resource
|
|
3
|
+
def confirm(ver_id:, **attributes)
|
|
4
|
+
PhoneNumberVerification.new post_request("verification/phone-numbers/#{ver_id}/confirm", body: attributes).body.dig("data")
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def create(**attributes)
|
|
8
|
+
# Phone number attributes must include a 'verification-template-id', 'phone-number' and 'country-code' as well
|
|
9
|
+
# as other fields as laid out in the documentation https://docs.withpersona.com/reference/create-a-phone-number-verification
|
|
10
|
+
PhoneNumberVerification.new post_request("verification/phone-numbers", body: attributes).body.dig("data")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def retrieve(ver_id:)
|
|
14
|
+
PhoneNumberVerification.new get_request("verification/phone-numbers/#{ver_id}").body.dig("data")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def send_sms(ver_id:, **attributes)
|
|
18
|
+
PhoneNumberVerification.new post_request("verification/phone-numbers/#{ver_id}/send-confirmation-code", body: attributes).body.dig("data")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module PersonaApi
|
|
2
|
+
class TinDatabaseVerificationsResource < Resource
|
|
3
|
+
def create(**attributes)
|
|
4
|
+
# TIN Database attributes must include a 'verification-template-id', a 'tin' as well as other fields as laid out
|
|
5
|
+
# in the documentation https://docs.withpersona.com/reference/create-a-tin-database-verification
|
|
6
|
+
TinDatabaseVerification.new post_request("verification/database-tins", body: attributes).body.dig("data")
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def retrieve(ver_id:)
|
|
10
|
+
TinDatabaseVerification.new get_request("verification/database-tins/#{ver_id}").body.dig("data")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def submit(ver_id:, **attributes)
|
|
14
|
+
TinDatabaseVerification.new post_request("verification/database-tins/#{ver_id}/submit", body: attributes).body.dig("data")
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/persona_api/version.rb
CHANGED
data/lib/persona_api.rb
CHANGED
|
@@ -22,6 +22,11 @@ module PersonaApi
|
|
|
22
22
|
autoload :ApiLog, "persona_api/objects/api_log"
|
|
23
23
|
autoload :UserAuditLog, "persona_api/objects/user_audit_log"
|
|
24
24
|
autoload :ListItem, "persona_api/objects/list_item"
|
|
25
|
+
autoload :GovernmentIdVerification, "persona_api/objects/government_id_verification"
|
|
26
|
+
autoload :DatabaseVerification, "persona_api/objects/database_verification"
|
|
27
|
+
autoload :PhoneNumberVerification, "persona_api/objects/phone_number_verification"
|
|
28
|
+
autoload :PhoneCarrierVerification, "persona_api/objects/phone_carrier_verification"
|
|
29
|
+
autoload :TinDatabaseVerification, "persona_api/objects/tin_database_verification"
|
|
25
30
|
|
|
26
31
|
# resources
|
|
27
32
|
autoload :AccountsResource, "persona_api/resources/accounts"
|
|
@@ -35,5 +40,10 @@ module PersonaApi
|
|
|
35
40
|
autoload :ListsResource, "persona_api/resources/lists"
|
|
36
41
|
autoload :ApiLogsResource, "persona_api/resources/api_logs"
|
|
37
42
|
autoload :UserAuditLogsResource, "persona_api/resources/user_audit_logs"
|
|
38
|
-
autoload :ListItemsResource, "persona_api/
|
|
43
|
+
autoload :ListItemsResource, "persona_api/resources/list_items"
|
|
44
|
+
autoload :GovernmentIdVerificationsResource, "persona_api/resources/government_id_verifications"
|
|
45
|
+
autoload :DatabaseVerificationsResource, "persona_api/resources/database_verifications"
|
|
46
|
+
autoload :PhoneNumberVerificationsResource, "persona_api/resources/phone_number_verifications"
|
|
47
|
+
autoload :PhoneCarrierVerificationsResource, "persona_api/resources/phone_carrier_verifications"
|
|
48
|
+
autoload :TinDatabaseVerificationsResource, "persona_api/resources/tin_database_verifications"
|
|
39
49
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: persona_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Griffith
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -61,30 +61,39 @@ files:
|
|
|
61
61
|
- lib/persona_api/objects/account.rb
|
|
62
62
|
- lib/persona_api/objects/api_log.rb
|
|
63
63
|
- lib/persona_api/objects/case.rb
|
|
64
|
+
- lib/persona_api/objects/database_verification.rb
|
|
64
65
|
- lib/persona_api/objects/document.rb
|
|
65
66
|
- lib/persona_api/objects/event.rb
|
|
66
67
|
- lib/persona_api/objects/file.rb
|
|
68
|
+
- lib/persona_api/objects/government_id_verification.rb
|
|
67
69
|
- lib/persona_api/objects/inquiry.rb
|
|
68
70
|
- lib/persona_api/objects/list.rb
|
|
69
71
|
- lib/persona_api/objects/list_item.rb
|
|
72
|
+
- lib/persona_api/objects/phone_carrier_verification.rb
|
|
73
|
+
- lib/persona_api/objects/phone_number_verification.rb
|
|
70
74
|
- lib/persona_api/objects/report.rb
|
|
75
|
+
- lib/persona_api/objects/tin_database_verification.rb
|
|
71
76
|
- lib/persona_api/objects/user_audit_log.rb
|
|
72
77
|
- lib/persona_api/objects/verification.rb
|
|
73
78
|
- lib/persona_api/resource.rb
|
|
74
79
|
- lib/persona_api/resources/accounts.rb
|
|
75
80
|
- lib/persona_api/resources/api_logs.rb
|
|
76
81
|
- lib/persona_api/resources/cases.rb
|
|
82
|
+
- lib/persona_api/resources/database_verifications.rb
|
|
77
83
|
- lib/persona_api/resources/documents.rb
|
|
78
84
|
- lib/persona_api/resources/events.rb
|
|
79
85
|
- lib/persona_api/resources/files.rb
|
|
86
|
+
- lib/persona_api/resources/government_id_verifications.rb
|
|
80
87
|
- lib/persona_api/resources/inquiries.rb
|
|
81
88
|
- lib/persona_api/resources/list_items.rb
|
|
82
89
|
- lib/persona_api/resources/lists.rb
|
|
90
|
+
- lib/persona_api/resources/phone_carrier_verifications.rb
|
|
91
|
+
- lib/persona_api/resources/phone_number_verifications.rb
|
|
83
92
|
- lib/persona_api/resources/reports.rb
|
|
93
|
+
- lib/persona_api/resources/tin_database_verifications.rb
|
|
84
94
|
- lib/persona_api/resources/user_audit_logs.rb
|
|
85
95
|
- lib/persona_api/resources/verifications.rb
|
|
86
96
|
- lib/persona_api/version.rb
|
|
87
|
-
- persona_api-0.1.6.gem
|
|
88
97
|
- sig/persona_api.rbs
|
|
89
98
|
homepage: https://github.com/mattgriffith0/persona_api
|
|
90
99
|
licenses:
|
data/persona_api-0.1.6.gem
DELETED
|
Binary file
|