Class: CyberSource::ManageWebhooksApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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



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

def api_client
  @api_client
end

Instance Method Details

#delete_webhook_subscription(webhook_id, opts = {}) ⇒ nil

Delete a Webhook Subscription Delete the webhook. Please note that deleting a particular webhook does not delete the history of the webhook notifications.



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

def delete_webhook_subscription(webhook_id, opts = {})
  data, status_code, headers = delete_webhook_subscription_with_http_info(webhook_id, opts)
  return data, status_code, headers
end

#delete_webhook_subscription_with_http_info(webhook_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a Webhook Subscription Delete the webhook. Please note that deleting a particular webhook does not delete the history of the webhook notifications.



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
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 39

def delete_webhook_subscription_with_http_info(webhook_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v2/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s)

  # query parameters

  query_params = {}

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

  if '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_webhook_subscription","delete_webhook_subscription_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_webhook_subscription","delete_webhook_subscription_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: ManageWebhooksApi#delete_webhook_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_webhook_subscription_by_id(webhook_id, opts = {}) ⇒ InlineResponse2018

Get Details On a Single Webhook Retrieve the details of a specific webhook by supplying the webhook ID in the path.



111
112
113
114
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 111

def get_webhook_subscription_by_id(webhook_id, opts = {})
  data, status_code, headers = get_webhook_subscription_by_id_with_http_info(webhook_id, opts)
  return data, status_code, headers
end

#get_webhook_subscription_by_id_with_http_info(webhook_id, opts = {}) ⇒ Array<(InlineResponse2018, Fixnum, Hash)>

Get Details On a Single Webhook Retrieve the details of a specific webhook by supplying the webhook ID in the path.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 121

def get_webhook_subscription_by_id_with_http_info(webhook_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v2/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s)

  # query parameters

  query_params = {}

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_webhook_subscription_by_id","get_webhook_subscription_by_id_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_webhook_subscription_by_id","get_webhook_subscription_by_id_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 => 'InlineResponse2018',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: ManageWebhooksApi#get_webhook_subscription_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_webhook_subscriptions_by_org(organization_id, opts = {}) ⇒ Array<InlineResponse2007>

Get Details On All Created Webhooks Retrieve a list of all previously created webhooks.

Options Hash (opts):

  • :product_id (String)

    The Product Identifier.

  • :event_type (String)

    The Event Type.



196
197
198
199
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 196

def get_webhook_subscriptions_by_org(organization_id, opts = {})
  data, status_code, headers = get_webhook_subscriptions_by_org_with_http_info(organization_id, opts)
  return data, status_code, headers
end

#get_webhook_subscriptions_by_org_with_http_info(organization_id, opts = {}) ⇒ Array<(Array<InlineResponse2007>, Fixnum, Hash)>

Get Details On All Created Webhooks Retrieve a list of all previously created webhooks.

Options Hash (opts):

  • :product_id (String)

    The Product Identifier.

  • :event_type (String)

    The Event Type.



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

