persona_api 0.1.7 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7d308b88c311b3deeeb677d3b6a47678e57cee228f94c4c26cad6fe539ac294
4
- data.tar.gz: d80c4955d35e0c64b4b8ceefae37a9c9f0e3665bf90bf0d963e1b6048ccdb14b
3
+ metadata.gz: 22a3768e6cb6a14d5af54a64196e8c5f5df453967f7b5646a0692e6ffda3fcb2
4
+ data.tar.gz: ea457502f6813d80e7da46b965c846d806e14ea2b3e6597b6df0f8154eca95ad
5
5
  SHA512:
6
- metadata.gz: c16adba0eb78c7bd84d4cbcdcee671821b25f8e950835d3c418f9ecf5d449a32fe765837f180fb16ed75db2a6b5f4ae1b4dcb3b4fbc2a0db9f1632551265e7b3
7
- data.tar.gz: 5c72a21cb1a404909ab91b44256d68085987a94dfc3e73569a401bf4cbeec1421005189cd373629090ee131138af1a4e8dfb05c8f7bc6d42d5fdd49de2bbb03e
6
+ metadata.gz: d27ac09c8a2fc5933af069fb71c6ec4fcf18dcdf1e234086f178bf9b9304b30ba9dd71bb2dcb71b68f38207e5462e47ebfbe7b78fa83f96af8ea0353310e3f53
7
+ data.tar.gz: aa922090b50b3007888abc6c786ba314fc829f9baa8bfec2bce081c7ebe25f65103b3142a6842edfafe36c1a17a8a2cd69997df219abdc221c35678477cf9235
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ == [0.3.0] - 2022-11-07
2
+
3
+ * Add Transactions Endpoint
4
+ * Bug fixes
5
+
6
+ == [0.2.0] - 2022-08-18
7
+
8
+ * Update README.md
9
+ * Add Server API Verification Endpoints (Gov ID, Phone, Database, TIN)
10
+ * Bug fixes
11
+
1
12
  == [0.1.7] - 2022-07-16
2
13
 
3
14
  * Update README.md
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- persona_api (0.1.5)
4
+ persona_api (0.3.0)
5
5
  faraday (~> 1.7)
6
6
  faraday_middleware (~> 1.1)
7
7
 
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 `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).
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 `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.
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
- #=> PersonaAPI::Collection
40
+ #=> PersonaApi::Collection
41
41
 
42
42
  results.data
43
- #=> [#<PersonaAPI::Inquiry>, #<PersonaAPI::Inquiry>]
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
- #=> PersonaAPI::Collection
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,21 @@ 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
+
197
+ ### Transactions
198
+
199
+ ```ruby
200
+ client.transactions.create({})
201
+ client.transactions.retrieve(txn_id: "id")
202
+ ```
203
+
150
204
  ### User Audit Logs
151
205
 
152
206
  ```ruby
@@ -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,26 @@ 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
+
75
+ def transactions
76
+ TransactionsResource.new(self)
77
+ end
78
+
51
79
  def user_audit_logs
52
80
  UserAuditLogsResource.new(self)
53
81
  end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class DatabaseVerification < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class GovernmentIdVerification < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class PhoneCarrierVerification < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class PhoneNumberVerification < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class TinDatabaseVerification < Object
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module PersonaApi
2
+ class Transaction < Object
3
+ end
4
+ end
@@ -10,7 +10,7 @@ module PersonaApi
10
10
  end
11
11
 
12
12
  def create(**attributes)
13
- Account.new post_request("inquiries", body: attributes).body.dig("data")
13
+ Account.new post_request("accounts", body: attributes).body.dig("data")
14
14
  end
15
15
 
16
16
  def list(**params)
@@ -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
@@ -0,0 +1,15 @@
1
+ module PersonaApi
2
+ class TransactionsResource < Resource
3
+ def create(**attributes)
4
+ Transaction.new post_request("transactions", body: attributes).body.dig("data")
5
+ end
6
+
7
+ def list(**params)
8
+ Collection.from_response get_request("transactions", params: params), key: "data", type: Transaction
9
+ end
10
+
11
+ def retrieve(txn_id:)
12
+ Transaction.new get_request("transactions/#{txn_id}").body.dig("data")
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PersonaApi
4
- VERSION = "0.1.7"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/persona_api.rb CHANGED
@@ -22,6 +22,12 @@ 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"
30
+ autoload :Transaction, "persona_api/objects/transaction"
25
31
 
26
32
  # resources
27
33
  autoload :AccountsResource, "persona_api/resources/accounts"
@@ -35,5 +41,11 @@ module PersonaApi
35
41
  autoload :ListsResource, "persona_api/resources/lists"
36
42
  autoload :ApiLogsResource, "persona_api/resources/api_logs"
37
43
  autoload :UserAuditLogsResource, "persona_api/resources/user_audit_logs"
38
- autoload :ListItemsResource, "persona_api/resoruces/list_items"
44
+ autoload :ListItemsResource, "persona_api/resources/list_items"
45
+ autoload :GovernmentIdVerificationsResource, "persona_api/resources/government_id_verifications"
46
+ autoload :DatabaseVerificationsResource, "persona_api/resources/database_verifications"
47
+ autoload :PhoneNumberVerificationsResource, "persona_api/resources/phone_number_verifications"
48
+ autoload :PhoneCarrierVerificationsResource, "persona_api/resources/phone_carrier_verifications"
49
+ autoload :TinDatabaseVerificationsResource, "persona_api/resources/tin_database_verifications"
50
+ autoload :TransactionsResource, "persona_api/resources/transactions"
39
51
  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.1.7
4
+ version: 0.3.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-07-16 00:00:00.000000000 Z
11
+ date: 2022-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -61,30 +61,41 @@ 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
76
+ - lib/persona_api/objects/transaction.rb
71
77
  - lib/persona_api/objects/user_audit_log.rb
72
78
  - lib/persona_api/objects/verification.rb
73
79
  - lib/persona_api/resource.rb
74
80
  - lib/persona_api/resources/accounts.rb
75
81
  - lib/persona_api/resources/api_logs.rb
76
82
  - lib/persona_api/resources/cases.rb
83
+ - lib/persona_api/resources/database_verifications.rb
77
84
  - lib/persona_api/resources/documents.rb
78
85
  - lib/persona_api/resources/events.rb
79
86
  - lib/persona_api/resources/files.rb
87
+ - lib/persona_api/resources/government_id_verifications.rb
80
88
  - lib/persona_api/resources/inquiries.rb
81
89
  - lib/persona_api/resources/list_items.rb
82
90
  - lib/persona_api/resources/lists.rb
91
+ - lib/persona_api/resources/phone_carrier_verifications.rb
92
+ - lib/persona_api/resources/phone_number_verifications.rb
83
93
  - lib/persona_api/resources/reports.rb
94
+ - lib/persona_api/resources/tin_database_verifications.rb
95
+ - lib/persona_api/resources/transactions.rb
84
96
  - lib/persona_api/resources/user_audit_logs.rb
85
97
  - lib/persona_api/resources/verifications.rb
86
98
  - lib/persona_api/version.rb
87
- - persona_api-0.1.6.gem
88
99
  - sig/persona_api.rbs
89
100
  homepage: https://github.com/mattgriffith0/persona_api
90
101
  licenses:
Binary file