lib/lenddo/white_label_client.rb in lenddo-1.2.0 vs lib/lenddo/white_label_client.rb in lenddo-2.0.0
- old
+ new
@@ -1,7 +1,8 @@
require "lenddo"
require "lenddo/authentication"
+require "lenddo/response"
require "lenddo/network_service/self"
include Lenddo::Authentication
module Lenddo
@@ -16,11 +17,11 @@
@network_service ||= NetworkService.new
if !extra_data.is_a?(Hash)
raise ArgumentError.new("@extra_data must be a Hash.")
else
- @network_service.extra_application_data(application_id, partnerscript_id, extra_data)
+ Response.new @network_service.extra_application_data(application_id, partnerscript_id, extra_data)
end
end
# Posting network tokens, if successful, returns a "Profile ID" which is used when submitting a client for scoring.
# @param string application_id
# @param string provider
@@ -33,11 +34,11 @@
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
- @network_service.partner_token(application_id, provider, token_data, oauth_key, oauth_secret)
+ Response.new @network_service.partner_token(application_id, provider, token_data, oauth_key, oauth_secret)
end
end
# 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.
# @param string partnerscript_id
@@ -50,10 +51,10 @@
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
- @network_service.commit_partner_job(partnerscript_id, application_id, profile_ids, verification)
+ Response.new @network_service.commit_partner_job(partnerscript_id, application_id, profile_ids, verification)
end
end
private
def valid_token_providers
\ No newline at end of file