def get_webhook_subscriptions_by_org_with_http_info(organization_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v2/webhooks'

  # query parameters

  query_params = {}
  query_params[:'organizationId'] = organization_id
  query_params[:'productId'] = opts[:'product_id'] if !opts[:'product_id'].nil?
  query_params[:'eventType'] = opts[:'event_type'] if !opts[:'event_type'].nil?

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_webhook_subscriptions_by_org","get_webhook_subscriptions_by_org_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_webhook_subscriptions_by_org","get_webhook_subscriptions_by_org_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<InlineResponse2007>',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: ManageWebhooksApi#get_webhook_subscriptions_by_org\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#notification_subscriptions_v1_webhooks_webhook_id_post(webhook_id, opts = {}) ⇒ InlineResponse2019

Test a Webhook Configuration Test the webhook configuration by sending a sample webhook. Calling this endpoint sends a sample webhook to the endpoint identified in the user's subscription. It will contain sample values for the product & eventType based on values present in your subscription along with a sample message in the payload. Based on the webhook response users can make any necessary modifications or rest assured knowing their setup is configured correctly.



284
285
286
287
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 284

def notification_subscriptions_v1_webhooks_webhook_id_post(webhook_id, opts = {})
  data, status_code, headers = notification_subscriptions_v1_webhooks_webhook_id_post_with_http_info(webhook_id, opts)
  return data, status_code, headers
end

#notification_subscriptions_v1_webhooks_webhook_id_post_with_http_info(webhook_id, opts = {}) ⇒ Array<(InlineResponse2019, Fixnum, Hash)>

Test a Webhook Configuration Test the webhook configuration by sending a sample webhook. Calling this endpoint sends a sample webhook to the endpoint identified in the user's subscription. It will contain sample values for the product & eventType based on values present in your subscription along with a sample message in the payload. Based on the webhook response users can make any necessary modifications or rest assured knowing their setup is configured correctly.



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
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
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 294

def notification_subscriptions_v1_webhooks_webhook_id_post_with_http_info(webhook_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v1/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s)

  # query parameters

  query_params = {}

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

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

#notification_subscriptions_v2_webhooks_webhook_id_patch(webhook_id, opts = {}) ⇒ InlineResponse2008

Update a Webhook Subscription Update a Webhook Subscription.

Options Hash (opts):

  • :update_webhook (UpdateWebhook)

    The webhook payload or changes to apply.



368
369
370
371
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 368

def notification_subscriptions_v2_webhooks_webhook_id_patch(webhook_id, opts = {})
  data, status_code, headers = notification_subscriptions_v2_webhooks_webhook_id_patch_with_http_info(webhook_id, opts)
  return data, status_code, headers
end

#notification_subscriptions_v2_webhooks_webhook_id_patch_with_http_info(webhook_id, opts = {}) ⇒ Array<(InlineResponse2008, Fixnum, Hash)>

Update a Webhook Subscription Update a Webhook Subscription.

Options Hash (opts):

  • :update_webhook (UpdateWebhook)

    The webhook payload or changes to apply.



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

def notification_subscriptions_v2_webhooks_webhook_id_patch_with_http_info(webhook_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v2/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s)

  # query parameters

  query_params = {}

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(opts[:'update_webhook'])
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateWebhook', @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, ["notification_subscriptions_v2_webhooks_webhook_id_patch","notification_subscriptions_v2_webhooks_webhook_id_patch_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, ["notification_subscriptions_v2_webhooks_webhook_id_patch","notification_subscriptions_v2_webhooks_webhook_id_patch_with_http_info"])

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

#notification_subscriptions_v2_webhooks_webhook_id_status_put(webhook_id, opts = {}) ⇒ nil

Update a Webhook Status Users can update the status of a webhook subscription by calling this endpoint. The webhookId parameter in the URL path identifies the specific webhook subscription to be updated. The request body accepts the values ACTIVE or INACTIVE. If the subscription is set to INACTIVE, webhooks will not be delivered until the subscription is activated again.

Options Hash (opts):

  • :update_status (UpdateStatus)

    The status that the subscription should be updated to.



451
452
453
454
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 451

def notification_subscriptions_v2_webhooks_webhook_id_status_put(webhook_id, opts = {})
  data, status_code, headers = notification_subscriptions_v2_webhooks_webhook_id_status_put_with_http_info(webhook_id, opts)
  return data, status_code, headers
end

#notification_subscriptions_v2_webhooks_webhook_id_status_put_with_http_info(webhook_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a Webhook Status Users can update the status of a webhook subscription by calling this endpoint. The webhookId parameter in the URL path identifies the specific webhook subscription to be updated. The request body accepts the values ACTIVE or INACTIVE. If the subscription is set to INACTIVE, webhooks will not be delivered until the subscription is activated again.

Options Hash (opts):

  • :update_status (UpdateStatus)

    The status that the subscription should be updated to.



462
463
464
465
466
467
468
469
470
471
472
473
474
475
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
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 462

def notification_subscriptions_v2_webhooks_webhook_id_status_put_with_http_info(webhook_id, opts = {})

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

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

  local_var_path = 'notification-subscriptions/v2/webhooks/{webhookId}/status'.sub('{' + 'webhookId' + '}', webhook_id.to_s)

  # query parameters

  query_params = {}

  # header parameters

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

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

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

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(opts[:'update_status'])
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UpdateStatus', @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, ["notification_subscriptions_v2_webhooks_webhook_id_status_put","notification_subscriptions_v2_webhooks_webhook_id_status_put_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, ["notification_subscriptions_v2_webhooks_webhook_id_status_put","notification_subscriptions_v2_webhooks_webhook_id_status_put_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,
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: ManageWebhooksApi#notification_subscriptions_v2_webhooks_webhook_id_status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#save_asym_egress_key(save_asym_egress_key, opts = {}) ⇒ InlineResponse20110

Message Level Encryption Store and manage certificates that will be used to preform Message Level Encryption (MLE). Each new webhook will need its own unique asymmetric certificate. You can either use a digital certificate issued/signed by a CA or self-sign your own using the documentation available on the Developer Guide.

Options Hash (opts):

  • :v_c_correlation_id (String)

    A globally unique id associated with your request

  • :v_c_sender_organization_id (String)

    Sender organization id

  • :v_c_permissions (String)

    Encoded user permissions returned by the CGK, for the entity user who initiated the boarding



535
536
537
538
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 535

def save_asym_egress_key(save_asym_egress_key, opts = {})
  data, status_code, headers = save_asym_egress_key_with_http_info(save_asym_egress_key, opts)
  return data, status_code, headers
end

#save_asym_egress_key_with_http_info(save_asym_egress_key, opts = {}) ⇒ Array<(InlineResponse20110, Fixnum, Hash)>

Message Level Encryption Store and manage certificates that will be used to preform Message Level Encryption (MLE). Each new webhook will need its own unique asymmetric certificate. You can either use a digital certificate issued/signed by a CA or self-sign your own using the documentation available on the Developer Guide.

Options Hash (opts):

  • :v_c_correlation_id (String)

    A globally unique id associated with your request

  • :v_c_sender_organization_id (String)

    Sender organization id

  • :v_c_permissions (String)

    Encoded user permissions returned by the CGK, for the entity user who initiated the boarding



548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
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
# File 'lib/cybersource_rest_client/api/manage_webhooks_api.rb', line 548

def save_asym_egress_key_with_http_info(save_asym_egress_key, opts = {})

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

  if @api_client.config.client_side_validation && save_asym_egress_key.nil?
    fail ArgumentError, "Missing the required parameter 'save_asym_egress_key' when calling ManageWebhooksApi.save_asym_egress_key"
  end
  #if @api_client.config.client_side_validation && !opts[:'v_c_correlation_id'].nil? && opts[:'v_c_correlation_id'] !~ Regexp.new(/^[A-Za-z0-9\\.\\-_:]+$/)

    #fail ArgumentError, "invalid value for 'opts[:\"v_c_correlation_id\"]' when calling ManageWebhooksApi.save_asym_egress_key, must conform to the pattern /^[A-Za-z0-9\\.\\-_:]+$/."

  #end


  #if @api_client.config.client_side_validation && !opts[:'v_c_sender_organization_id'].nil? && opts[:'v_c_sender_organization_id'] !~ Regexp.new(/^[A-Za-z0-9\\-_]+$/)

    #fail ArgumentError, "invalid value for 'opts[:\"v_c_sender_organization_id\"]' when calling ManageWebhooksApi.save_asym_egress_key, must conform to the pattern /^[A-Za-z0-9\\-_]+$/."

  #end


  # resource path

  local_var_path = 'kms/egress/v2/keys-asym'

  # query parameters

  query_params = {}

  # header parameters

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

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

  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'v-c-correlation-id'] = opts[:'v_c_correlation_id'] if !opts[:'v_c_correlation_id'].nil?
  header_params[:'v-c-sender-organization-id'] = opts[:'v_c_sender_organization_id'] if !opts[:'v_c_sender_organization_id'].nil?
  header_params[:'v-c-permissions'] = opts[:'v_c_permissions'] if !opts[:'v_c_permissions'].nil?

  # form parameters

  form_params = {}

  # http body (model)

  post_body = @api_client.object_to_http_body(save_asym_egress_key)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'SaveAsymEgressKey', @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, ["save_asym_egress_key","save_asym_egress_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, ["save_asym_egress_key","save_asym_egress_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 => 'InlineResponse20110',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: ManageWebhooksApi#save_asym_egress_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end