=begin #Payment Gateway API Specification. #The documentation here is designed to provide all of the technical guidance required to consume and integrate with our APIs for payment processing. To learn more about our APIs please visit https://docs.firstdata.com/org/gateway. The version of the OpenAPI document: 6.13.0.20200810.001 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.1.1 =end require 'cgi' module OpenapiClient class FraudDetectApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Client registration for fraud detect transaction. # Use this to register client for fraud detect transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param client_registration [ClientRegistration] # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [FraudRegistrationResponse] def fraud_client_registration_post(content_type, client_request_id, api_key, timestamp, client_registration, opts = {}) data, _status_code, _headers = fraud_client_registration_post_with_http_info(content_type, client_request_id, api_key, timestamp, client_registration, opts) data end # Client registration for fraud detect transaction. # Use this to register client for fraud detect transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param client_registration [ClientRegistration] # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [Array<(FraudRegistrationResponse, Integer, Hash)>] FraudRegistrationResponse data, response status code and response headers def fraud_client_registration_post_with_http_info(content_type, client_request_id, api_key, timestamp, client_registration, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FraudDetectApi.fraud_client_registration_post ...' end # verify the required parameter 'content_type' is set if @api_client.config.client_side_validation && content_type.nil? fail ArgumentError, "Missing the required parameter 'content_type' when calling FraudDetectApi.fraud_client_registration_post" end # verify enum value allowable_values = ["application/json"] if @api_client.config.client_side_validation && !allowable_values.include?(content_type) fail ArgumentError, "invalid value for \"content_type\", must be one of #{allowable_values}" end # verify the required parameter 'client_request_id' is set if @api_client.config.client_side_validation && client_request_id.nil? fail ArgumentError, "Missing the required parameter 'client_request_id' when calling FraudDetectApi.fraud_client_registration_post" end # verify the required parameter 'api_key' is set if @api_client.config.client_side_validation && api_key.nil? fail ArgumentError, "Missing the required parameter 'api_key' when calling FraudDetectApi.fraud_client_registration_post" end # verify the required parameter 'timestamp' is set if @api_client.config.client_side_validation && timestamp.nil? fail ArgumentError, "Missing the required parameter 'timestamp' when calling FraudDetectApi.fraud_client_registration_post" end # verify the required parameter 'client_registration' is set if @api_client.config.client_side_validation && client_registration.nil? fail ArgumentError, "Missing the required parameter 'client_registration' when calling FraudDetectApi.fraud_client_registration_post" end # resource path local_var_path = '/fraud/client-registration' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' #header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) #header_params[:'Content-Type'] = content_type header_params[:'Client-Request-Id'] = client_request_id header_params[:'Api-Key'] = api_key header_params[:'Timestamp'] = timestamp header_params[:'Message-Signature'] = opts[:'message_signature'] if !opts[:'message_signature'].nil? header_params[:'Region'] = opts[:'region'] if !opts[:'region'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(client_registration) # return_type return_type = opts[:return_type] || 'FraudRegistrationResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FraudDetectApi#fraud_client_registration_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Payment registration for fraud detect transaction. # Use this to register payment for fraud detect transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param payment_registration [PaymentRegistration] # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [FraudRegistrationResponse] def fraud_payment_registration_post(content_type, client_request_id, api_key, timestamp, payment_registration, opts = {}) data, _status_code, _headers = fraud_payment_registration_post_with_http_info(content_type, client_request_id, api_key, timestamp, payment_registration, opts) data end # Payment registration for fraud detect transaction. # Use this to register payment for fraud detect transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param payment_registration [PaymentRegistration] # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [Array<(FraudRegistrationResponse, Integer, Hash)>] FraudRegistrationResponse data, response status code and response headers def fraud_payment_registration_post_with_http_info(content_type, client_request_id, api_key, timestamp, payment_registration, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FraudDetectApi.fraud_payment_registration_post ...' end # verify the required parameter 'content_type' is set if @api_client.config.client_side_validation && content_type.nil? fail ArgumentError, "Missing the required parameter 'content_type' when calling FraudDetectApi.fraud_payment_registration_post" end # verify enum value allowable_values = ["application/json"] if @api_client.config.client_side_validation && !allowable_values.include?(content_type) fail ArgumentError, "invalid value for \"content_type\", must be one of #{allowable_values}" end # verify the required parameter 'client_request_id' is set if @api_client.config.client_side_validation && client_request_id.nil? fail ArgumentError, "Missing the required parameter 'client_request_id' when calling FraudDetectApi.fraud_payment_registration_post" end # verify the required parameter 'api_key' is set if @api_client.config.client_side_validation && api_key.nil? fail ArgumentError, "Missing the required parameter 'api_key' when calling FraudDetectApi.fraud_payment_registration_post" end # verify the required parameter 'timestamp' is set if @api_client.config.client_side_validation && timestamp.nil? fail ArgumentError, "Missing the required parameter 'timestamp' when calling FraudDetectApi.fraud_payment_registration_post" end # verify the required parameter 'payment_registration' is set if @api_client.config.client_side_validation && payment_registration.nil? fail ArgumentError, "Missing the required parameter 'payment_registration' when calling FraudDetectApi.fraud_payment_registration_post" end # resource path local_var_path = '/fraud/payment-registration' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' #header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) #header_params[:'Content-Type'] = content_type header_params[:'Client-Request-Id'] = client_request_id header_params[:'Api-Key'] = api_key header_params[:'Timestamp'] = timestamp header_params[:'Message-Signature'] = opts[:'message_signature'] if !opts[:'message_signature'].nil? header_params[:'Region'] = opts[:'region'] if !opts[:'region'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(payment_registration) # return_type return_type = opts[:return_type] || 'FraudRegistrationResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FraudDetectApi#fraud_payment_registration_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Score a transaction for fraud. # Use this to obtain a fraud score for a transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param score_only_request [ScoreOnlyRequest] Accepted request type: ScoreOnlyRequest. # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [ScoreOnlyResponse] def score_only(content_type, client_request_id, api_key, timestamp, score_only_request, opts = {}) data, _status_code, _headers = score_only_with_http_info(content_type, client_request_id, api_key, timestamp, score_only_request, opts) data end # Score a transaction for fraud. # Use this to obtain a fraud score for a transaction. # @param content_type [String] Content type. # @param client_request_id [String] A client-generated ID for request tracking and signature creation, unique per request. This is also used for idempotency control. We recommend 128-bit UUID format. # @param api_key [String] Key given to merchant after boarding associating their requests with the appropriate app in Apigee. # @param timestamp [Integer] Epoch timestamp in milliseconds in the request from a client system. Used for Message Signature generation and time limit (5 mins). # @param score_only_request [ScoreOnlyRequest] Accepted request type: ScoreOnlyRequest. # @param [Hash] opts the optional parameters # @option opts [String] :message_signature Used to ensure the request has not been tampered with during transmission. The Message-Signature is the Base64 encoded HMAC hash (SHA256 algorithm with the API Secret as the key.) For more information, refer to the supporting documentation on the Developer Portal. # @option opts [String] :region Indicates the region where the client wants the transaction to be processed. This will override the default processing region identified for the client. Available options are argentina, brazil, germany, india and northamerica. Region specific store setup and APIGEE boarding is required in order to use an alternate region for processing. # @return [Array<(ScoreOnlyResponse, Integer, Hash)>] ScoreOnlyResponse data, response status code and response headers def score_only_with_http_info(content_type, client_request_id, api_key, timestamp, score_only_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FraudDetectApi.score_only ...' end # verify the required parameter 'content_type' is set if @api_client.config.client_side_validation && content_type.nil? fail ArgumentError, "Missing the required parameter 'content_type' when calling FraudDetectApi.score_only" end # verify enum value allowable_values = ["application/json"] if @api_client.config.client_side_validation && !allowable_values.include?(content_type) fail ArgumentError, "invalid value for \"content_type\", must be one of #{allowable_values}" end # verify the required parameter 'client_request_id' is set if @api_client.config.client_side_validation && client_request_id.nil? fail ArgumentError, "Missing the required parameter 'client_request_id' when calling FraudDetectApi.score_only" end # verify the required parameter 'api_key' is set if @api_client.config.client_side_validation && api_key.nil? fail ArgumentError, "Missing the required parameter 'api_key' when calling FraudDetectApi.score_only" end # verify the required parameter 'timestamp' is set if @api_client.config.client_side_validation && timestamp.nil? fail ArgumentError, "Missing the required parameter 'timestamp' when calling FraudDetectApi.score_only" end # verify the required parameter 'score_only_request' is set if @api_client.config.client_side_validation && score_only_request.nil? fail ArgumentError, "Missing the required parameter 'score_only_request' when calling FraudDetectApi.score_only" end # resource path local_var_path = '/fraud/score-only' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' #header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) #header_params[:'Content-Type'] = content_type header_params[:'Client-Request-Id'] = client_request_id header_params[:'Api-Key'] = api_key header_params[:'Timestamp'] = timestamp header_params[:'Message-Signature'] = opts[:'message_signature'] if !opts[:'message_signature'].nil? header_params[:'Region'] = opts[:'region'] if !opts[:'region'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(score_only_request) # return_type return_type = opts[:return_type] || 'ScoreOnlyResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FraudDetectApi#score_only\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end