Module: Lenddo::WhiteLabelClient
- Defined in:
- lib/lenddo/white_label_client.rb
Class Attribute Summary collapse
-
.network_service ⇒ Object
Returns the value of attribute network_service.
Class Method Summary collapse
-
.commit_partner_job(partnerscript_id, application_id, profile_ids, verification = nil) ⇒ Object
Submit an application with profile ids for scoring to Lenddo.
-
.extra_application_data(application_id, partnerscript_id, extra_data = {}) ⇒ Object
Submit additional data about an application to Lenddo.
-
.partner_token(application_id, provider, token_data, oauth_key, oauth_secret = nil) ⇒ Object
Posting network tokens, if successful, returns a “Profile ID” which is used when submitting a client for scoring.
Class Attribute Details
.network_service ⇒ Object
Returns the value of attribute network_service.
11 12 13 |
# File 'lib/lenddo/white_label_client.rb', line 11 def network_service @network_service end |
Class Method Details
.commit_partner_job(partnerscript_id, application_id, profile_ids, verification = nil) ⇒ Object
Submit an application with profile ids for scoring to Lenddo. To perform this step you must have an array of at least one profile id obtained from the PartnerToken call.
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/lenddo/white_label_client.rb', line 48 def commit_partner_job(partnerscript_id, application_id, profile_ids, verification = nil) @network_service ||= NetworkService.new if !profile_ids.is_a?(Array) raise ArgumentError.new("@profile_ids must be an array.") elsif profile_ids.empty? raise ArgumentError.new("@profile_ids must contain at least one entry.") else Response.new @network_service.commit_partner_job(partnerscript_id, application_id, profile_ids, verification) end end |
.extra_application_data(application_id, partnerscript_id, extra_data = {}) ⇒ Object
Submit additional data about an application to Lenddo.
16 17 18 19 20 21 22 23 24 |
# File 'lib/lenddo/white_label_client.rb', line 16 def extra_application_data(application_id, partnerscript_id, extra_data = {}) @network_service ||= NetworkService.new if !extra_data.is_a?(Hash) raise ArgumentError.new("@extra_data must be a Hash.") else Response.new @network_service.extra_application_data(application_id, partnerscript_id, extra_data) end end |
.partner_token(application_id, provider, token_data, oauth_key, oauth_secret = nil) ⇒ Object
Posting network tokens, if successful, returns a “Profile ID” which is used when submitting a client for scoring.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lenddo/white_label_client.rb', line 31 def partner_token(application_id, provider, token_data, oauth_key, oauth_secret = nil) @network_service ||= NetworkService.new if !valid_token_providers.include?(provider) raise ArgumentError.new("@provider must be one of the following: #{valid_token_providers.join(", ")}") elsif !token_data.is_a?(Hash) raise ArgumentError.new("@token_data must be a Hash.") else Response.new @network_service.partner_token(application_id, provider, token_data, oauth_key, oauth_secret) end end |