Class: CyberSource::BatchesApi
- Inherits:
-
Object
- Object
- CyberSource::BatchesApi
- Defined in:
- lib/cybersource_rest_client/api/batches_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_batch_report(batch_id, opts = {}) ⇒ InlineResponse20014
Retrieve a Batch Report **Get Batch Report**
This resource accepts a batch id and returns: - The batch status. -
#get_batch_report_with_http_info(batch_id, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>
Retrieve a Batch Report **Get Batch Report**<br>This resource accepts a batch id and returns: - The batch status.
-
#get_batch_status(batch_id, opts = {}) ⇒ InlineResponse20013
Retrieve a Batch Status **Get Batch Status**
This resource accepts a batch id and returns: - The batch status. -
#get_batch_status_with_http_info(batch_id, opts = {}) ⇒ Array<(InlineResponse20013, Fixnum, Hash)>
Retrieve a Batch Status **Get Batch Status**<br>This resource accepts a batch id and returns: - The batch status.
-
#get_batches_list(opts = {}) ⇒ InlineResponse20012
List Batches **List Batches**
This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id. -
#get_batches_list_with_http_info(opts = {}) ⇒ Array<(InlineResponse20012, Fixnum, Hash)>
List Batches **List Batches**<br>This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id.
-
#initialize(api_client = ApiClient.default, config) ⇒ BatchesApi
constructor
A new instance of BatchesApi.
-
#post_batch(body, opts = {}) ⇒ InlineResponse2022
Create a Batch **Create a Batch**
This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier. -
#post_batch_with_http_info(body, opts = {}) ⇒ Array<(InlineResponse2022, Fixnum, Hash)>
Create a Batch **Create a Batch**<br>This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier.
Constructor Details
#initialize(api_client = ApiClient.default, config) ⇒ BatchesApi
Returns a new instance of BatchesApi.
19 20 21 22 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 19 def initialize(api_client = ApiClient.default, config) @api_client = api_client @api_client.set_configuration(config) end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_batch_report(batch_id, opts = {}) ⇒ InlineResponse20014
Retrieve a Batch Report **Get Batch Report**
This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH) - Source record information including token ids, masked card number, expiration dates & card type. - Response record information including response code, reason, token ids, masked card number, expiration dates & card type.
28 29 30 31 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 28 def get_batch_report(batch_id, opts = {}) data, status_code, headers = get_batch_report_with_http_info(batch_id, opts) return data, status_code, headers end |
#get_batch_report_with_http_info(batch_id, opts = {}) ⇒ Array<(InlineResponse20014, Fixnum, Hash)>
Retrieve a Batch Report **Get Batch Report**<br>This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH) - Source record information including token ids, masked card number, expiration dates & card type. - Response record information including response code, reason, token ids, masked card number, expiration dates & card type.
38 39 40 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 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 38 def get_batch_report_with_http_info(batch_id, opts = {}) if @api_client.config.debugging begin raise @api_client.config.logger.debug 'Calling API: BatchesApi.get_batch_report ...' rescue puts 'Cannot write to log' end end # verify the required parameter 'batch_id' is set if @api_client.config.client_side_validation && batch_id.nil? fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.get_batch_report" end if @api_client.config.client_side_validation && batch_id > 32 fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_report, must be smaller than or equal to 32.' end if @api_client.config.client_side_validation && batch_id < 16 fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_report, must be greater than or equal to 16.' end # resource path local_var_path = 'accountupdater/v1/batches/{batchId}/report'.sub('{' + 'batchId' + '}', batch_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;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) if 'GET' == 'POST' post_body = '{}' else post_body = nil end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse20014') if @api_client.config.debugging begin raise @api_client.config.logger.debug "API called: BatchesApi#get_batch_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" rescue puts 'Cannot write to log' end end return data, status_code, headers end |
#get_batch_status(batch_id, opts = {}) ⇒ InlineResponse20013
Retrieve a Batch Status **Get Batch Status**
This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH)
105 106 107 108 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 105 def get_batch_status(batch_id, opts = {}) data, status_code, headers = get_batch_status_with_http_info(batch_id, opts) return data, status_code, headers end |
#get_batch_status_with_http_info(batch_id, opts = {}) ⇒ Array<(InlineResponse20013, Fixnum, Hash)>
Retrieve a Batch Status **Get Batch Status**<br>This resource accepts a batch id and returns: - The batch status. - The total number of accepted, rejected, updated records. - The total number of card association responses. - The billable quantities of: - New Account Numbers (NAN) - New Expiry Dates (NED) - Account Closures (ACL) - Contact Card Holders (CCH)
115 116 117 118 119 120 121 122 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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 115 def get_batch_status_with_http_info(batch_id, opts = {}) if @api_client.config.debugging begin raise @api_client.config.logger.debug 'Calling API: BatchesApi.get_batch_status ...' rescue puts 'Cannot write to log' end end # verify the required parameter 'batch_id' is set if @api_client.config.client_side_validation && batch_id.nil? fail ArgumentError, "Missing the required parameter 'batch_id' when calling BatchesApi.get_batch_status" end if @api_client.config.client_side_validation && batch_id > 32 fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_status, must be smaller than or equal to 32.' end if @api_client.config.client_side_validation && batch_id < 16 fail ArgumentError, 'invalid value for "batch_id" when calling BatchesApi.get_batch_status, must be greater than or equal to 16.' end # resource path local_var_path = 'accountupdater/v1/batches/{batchId}/status'.sub('{' + 'batchId' + '}', batch_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;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) if 'GET' == 'POST' post_body = '{}' else post_body = nil end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse20013') if @api_client.config.debugging begin raise @api_client.config.logger.debug "API called: BatchesApi#get_batch_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" rescue puts 'Cannot write to log' end end return data, status_code, headers end |
#get_batches_list(opts = {}) ⇒ InlineResponse20012
List Batches **List Batches**
This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id. - The batch status. - The batch created / modified dates. - The total number of accepted, rejected, updated records. - The total number of card association responses.
185 186 187 188 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 185 def get_batches_list(opts = {}) data, status_code, headers = get_batches_list_with_http_info(opts) return data, status_code, headers end |
#get_batches_list_with_http_info(opts = {}) ⇒ Array<(InlineResponse20012, Fixnum, Hash)>
List Batches **List Batches**<br>This resource accepts a optional date range, record offset and limit, returning a paginated response of batches containing: - The batch id. - The batch status. - The batch created / modified dates. - The total number of accepted, rejected, updated records. - The total number of card association responses.
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 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 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 198 def get_batches_list_with_http_info(opts = {}) if @api_client.config.debugging begin raise @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches_list ...' rescue puts 'Cannot write to log' end end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BatchesApi.get_batches_list, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BatchesApi.get_batches_list, must be smaller than or equal to 500.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BatchesApi.get_batches_list, must be greater than or equal to 1.' end # resource path local_var_path = 'accountupdater/v1/batches' # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/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) if 'GET' == 'POST' post_body = '{}' else post_body = nil end auth_names = [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse20012') if @api_client.config.debugging begin raise @api_client.config.logger.debug "API called: BatchesApi#get_batches_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" rescue puts 'Cannot write to log' end end return data, status_code, headers end |
#post_batch(body, opts = {}) ⇒ InlineResponse2022
Create a Batch **Create a Batch**
This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier.
The card numbers for the supplied tokens ids are then sent to the relevant card associations to check for updates.
The following type of batches can be submitted: - oneOff batch containing tokens id for Visa or MasterCard card numbers. - amexRegistration batch containing tokens id for Amex card numbers. A batch id will be returned on a successful response which can be used to get the batch status and the batch report.
269 270 271 272 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 269 def post_batch(body, opts = {}) data, status_code, headers = post_batch_with_http_info(body, opts) return data, status_code, headers end |
#post_batch_with_http_info(body, opts = {}) ⇒ Array<(InlineResponse2022, Fixnum, Hash)>
Create a Batch **Create a Batch**<br>This resource accepts TMS tokens ids of a Customer, Payment Instrument or Instrument Identifier. <br> The card numbers for the supplied tokens ids are then sent to the relevant card associations to check for updates.<br>The following type of batches can be submitted: - oneOff batch containing tokens id for Visa or MasterCard card numbers. - amexRegistration batch containing tokens id for Amex card numbers. A batch id will be returned on a successful response which can be used to get the batch status and the batch report.
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 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 |
# File 'lib/cybersource_rest_client/api/batches_api.rb', line 279 def post_batch_with_http_info(body, opts = {}) if @api_client.config.debugging begin raise @api_client.config.logger.debug 'Calling API: BatchesApi.post_batch ...' rescue puts 'Cannot write to log' end end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling BatchesApi.post_batch" end # resource path local_var_path = 'accountupdater/v1/batches' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/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(body) 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 => 'InlineResponse2022') if @api_client.config.debugging begin raise @api_client.config.logger.debug "API called: BatchesApi#post_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" rescue puts 'Cannot write to log' end end return data, status_code, headers end |