Class: CyberSourceMergedSpec::DecisionManagerController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb

Overview

DecisionManagerController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from CyberSourceMergedSpec::BaseController

Instance Method Details

#action_decision_manager_case(id, case_management_actions_request) ⇒ ApiResponse

Take action on a DM post-transactional case generated by Cybersource to identify the submitted request. Required parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
109
110
111
112
113
114
115
# File 'lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb', line 78

def action_decision_manager_case(id,
                                 case_management_actions_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/risk/v1/decisions/{id}/actions',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .body_param(new_parameter(case_management_actions_request)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ActionDecisionManagerCaseResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid Request',
                             ActionDecisionManagerCaseException)
                .local_error('403',
                             'Access Denied',
                             ActionDecisionManagerCaseException2Exception)
                .local_error('422',
                             'Unprocessable Entity',
                             ActionDecisionManagerCaseException3Exception)
                .local_error('500',
                             'Server Error',
                             ActionDecisionManagerCaseException4Exception)
                .local_error('502',
                             'Bad Gateway',
                             ActionDecisionManagerCaseException5Exception)
                .local_error('503',
                             'Service Unavailable',
                             ActionDecisionManagerCaseException6Exception))
    .execute
end

#add_negative(type, add_negative_list_request) ⇒ ApiResponse

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'. 'positive', 'negative' or 'review'. parameter: TODO: type description here

Parameters:

  • type (String)

    Required parameter: The list to be updated. It can be

  • add_negative_list_request (AddNegativeListRequest)

    Required

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb', line 48

def add_negative(type,
                 add_negative_list_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/risk/v1/lists/{type}/entries',
                                 Server::DEFAULT)
               .template_param(new_parameter(type, key: 'type')
                                .is_required(true)
                                .should_encode(true))
               .body_param(new_parameter(add_negative_list_request)
                            .is_required(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RiskV1UpdatePost201Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             RiskV1DecisionsPost400Response2Exception))
    .execute
end

#comment_decision_manager_case(id, case_management_comments_request) ⇒ ApiResponse

Add a comment to a DM post-transactional case generated by Cybersource to identify the submitted request. Required parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



123
124
125
126
127
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
# File 'lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb', line 123

def comment_decision_manager_case(id,
                                  case_management_comments_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/risk/v1/decisions/{id}/comments',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .body_param(new_parameter(case_management_comments_request)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CommentDecisionManagerCaseResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid Request',
                             CommentDecisionManagerCaseException)
                .local_error('403',
                             'Access Denied',
                             CommentDecisionManagerCaseException2Exception)
                .local_error('422',
                             'Unprocessable Entity',
                             CommentDecisionManagerCaseException3Exception)
                .local_error('500',
                             'Server Error',
                             CommentDecisionManagerCaseException4Exception)
                .local_error('502',
                             'Bad Gateway',
                             CommentDecisionManagerCaseException5Exception)
                .local_error('503',
                             'Service Unavailable',
                             CommentDecisionManagerCaseException6Exception))
    .execute
end

#create_bundled_decision_manager_case(create_bundled_decision_manager_case_request) ⇒ ApiResponse

Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values. create_bundled_decision_manager_case_request Required parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb', line 16

def create_bundled_decision_manager_case(create_bundled_decision_manager_case_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/risk/v1/decisions',
                                 Server::DEFAULT)
               .body_param(new_parameter(create_bundled_decision_manager_case_request)
                            .is_required(true))
               .header_param(new_parameter('application/json;charset=utf-8', key: 'Content-Type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RiskV1DecisionsPost201Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             RiskV1DecisionsPost400ResponseException)
                .local_error('502',
                             'Unexpected system error or system timeout.',
                             RiskV1DecisionsPost502ResponseException))
    .execute
end

#fraud_update(id, fraud_marking_action_request) ⇒ ApiResponse

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. you want to mark as suspect or remove from history. parameter: TODO: type description here

Parameters:

  • id (String)

    Required parameter: Request ID of the transaction that

  • fraud_marking_action_request (FraudMarkingActionRequest)

    Required

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/cyber_source_merged_spec/controllers/decision_manager_controller.rb', line 175

def fraud_update(id,
                 fraud_marking_action_request)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/risk/v1/decisions/{id}/marking',
                                 Server::DEFAULT)
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .should_encode(true))
               .body_param(new_parameter(fraud_marking_action_request)
                            .is_required(true))
               .header_param(new_parameter('application/json; charset=utf-8', key: 'content-type'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(RiskV1UpdatePost201Response.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Invalid request',
                             RiskV1DecisionsPost400Response2Exception))
    .execute
end