Class: CyberSource::DecisionManagerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/api/decision_manager_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ DecisionManagerApi

Returns a new instance of DecisionManagerApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 18

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
  @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#action_decision_manager_case(id, case_management_actions_request, opts = {}) ⇒ InlineResponse2002

Take action on a DM post-transactional case Take action on a DM post-transactional case

Parameters:

  • id

    An unique identification number generated by Cybersource to identify the submitted request.

  • case_management_actions_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



30
31
32
33
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 30

def action_decision_manager_case(id, case_management_actions_request, opts = {})
  data, status_code, headers = action_decision_manager_case_with_http_info(id, case_management_actions_request, opts)
  return data, status_code, headers
end

#action_decision_manager_case_with_http_info(id, case_management_actions_request, opts = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>

Take action on a DM post-transactional case Take action on a DM post-transactional case

Parameters:

  • id

    An unique identification number generated by Cybersource to identify the submitted request.

  • case_management_actions_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2002, Fixnum, Hash)>)

    InlineResponse2002 data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 41

def action_decision_manager_case_with_http_info(id, case_management_actions_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: DecisionManagerApi.action_decision_manager_case ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'id' is set

  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DecisionManagerApi.action_decision_manager_case"
  end
  # verify the required parameter 'case_management_actions_request' is set

  if @api_client.config.client_side_validation && case_management_actions_request.nil?
    fail ArgumentError, "Missing the required parameter 'case_management_actions_request' when calling DecisionManagerApi.action_decision_manager_case"
  end
  # resource path

  local_var_path = 'risk/v1/decisions/{id}/actions'.sub('{' + 'id' + '}', id.to_s)

  # query parameters

  query_params = {}

  # header parameters

  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'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(case_management_actions_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CaseManagementActionsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["action_decision_manager_case","action_decision_manager_case_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["action_decision_manager_case","action_decision_manager_case_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2002',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: DecisionManagerApi#action_decision_manager_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#add_negative(type, add_negative_list_request, opts = {}) ⇒ RiskV1UpdatePost201Response

List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be ‘postiive’, ‘negative’ or ‘review’.

Parameters:

  • type

    The list to be updated. It can be &#39;positive&#39;, &#39;negative&#39; or &#39;review&#39;.

  • add_negative_list_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



117
118
119
120
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 117

def add_negative(type, add_negative_list_request, opts = {})
  data, status_code, headers = add_negative_with_http_info(type, add_negative_list_request, opts)
  return data, status_code, headers
end

#add_negative_with_http_info(type, add_negative_list_request, opts = {}) ⇒ Array<(RiskV1UpdatePost201Response, Fixnum, Hash)>

List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be &#39;postiive&#39;, &#39;negative&#39; or &#39;review&#39;.

Parameters:

  • type

    The list to be updated. It can be &#39;positive&#39;, &#39;negative&#39; or &#39;review&#39;.

  • add_negative_list_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 128

def add_negative_with_http_info(type, add_negative_list_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: DecisionManagerApi.add_negative ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'type' is set

  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling DecisionManagerApi.add_negative"
  end
  # verify the required parameter 'add_negative_list_request' is set

  if @api_client.config.client_side_validation && add_negative_list_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_negative_list_request' when calling DecisionManagerApi.add_negative"
  end
  # resource path

  local_var_path = 'risk/v1/lists/{type}/entries'.sub('{' + 'type' + '}', type.to_s)

  # query parameters

  query_params = {}

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(add_negative_list_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AddNegativeListRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["add_negative","add_negative_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["add_negative","add_negative_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RiskV1UpdatePost201Response',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: DecisionManagerApi#add_negative\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#comment_decision_manager_case(id, case_management_comments_request, opts = {}) ⇒ InlineResponse2011

Add a comment to a DM post-transactional case Add a comment to a DM post-transactional case

Parameters:

  • id

    An unique identification number generated by Cybersource to identify the submitted request.

  • case_management_comments_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



204
205
206
207
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 204

def comment_decision_manager_case(id, case_management_comments_request, opts = {})
  data, status_code, headers = comment_decision_manager_case_with_http_info(id, case_management_comments_request, opts)
  return data, status_code, headers
end

#comment_decision_manager_case_with_http_info(id, case_management_comments_request, opts = {}) ⇒ Array<(InlineResponse2011, Fixnum, Hash)>

Add a comment to a DM post-transactional case Add a comment to a DM post-transactional case

Parameters:

  • id

    An unique identification number generated by Cybersource to identify the submitted request.

  • case_management_comments_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2011, Fixnum, Hash)>)

    InlineResponse2011 data, response status code and response headers



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 215

def comment_decision_manager_case_with_http_info(id, case_management_comments_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: DecisionManagerApi.comment_decision_manager_case ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'id' is set

  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DecisionManagerApi.comment_decision_manager_case"
  end
  # verify the required parameter 'case_management_comments_request' is set

  if @api_client.config.client_side_validation && case_management_comments_request.nil?
    fail ArgumentError, "Missing the required parameter 'case_management_comments_request' when calling DecisionManagerApi.comment_decision_manager_case"
  end
  # resource path

  local_var_path = 'risk/v1/decisions/{id}/comments'.sub('{' + 'id' + '}', id.to_s)

  # query parameters

  query_params = {}

  # header parameters

  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'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(case_management_comments_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CaseManagementCommentsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["comment_decision_manager_case","comment_decision_manager_case_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["comment_decision_manager_case","comment_decision_manager_case_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2011',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: DecisionManagerApi#comment_decision_manager_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#create_bundled_decision_manager_case(create_bundled_decision_manager_case_request, opts = {}) ⇒ RiskV1DecisionsPost201Response

Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values.

Parameters:

  • create_bundled_decision_manager_case_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



290
291
292
293
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 290

def create_bundled_decision_manager_case(create_bundled_decision_manager_case_request, opts = {})
  data, status_code, headers = create_bundled_decision_manager_case_with_http_info(create_bundled_decision_manager_case_request, opts)
  return data, status_code, headers
end

#create_bundled_decision_manager_case_with_http_info(create_bundled_decision_manager_case_request, opts = {}) ⇒ Array<(RiskV1DecisionsPost201Response, Fixnum, Hash)>

Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values.

Parameters:

  • create_bundled_decision_manager_case_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 300

def create_bundled_decision_manager_case_with_http_info(create_bundled_decision_manager_case_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: DecisionManagerApi.create_bundled_decision_manager_case ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'create_bundled_decision_manager_case_request' is set

  if @api_client.config.client_side_validation && create_bundled_decision_manager_case_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_bundled_decision_manager_case_request' when calling DecisionManagerApi.create_bundled_decision_manager_case"
  end
  # resource path

  local_var_path = 'risk/v1/decisions'

  # query parameters

  query_params = {}

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(create_bundled_decision_manager_case_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateBundledDecisionManagerCaseRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["create_bundled_decision_manager_case","create_bundled_decision_manager_case_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["create_bundled_decision_manager_case","create_bundled_decision_manager_case_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RiskV1DecisionsPost201Response',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: DecisionManagerApi#create_bundled_decision_manager_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#fraud_update(id, fraud_marking_action_request, opts = {}) ⇒ RiskV1UpdatePost201Response

Fraud Marking This can be used to - 1. Add known fraudulent data to the fraud history 2. Remove data added to history with Transaction Marking Tool or by uploading chargeback files 3. Remove chargeback data from history that was automatically added. For detailed information, contact your Cybersource representative Place the request ID of the transaction you want to mark as suspect (or remove from history) as the path parameter in this request.

Parameters:

  • id

    Request ID of the transaction that you want to mark as suspect or remove from history.

  • fraud_marking_action_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



372
373
374
375
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 372

def fraud_update(id, fraud_marking_action_request, opts = {})
  data, status_code, headers = fraud_update_with_http_info(id, fraud_marking_action_request, opts)
  return data, status_code, headers
end

#fraud_update_with_http_info(id, fraud_marking_action_request, opts = {}) ⇒ Array<(RiskV1UpdatePost201Response, Fixnum, Hash)>

Fraud Marking This can be used to - 1. Add known fraudulent data to the fraud history 2. Remove data added to history with Transaction Marking Tool or by uploading chargeback files 3. Remove chargeback data from history that was automatically added. For detailed information, contact your Cybersource representative Place the request ID of the transaction you want to mark as suspect (or remove from history) as the path parameter in this request.

Parameters:

  • id

    Request ID of the transaction that you want to mark as suspect or remove from history.

  • fraud_marking_action_request
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/cybersource_rest_client/api/decision_manager_api.rb', line 383

def fraud_update_with_http_info(id, fraud_marking_action_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: DecisionManagerApi.fraud_update ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'id' is set

  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DecisionManagerApi.fraud_update"
  end
  # verify the required parameter 'fraud_marking_action_request' is set

  if @api_client.config.client_side_validation && fraud_marking_action_request.nil?
    fail ArgumentError, "Missing the required parameter 'fraud_marking_action_request' when calling DecisionManagerApi.fraud_update"
  end
  # resource path

  local_var_path = 'risk/v1/decisions/{id}/marking'.sub('{' + 'id' + '}', id.to_s)

  # query parameters

  query_params = {}

  # header parameters

  header_params = {}
  # HTTP header 'Accept' (if needed)

  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(fraud_marking_action_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'FraudMarkingActionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["fraud_update","fraud_update_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["fraud_update","fraud_update_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'RiskV1UpdatePost201Response',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: DecisionManagerApi#fraud_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end