lib/yoti/http/aml_check_request.rb in yoti-1.6.4 vs lib/yoti/http/aml_check_request.rb in yoti-1.7.0
- old
+ new
@@ -1,25 +1,31 @@
module Yoti
# Manage the API's AML check requests
class AmlCheckRequest
+ #
+ # @param [AmlProfile] aml_profile
+ #
def initialize(aml_profile)
@aml_profile = aml_profile
@payload = aml_profile.payload
@request = request
end
- # @return [String] a JSON representation of the AML check response
+ # @return [Hash] a JSON representation of the AML check response
def response
JSON.parse(@request.body)
end
private
def request
- yoti_request = Yoti::Request.new
- yoti_request.http_method = 'POST'
- yoti_request.endpoint = 'aml-check'
- yoti_request.payload = @payload
- yoti_request
+ Yoti::Request
+ .builder
+ .with_http_method('POST')
+ .with_base_url(Yoti.configuration.api_endpoint)
+ .with_endpoint('aml-check')
+ .with_query_param('appId', Yoti.configuration.client_sdk_id)
+ .with_payload(@payload)
+ .build
end
end
end