Class: CyberSource::MerchantDefinedFieldsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MerchantDefinedFieldsApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_merchant_defined_field_definition(reference_type, merchant_defined_field_definition_request, opts = {}) ⇒ Array<InlineResponse2004>

Create merchant defined field for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Invoice, Purchase, Donation

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

    the optional parameters

Returns:



29
30
31
32
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 29

def create_merchant_defined_field_definition(reference_type, merchant_defined_field_definition_request, opts = {})
  data, status_code, headers = create_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts)
  return data, status_code, headers
end

#create_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Create merchant defined field for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Invoice, Purchase, Donation

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 39

def create_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.create_merchant_defined_field_definition ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.create_merchant_defined_field_definition"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Invoice', 'Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Invoice, Purchase, Donation"
  end
  # verify the required parameter 'merchant_defined_field_definition_request' is set
  if @api_client.config.client_side_validation && merchant_defined_field_definition_request.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_defined_field_definition_request' when calling MerchantDefinedFieldsApi.create_merchant_defined_field_definition"
  end
  # resource path
  local_var_path = 'invoicing/v2/{referenceType}/merchantDefinedFields'.sub('{' + 'referenceType' + '}', reference_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/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(merchant_defined_field_definition_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantDefinedFieldDefinitionRequest', @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_merchant_defined_field_definition","create_merchant_defined_field_definition_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_merchant_defined_field_definition","create_merchant_defined_field_definition_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 => 'Array<InlineResponse2004>',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#create_merchant_defined_field_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#create_pbl_merchant_defined_field_definition(reference_type, merchant_defined_field_definition_request, opts = {}) ⇒ Array<InlineResponse2004>

Create a PayByLink merchant defined field for a given reference type Creates a merchant defined field for the given reference type (Purchase or Donation). The field type is independent of the reference type: both Purchase and Donation support both Text and Select fields. Set fieldType to Text or Select accordingly.

Parameters:

  • reference_type

    The reference type for which the merchant defined field is to be created. Available values are Purchase and Donation

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

    the optional parameters

Returns:



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

def create_pbl_merchant_defined_field_definition(reference_type, merchant_defined_field_definition_request, opts = {})
  data, status_code, headers = create_pbl_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts)
  return data, status_code, headers
end

#create_pbl_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Create a PayByLink merchant defined field for a given reference type Creates a merchant defined field for the given reference type (`Purchase` or `Donation`). The field type is independent of the reference type: both `Purchase` and `Donation` support both `Text` and `Select` fields. Set `fieldType` to `Text` or `Select` accordingly.

Parameters:

  • reference_type

    The reference type for which the merchant defined field is to be created. Available values are Purchase and Donation

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
198
199
200
201
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 130

def create_pbl_merchant_defined_field_definition_with_http_info(reference_type, merchant_defined_field_definition_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.create_pbl_merchant_defined_field_definition ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.create_pbl_merchant_defined_field_definition"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Purchase, Donation"
  end
  # verify the required parameter 'merchant_defined_field_definition_request' is set
  if @api_client.config.client_side_validation && merchant_defined_field_definition_request.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_defined_field_definition_request' when calling MerchantDefinedFieldsApi.create_pbl_merchant_defined_field_definition"
  end
  # resource path
  local_var_path = 'ipl/v2/{referenceType}/merchantDefinedFields'.sub('{' + 'referenceType' + '}', reference_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/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(merchant_defined_field_definition_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantDefinedFieldDefinitionRequest1', @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_pbl_merchant_defined_field_definition","create_pbl_merchant_defined_field_definition_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_pbl_merchant_defined_field_definition","create_pbl_merchant_defined_field_definition_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 => 'Array<InlineResponse2004>',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#create_pbl_merchant_defined_field_definition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#delete_merchant_defined_fields_definitions(reference_type, id, opts = {}) ⇒ nil

Delete a MerchantDefinedField by ID

Parameters:

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

    the optional parameters

Returns:

  • (nil)


209
210
211
212
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 209

def delete_merchant_defined_fields_definitions(reference_type, id, opts = {})
  data, status_code, headers = delete_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts)
  return data, status_code, headers
end

#delete_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a MerchantDefinedField by ID

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
287
288
289
290
291
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 219

def delete_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.delete_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.delete_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Invoice', 'Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Invoice, Purchase, Donation"
  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 MerchantDefinedFieldsApi.delete_merchant_defined_fields_definitions"
  end
  # resource path
  local_var_path = 'invoicing/v2/{referenceType}/merchantDefinedFields/{id}'.sub('{' + 'referenceType' + '}', reference_type.to_s).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)
  if 'DELETE' == '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, ["delete_merchant_defined_fields_definitions","delete_merchant_defined_fields_definitions_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, ["delete_merchant_defined_fields_definitions","delete_merchant_defined_fields_definitions_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,
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#delete_merchant_defined_fields_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#delete_pbl_merchant_defined_fields_definitions(reference_type, id, opts = {}) ⇒ nil

Delete a PayByLink MerchantDefinedField by ID

Parameters:

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

    the optional parameters

Returns:

  • (nil)


299
300
301
302
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 299

def delete_pbl_merchant_defined_fields_definitions(reference_type, id, opts = {})
  data, status_code, headers = delete_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts)
  return data, status_code, headers
end

#delete_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a PayByLink MerchantDefinedField by ID

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
374
375
376
377
378
379
380
381
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 309

def delete_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.delete_pbl_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.delete_pbl_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Purchase, Donation"
  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 MerchantDefinedFieldsApi.delete_pbl_merchant_defined_fields_definitions"
  end
  # resource path
  local_var_path = 'ipl/v2/{referenceType}/merchantDefinedFields/{id}'.sub('{' + 'referenceType' + '}', reference_type.to_s).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)
  if 'DELETE' == '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, ["delete_pbl_merchant_defined_fields_definitions","delete_pbl_merchant_defined_fields_definitions_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, ["delete_pbl_merchant_defined_fields_definitions","delete_pbl_merchant_defined_fields_definitions_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,
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#delete_pbl_merchant_defined_fields_definitions\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_defined_fields_definitions(reference_type, opts = {}) ⇒ Array<InlineResponse2004>

