Class: Metropol::Client
- Inherits:
-
Object
- Object
- Metropol::Client
- Includes:
- LegalId
- Defined in:
- lib/metropol/client.rb
Constant Summary
Constants included from LegalId
Instance Method Summary collapse
- #credit_score(id_type: nil, id_number: nil) ⇒ Object
- #delinquency_status(loan_amount: 0, id_type: nil, id_number: nil) ⇒ Object
-
#initialize(public_key:, private_key:, port: nil, api_version: nil) ⇒ Client
constructor
A new instance of Client.
- #json_report(loan_amount: 0, report_reason: 1, id_type: nil, id_number: nil) ⇒ Object
- #noncredit_data(id_type: nil, id_number: nil) ⇒ Object
- #verify(id_type: nil, id_number: nil) ⇒ Object
Methods included from LegalId
Constructor Details
#initialize(public_key:, private_key:, port: nil, api_version: nil) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 |
# File 'lib/metropol/client.rb', line 8 def initialize(public_key:, private_key:, port: nil, api_version: nil) @public_key = public_key @private_key = private_key @port = port @api_version = api_version end |
Instance Method Details
#credit_score(id_type: nil, id_number: nil) ⇒ Object
27 28 29 30 31 |
# File 'lib/metropol/client.rb', line 27 def credit_score(id_type: nil, id_number: nil) payload = {report_type: 3} path = 'score/consumer' fetch(path, payload, id_type, id_number) end |
#delinquency_status(loan_amount: 0, id_type: nil, id_number: nil) ⇒ Object
21 22 23 24 25 |
# File 'lib/metropol/client.rb', line 21 def delinquency_status(loan_amount: 0, id_type: nil, id_number: nil) payload = {report_type: 2, loan_amount: loan_amount} path = 'delinquency/status' fetch(path, payload, id_type, id_number) end |
#json_report(loan_amount: 0, report_reason: 1, id_type: nil, id_number: nil) ⇒ Object
33 34 35 36 37 |
# File 'lib/metropol/client.rb', line 33 def json_report(loan_amount: 0, report_reason: 1, id_type: nil, id_number: nil) payload = {report_type: 8, loan_amount: loan_amount, report_reason: report_reason} path = 'report/credit_info' fetch(path, payload, id_type, id_number) end |
#noncredit_data(id_type: nil, id_number: nil) ⇒ Object
39 40 41 42 43 |
# File 'lib/metropol/client.rb', line 39 def noncredit_data(id_type: nil, id_number: nil) payload = {report_type: 6} path = 'identity/scrub' fetch(path, payload, id_type, id_number) end |
#verify(id_type: nil, id_number: nil) ⇒ Object
15 16 17 18 19 |
# File 'lib/metropol/client.rb', line 15 def verify(id_type: nil, id_number: nil) payload = {report_type: 1} path = 'identity/verify' fetch(path, payload, id_type, id_number) end |