Class: CyberSource::MerchantCapabilitiesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MerchantCapabilitiesApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/merchant_capabilities_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/merchant_capabilities_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#activate_merchant_key(merchant_id, key_id, opts = {}) ⇒ ActivateMerchantKeyResponse200

Activate a merchant key Activate a deactivated key. Raises 403 if merchant is deactivated, 404 if merchant or key not found, 409 if key is already active.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



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

def activate_merchant_key(merchant_id, key_id, opts = {})
  data, status_code, headers = activate_merchant_key_with_http_info(merchant_id, key_id, opts)
  return data, status_code, headers
end

#activate_merchant_key_with_http_info(merchant_id, key_id, opts = {}) ⇒ Array<(ActivateMerchantKeyResponse200, Fixnum, Hash)>

Activate a merchant key Activate a deactivated key. Raises 403 if merchant is deactivated, 404 if merchant or key not found, 409 if key is already active.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



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
109
110
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 41

def activate_merchant_key_with_http_info(merchant_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.activate_merchant_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.activate_merchant_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling MerchantCapabilitiesApi.activate_merchant_key"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys/{keyId}/activate'.sub('{' + 'merchantId' + '}', merchant_id.to_s).sub('{' + 'keyId' + '}', key_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)
  if 'POST' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["activate_merchant_key","activate_merchant_key_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, ["activate_merchant_key","activate_merchant_key_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 => 'ActivateMerchantKeyResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#activate_merchant_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#add_merchant_key(merchant_id, key_request, opts = {}) ⇒ ActivateMerchantKeyResponse200

Add a key to a merchant Add a new encryption key for a merchant. Raises 401 if not authenticated, 403 if caller does not own the merchant, 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_request

    Key creation request

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

    the optional parameters

Returns:



119
120
121
122
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 119

def add_merchant_key(merchant_id, key_request, opts = {})
  data, status_code, headers = add_merchant_key_with_http_info(merchant_id, key_request, opts)
  return data, status_code, headers
end

#add_merchant_key_with_http_info(merchant_id, key_request, opts = {}) ⇒ Array<(ActivateMerchantKeyResponse200, Fixnum, Hash)>

Add a key to a merchant Add a new encryption key for a merchant. Raises 401 if not authenticated, 403 if caller does not own the merchant, 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_request

    Key creation request

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

    the optional parameters

Returns:



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
196
197
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 130

def add_merchant_key_with_http_info(merchant_id, key_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.add_merchant_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.add_merchant_key"
  end
  # verify the required parameter 'key_request' is set
  if @api_client.config.client_side_validation && key_request.nil?
    fail ArgumentError, "Missing the required parameter 'key_request' when calling MerchantCapabilitiesApi.add_merchant_key"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys'.sub('{' + 'merchantId' + '}', merchant_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(key_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyRequest1', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["add_merchant_key","add_merchant_key_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_merchant_key","add_merchant_key_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 => 'ActivateMerchantKeyResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#add_merchant_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#deactivate_merchant_key(merchant_id, key_id, opts = {}) ⇒ DeactivateMerchantKeyResponse200

Deactivate a merchant key Deactivate a key (soft delete). Raises 401 if not authenticated, 403 if caller does not own the merchant, 404 if key not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



206
207
208
209
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 206

def deactivate_merchant_key(merchant_id, key_id, opts = {})
  data, status_code, headers = deactivate_merchant_key_with_http_info(merchant_id, key_id, opts)
  return data, status_code, headers
end

#deactivate_merchant_key_with_http_info(merchant_id, key_id, opts = {}) ⇒ Array<(DeactivateMerchantKeyResponse200, Fixnum, Hash)>

Deactivate a merchant key Deactivate a key (soft delete). Raises 401 if not authenticated, 403 if caller does not own the merchant, 404 if key not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



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
283
284
285
286
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 217

def deactivate_merchant_key_with_http_info(merchant_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.deactivate_merchant_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.deactivate_merchant_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling MerchantCapabilitiesApi.deactivate_merchant_key"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys/{keyId}'.sub('{' + 'merchantId' + '}', merchant_id.to_s).sub('{' + 'keyId' + '}', key_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)
  if 'DELETE' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["deactivate_merchant_key","deactivate_merchant_key_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, ["deactivate_merchant_key","deactivate_merchant_key_with_http_info"])

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

#get_all_products(get_all_products_request, opts = {}) ⇒ InlineResponse20020

Get All Products Returns the full product catalog stored in ACG. Note: This endpoint is intended for catalog verification and merchant tooling. It is not a real-time product discovery API for end buyers.

Parameters:

  • get_all_products_request

    Empty request body.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number to retrieve (0-based). Defaults to 0. (default to 0)

  • :size (Integer)

    Number of products per page. Defaults to 300. Server enforces a maximum of 1000; values above 1000 are capped. (default to 300)

Returns:



296
297
298
299
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 296

def get_all_products(get_all_products_request, opts = {})
  data, status_code, headers = get_all_products_with_http_info(get_all_products_request, opts)
  return data, status_code, headers
end

#get_all_products_with_http_info(get_all_products_request, opts = {}) ⇒ Array<(InlineResponse20020, Fixnum, Hash)>

Get All Products Returns the full product catalog stored in ACG. Note: This endpoint is intended for catalog verification and merchant tooling. It is not a real-time product discovery API for end buyers.

Parameters:

  • get_all_products_request

    Empty request body.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number to retrieve (0-based). Defaults to 0.

  • :size (Integer)

    Number of products per page. Defaults to 300. Server enforces a maximum of 1000; values above 1000 are capped.

Returns:

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

    InlineResponse20020 data, response status code and response headers



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
364
365
366
367
368
369
370
371
372
373
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 308

def get_all_products_with_http_info(get_all_products_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.get_all_products ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'get_all_products_request' is set
  if @api_client.config.client_side_validation && get_all_products_request.nil?
    fail ArgumentError, "Missing the required parameter 'get_all_products_request' when calling MerchantCapabilitiesApi.get_all_products"
  end
  # resource path
  local_var_path = 'icc/v1/products'

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?

  # 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(get_all_products_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Object', @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, ["get_all_products","get_all_products_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, ["get_all_products","get_all_products_with_http_info"])

  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 => 'InlineResponse20020',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#get_all_products\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_merchant(merchant_id, opts = {}) ⇒ MerchantRegistrationResponse201

Get a merchant Get merchant by ID with all associated keys. Raises 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

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

    the optional parameters

Returns:



381
382
383
384
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 381

def get_merchant(merchant_id, opts = {})
  data, status_code, headers = get_merchant_with_http_info(merchant_id, opts)
  return data, status_code, headers
end

#get_merchant_key(merchant_id, key_id, opts = {}) ⇒ ActivateMerchantKeyResponse200

Get a key by merchant and key ID Get a specific key by merchant ID and key ID. Raises 401 if not authenticated, 404 if key not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



465
466
467
468
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 465

def get_merchant_key(merchant_id, key_id, opts = {})
  data, status_code, headers = get_merchant_key_with_http_info(merchant_id, key_id, opts)
  return data, status_code, headers
end

#get_merchant_key_with_http_info(merchant_id, key_id, opts = {}) ⇒ Array<(ActivateMerchantKeyResponse200, Fixnum, Hash)>

Get a key by merchant and key ID Get a specific key by merchant ID and key ID. Raises 401 if not authenticated, 404 if key not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

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

    the optional parameters

Returns:



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 476

def get_merchant_key_with_http_info(merchant_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.get_merchant_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.get_merchant_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling MerchantCapabilitiesApi.get_merchant_key"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys/{keyId}'.sub('{' + 'merchantId' + '}', merchant_id.to_s).sub('{' + 'keyId' + '}', key_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)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_merchant_key","get_merchant_key_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, ["get_merchant_key","get_merchant_key_with_http_info"])

  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 => 'ActivateMerchantKeyResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#get_merchant_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_merchant_with_http_info(merchant_id, opts = {}) ⇒ Array<(MerchantRegistrationResponse201, Fixnum, Hash)>

Get a merchant Get merchant by ID with all associated keys. Raises 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

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

    the optional parameters

Returns:



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
451
452
453
454
455
456
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 391

def get_merchant_with_http_info(merchant_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.get_merchant ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.get_merchant"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}'.sub('{' + 'merchantId' + '}', merchant_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)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_merchant","get_merchant_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, ["get_merchant","get_merchant_with_http_info"])

  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 => 'MerchantRegistrationResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#get_merchant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_product(product_id, get_product_request, opts = {}) ⇒ InlineResponse20021

Get Product by ID Retrieves a single product from the ACG catalog by its unique product identifier (SKU). Use this to verify that a product was ingested correctly, inspect its current field values, or check its syndication-eligibility flags (is_eligible_search, is_eligible_checkout).

Parameters:

  • product_id

    The unique product identifier (SKU) assigned by the merchant and provided during feed ingestion. Example: `SKU-1001`.

  • get_product_request

    Empty request body.

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

    the optional parameters

Returns:



554
555
556
557
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 554

def get_product(product_id, get_product_request, opts = {})
  data, status_code, headers = get_product_with_http_info(product_id, get_product_request, opts)
  return data, status_code, headers
end

#get_product_with_http_info(product_id, get_product_request, opts = {}) ⇒ Array<(InlineResponse20021, Fixnum, Hash)>

Get Product by ID Retrieves a single product from the ACG catalog by its unique product identifier (SKU). Use this to verify that a product was ingested correctly, inspect its current field values, or check its syndication-eligibility flags (`is_eligible_search`, `is_eligible_checkout`).

Parameters:

  • product_id

    The unique product identifier (SKU) assigned by the merchant and provided during feed ingestion. Example: `SKU-1001`.

  • get_product_request

    Empty request body.

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

    the optional parameters

Returns:

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

    InlineResponse20021 data, response status code and response headers



565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 565

def get_product_with_http_info(product_id, get_product_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.get_product ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'product_id' is set
  if @api_client.config.client_side_validation && product_id.nil?
    fail ArgumentError, "Missing the required parameter 'product_id' when calling MerchantCapabilitiesApi.get_product"
  end
  # verify the required parameter 'get_product_request' is set
  if @api_client.config.client_side_validation && get_product_request.nil?
    fail ArgumentError, "Missing the required parameter 'get_product_request' when calling MerchantCapabilitiesApi.get_product"
  end
  # resource path
  local_var_path = 'icc/v1/products/{product_id}'.sub('{' + 'product_id' + '}', product_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(get_product_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Object', @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, ["get_product","get_product_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, ["get_product","get_product_with_http_info"])

  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 => 'InlineResponse20021',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#get_product\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ingest_product_feed_json(product_feed_request, opts = {}) ⇒ InlineResponse20019

Ingest Product Feed Uploads a merchant product catalog to ACG and triggers asynchronous syndication to all configured protocol backends (e.g. Google Merchant Center). Processing pipeline: 1. Each product is validated against UCP/ACP schema requirements (required fields, format rules) 2. Valid products are saved to the ACG catalog 3. An async syndication job is triggered to push the catalog to configured backends 4. A feed_id is returned — use this with the Syndication Status endpoint to monitor progress Supported content types: application/json (this endpoint). CSV and JSONL uploads are also supported via file upload endpoints. Partial success: If some products fail validation, the response status is PARTIAL_SUCCESS and the errors array lists the per-product validation failures. Successfully validated products are still ingested and syndicated.

Parameters:

  • product_feed_request

    Product feed payload. The `products` array is required and must contain at least one product. See `ProductInput` for the full list of required fields.

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

    the optional parameters

Returns:



640
641
642
643
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 640

def ingest_product_feed_json(product_feed_request, opts = {})
  data, status_code, headers = ingest_product_feed_json_with_http_info(product_feed_request, opts)
  return data, status_code, headers
end

#ingest_product_feed_json_with_http_info(product_feed_request, opts = {}) ⇒ Array<(InlineResponse20019, Fixnum, Hash)>

Ingest Product Feed Uploads a merchant product catalog to ACG and triggers asynchronous syndication to all configured protocol backends (e.g. Google Merchant Center). Processing pipeline: 1. Each product is validated against UCP/ACP schema requirements (required fields, format rules) 2. Valid products are saved to the ACG catalog 3. An async syndication job is triggered to push the catalog to configured backends 4. A `feed_id` is returned — use this with the Syndication Status endpoint to monitor progress Supported content types: `application/json` (this endpoint). CSV and JSONL uploads are also supported via file upload endpoints. Partial success: If some products fail validation, the response status is `PARTIAL_SUCCESS` and the `errors` array lists the per-product validation failures. Successfully validated products are still ingested and syndicated.

Parameters:

  • product_feed_request

    Product feed payload. The `products` array is required and must contain at least one product. See `ProductInput` for the full list of required fields.

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

    the optional parameters

Returns:

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

    InlineResponse20019 data, response status code and response headers



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 650

def ingest_product_feed_json_with_http_info(product_feed_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.ingest_product_feed_json ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'product_feed_request' is set
  if @api_client.config.client_side_validation && product_feed_request.nil?
    fail ArgumentError, "Missing the required parameter 'product_feed_request' when calling MerchantCapabilitiesApi.ingest_product_feed_json"
  end
  # resource path
  local_var_path = 'icc/v1/products/feed'

  # 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(product_feed_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'ProductFeedRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ingest_product_feed_json","ingest_product_feed_json_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, ["ingest_product_feed_json","ingest_product_feed_json_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 => 'InlineResponse20019',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#ingest_product_feed_json\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#list_merchant_keys(merchant_id, opts = {}) ⇒ ListMerchantKeysResponse200

List keys for a merchant List all keys for a specific merchant with optional filtering by status. Raises 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by key status: 'active', 'deactivated', or 'expired'. Omit to return all keys.

Returns:



722
723
724
725
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 722

def list_merchant_keys(merchant_id, opts = {})
  data, status_code, headers = list_merchant_keys_with_http_info(merchant_id, opts)
  return data, status_code, headers
end

#list_merchant_keys_with_http_info(merchant_id, opts = {}) ⇒ Array<(ListMerchantKeysResponse200, Fixnum, Hash)>

List keys for a merchant List all keys for a specific merchant with optional filtering by status. Raises 404 if merchant not found.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by key status: 'active', 'deactivated', or 'expired'. Omit to return all keys.

Returns:



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 733

def list_merchant_keys_with_http_info(merchant_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.list_merchant_keys ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.list_merchant_keys"
  end
  if @api_client.config.client_side_validation && opts[:'status'] && !['active', 'deactivated', 'expired'].include?(opts[:'status'])
    fail ArgumentError, 'invalid value for "status", must be one of active, deactivated, expired'
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys'.sub('{' + 'merchantId' + '}', merchant_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

  # 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)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["list_merchant_keys","list_merchant_keys_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, ["list_merchant_keys","list_merchant_keys_with_http_info"])

  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 => 'ListMerchantKeysResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#list_merchant_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#register_merchant(merchant_request, opts = {}) ⇒ MerchantRegistrationResponse201

Register a merchant Onboard a new merchant into the VMRS. The merchant declares how they want payment data delivered: cryptogram type (TAVV or DAVV), transaction indicator (TAP, ACG, or Both), whether credentials should be encrypted, and their public encryption key if encryption is enabled. Raises 409 if merchantUrl or vmid already exists.

Parameters:

  • merchant_request

    Merchant registration request

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

    the optional parameters

Returns:



810
811
812
813
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 810

def register_merchant(merchant_request, opts = {})
  data, status_code, headers = register_merchant_with_http_info(merchant_request, opts)
  return data, status_code, headers
end

#register_merchant_with_http_info(merchant_request, opts = {}) ⇒ Array<(MerchantRegistrationResponse201, Fixnum, Hash)>

Register a merchant Onboard a new merchant into the VMRS. The merchant declares how they want payment data delivered: cryptogram type (TAVV or DAVV), transaction indicator (TAP, ACG, or Both), whether credentials should be encrypted, and their public encryption key if encryption is enabled. Raises 409 if merchantUrl or vmid already exists.

Parameters:

  • merchant_request

    Merchant registration request

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

    the optional parameters

Returns:



820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 820

def register_merchant_with_http_info(merchant_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.register_merchant ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_request' is set
  if @api_client.config.client_side_validation && merchant_request.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_request' when calling MerchantCapabilitiesApi.register_merchant"
  end
  # resource path
  local_var_path = 'icc/v1/merchants'

  # 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(merchant_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["register_merchant","register_merchant_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, ["register_merchant","register_merchant_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 => 'MerchantRegistrationResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantCapabilitiesApi#register_merchant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#update_merchant(merchant_id, merchant_update, opts = {}) ⇒ MerchantRegistrationResponse201

Update a merchant Update merchant configuration. Updatable fields: merchantName, merchantUrl, cryptogramType, acceptanceRelationships, protocolInteractions, webIntegrations, apiIntegrations. Partial updates are supported — only provided fields are changed. The vmid, indicator, and paymentPayloadType fields are not updatable here; use the enable/disable-payment-encryption endpoints for encryption changes. Raises 404 if merchant not found, 403 if merchant is deactivated, 409 if new merchantUrl already exists.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • merchant_update

    Merchant update request

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

    the optional parameters

Returns:



892
893
894
895
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 892

def update_merchant(merchant_id, merchant_update, opts = {})
  data, status_code, headers = update_merchant_with_http_info(merchant_id, merchant_update, opts)
  return data, status_code, headers
end

#update_merchant_key(merchant_id, key_id, key_update, opts = {}) ⇒ ActivateMerchantKeyResponse200

Update a merchant key Update key information. Updatable fields are keyName, encryptionKey, algorithm, encryptionType, and expirationDate. Raises 401 if not authenticated, 403 if caller does not own the merchant or if merchant/key is deactivated, 404 if merchant or key not found, 409 if new keyName already exists.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

  • key_update

    Key update request

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

    the optional parameters

Returns:



980
981
982
983
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 980

def update_merchant_key(merchant_id, key_id, key_update, opts = {})
  data, status_code, headers = update_merchant_key_with_http_info(merchant_id, key_id, key_update, opts)
  return data, status_code, headers
end

#update_merchant_key_with_http_info(merchant_id, key_id, key_update, opts = {}) ⇒ Array<(ActivateMerchantKeyResponse200, Fixnum, Hash)>

Update a merchant key Update key information. Updatable fields are keyName, encryptionKey, algorithm, encryptionType, and expirationDate. Raises 401 if not authenticated, 403 if caller does not own the merchant or if merchant/key is deactivated, 404 if merchant or key not found, 409 if new keyName already exists.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • key_id

    Unique key identifier (UUID)

  • key_update

    Key update request

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

    the optional parameters

Returns:



992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 992

def update_merchant_key_with_http_info(merchant_id, key_id, key_update, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.update_merchant_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.update_merchant_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling MerchantCapabilitiesApi.update_merchant_key"
  end
  # verify the required parameter 'key_update' is set
  if @api_client.config.client_side_validation && key_update.nil?
    fail ArgumentError, "Missing the required parameter 'key_update' when calling MerchantCapabilitiesApi.update_merchant_key"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}/keys/{keyId}'.sub('{' + 'merchantId' + '}', merchant_id.to_s).sub('{' + 'keyId' + '}', key_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(key_update)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyUpdate1', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_merchant_key","update_merchant_key_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, ["update_merchant_key","update_merchant_key_with_http_info"])

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

#update_merchant_with_http_info(merchant_id, merchant_update, opts = {}) ⇒ Array<(MerchantRegistrationResponse201, Fixnum, Hash)>

Update a merchant Update merchant configuration. Updatable fields: merchantName, merchantUrl, cryptogramType, acceptanceRelationships, protocolInteractions, webIntegrations, apiIntegrations. Partial updates are supported — only provided fields are changed. The vmid, indicator, and paymentPayloadType fields are not updatable here; use the enable/disable-payment-encryption endpoints for encryption changes. Raises 404 if merchant not found, 403 if merchant is deactivated, 409 if new merchantUrl already exists.

Parameters:

  • merchant_id

    Unique merchant identifier (UUID)

  • merchant_update

    Merchant update request

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

    the optional parameters

Returns:



903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/cybersource_rest_client/api/merchant_capabilities_api.rb', line 903

def update_merchant_with_http_info(merchant_id, merchant_update, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantCapabilitiesApi.update_merchant ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'merchant_id' is set
  if @api_client.config.client_side_validation && merchant_id.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_id' when calling MerchantCapabilitiesApi.update_merchant"
  end
  # verify the required parameter 'merchant_update' is set
  if @api_client.config.client_side_validation && merchant_update.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_update' when calling MerchantCapabilitiesApi.update_merchant"
  end
  # resource path
  local_var_path = 'icc/v1/merchants/{merchantId}'.sub('{' + 'merchantId' + '}', merchant_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(merchant_update)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantUpdate', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_merchant","update_merchant_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, ["update_merchant","update_merchant_with_http_info"])

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