Get all merchant defined fields for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Invoice, Purchase, Donation

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

    the optional parameters

Returns:



388
389
390
391
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 388

def get_merchant_defined_fields_definitions(reference_type, opts = {})
  data, status_code, headers = get_merchant_defined_fields_definitions_with_http_info(reference_type, opts)
  return data, status_code, headers
end

#get_merchant_defined_fields_definitions_with_http_info(reference_type, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Get all merchant defined fields for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Invoice, Purchase, Donation

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
457
458
459
460
461
462
463
464
465
466
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 397

def get_merchant_defined_fields_definitions_with_http_info(reference_type, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.get_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.get_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Invoice', 'Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Invoice, Purchase, Donation"
  end
  # resource path
  local_var_path = 'invoicing/v2/{referenceType}/merchantDefinedFields'.sub('{' + 'referenceType' + '}', reference_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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

#get_pbl_merchant_defined_fields_definitions(reference_type, opts = {}) ⇒ Array<InlineResponse2004>

Get all PayByLink merchant defined fields for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Purchase, Donation and PayByLink. PayByLink returns the merchant defined fields for both Purchase and Donation combined.

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

    the optional parameters

Returns:



473
474
475
476
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 473

def get_pbl_merchant_defined_fields_definitions(reference_type, opts = {})
  data, status_code, headers = get_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, opts)
  return data, status_code, headers
end

#get_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Get all PayByLink merchant defined fields for a given reference type

Parameters:

  • reference_type

    The reference type for which merchant defined fields are to be fetched. Available values are Purchase, Donation and PayByLink. PayByLink returns the merchant defined fields for both Purchase and Donation combined.

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

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
546
547
548
549
550
551
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 482

def get_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.get_pbl_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.get_pbl_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Purchase', 'Donation', 'PayByLink'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Purchase, Donation, PayByLink"
  end
  # resource path
  local_var_path = 'ipl/v2/{referenceType}/merchantDefinedFields'.sub('{' + 'referenceType' + '}', reference_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/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

#put_merchant_defined_fields_definitions(reference_type, id, merchant_defined_field_core, opts = {}) ⇒ Array<InlineResponse2004>

Update a MerchantDefinedField by ID

Parameters:

  • reference_type
  • id
  • merchant_defined_field_core
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



560
561
562
563
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 560

def put_merchant_defined_fields_definitions(reference_type, id, merchant_defined_field_core, opts = {})
  data, status_code, headers = put_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts)
  return data, status_code, headers
end

#put_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Update a MerchantDefinedField by ID

Parameters:

  • reference_type
  • id
  • merchant_defined_field_core
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 571

def put_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.put_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.put_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Invoice', 'Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Invoice, Purchase, Donation"
  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 MerchantDefinedFieldsApi.put_merchant_defined_fields_definitions"
  end
  # verify the required parameter 'merchant_defined_field_core' is set
  if @api_client.config.client_side_validation && merchant_defined_field_core.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_defined_field_core' when calling MerchantDefinedFieldsApi.put_merchant_defined_fields_definitions"
  end
  # resource path
  local_var_path = 'invoicing/v2/{referenceType}/merchantDefinedFields/{id}'.sub('{' + 'referenceType' + '}', reference_type.to_s).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(merchant_defined_field_core)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantDefinedFieldCore', @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, ["put_merchant_defined_fields_definitions","put_merchant_defined_fields_definitions_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, ["put_merchant_defined_fields_definitions","put_merchant_defined_fields_definitions_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 => 'Array<InlineResponse2004>',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#put_merchant_defined_fields_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#put_pbl_merchant_defined_fields_definitions(reference_type, id, merchant_defined_field_core, opts = {}) ⇒ Array<InlineResponse2004>

Update a PayByLink MerchantDefinedField by ID

Parameters:

  • reference_type
  • id
  • merchant_defined_field_core
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



655
656
657
658
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 655

def put_pbl_merchant_defined_fields_definitions(reference_type, id, merchant_defined_field_core, opts = {})
  data, status_code, headers = put_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts)
  return data, status_code, headers
end

#put_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts = {}) ⇒ Array<(Array<InlineResponse2004>, Fixnum, Hash)>

Update a PayByLink MerchantDefinedField by ID

Parameters:

  • reference_type
  • id
  • merchant_defined_field_core
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Array data, response status code and response headers



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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
# File 'lib/cybersource_rest_client/api/merchant_defined_fields_api.rb', line 666

def put_pbl_merchant_defined_fields_definitions_with_http_info(reference_type, id, merchant_defined_field_core, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: MerchantDefinedFieldsApi.put_pbl_merchant_defined_fields_definitions ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'reference_type' is set
  if @api_client.config.client_side_validation && reference_type.nil?
    fail ArgumentError, "Missing the required parameter 'reference_type' when calling MerchantDefinedFieldsApi.put_pbl_merchant_defined_fields_definitions"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Purchase', 'Donation'].include?(reference_type)
    fail ArgumentError, "invalid value for 'reference_type', must be one of Purchase, Donation"
  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 MerchantDefinedFieldsApi.put_pbl_merchant_defined_fields_definitions"
  end
  # verify the required parameter 'merchant_defined_field_core' is set
  if @api_client.config.client_side_validation && merchant_defined_field_core.nil?
    fail ArgumentError, "Missing the required parameter 'merchant_defined_field_core' when calling MerchantDefinedFieldsApi.put_pbl_merchant_defined_fields_definitions"
  end
  # resource path
  local_var_path = 'ipl/v2/{referenceType}/merchantDefinedFields/{id}'.sub('{' + 'referenceType' + '}', reference_type.to_s).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(merchant_defined_field_core)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'MerchantDefinedFieldCore1', @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, ["put_pbl_merchant_defined_fields_definitions","put_pbl_merchant_defined_fields_definitions_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, ["put_pbl_merchant_defined_fields_definitions","put_pbl_merchant_defined_fields_definitions_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 => 'Array<InlineResponse2004>',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: MerchantDefinedFieldsApi#put_pbl_merchant_defined_fields_definitions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end