Class: CyberSource::CreateNewWebhooksApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CreateNewWebhooksApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_webhook_subscription(opts = {}) ⇒ InlineResponse2013

Create a Webhook Create a new webhook subscription. Before creating a webhook, ensure that a security key has been created at the top of this developer center section. You will not need to pass us back the key during the creation of the webhook, but you will receive an error if you did not already create a key or store one on file.

DISCLAIMER : Cybersource may allow Customer to access, use, and/or test a Cybersource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. Cybersource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR © FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



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

def create_webhook_subscription(opts = {})
  data, status_code, headers = create_webhook_subscription_with_http_info(opts)
  return data, status_code, headers
end

#create_webhook_subscription_with_http_info(opts = {}) ⇒ Array<(InlineResponse2013, Fixnum, Hash)>

Create a Webhook Create a new webhook subscription. Before creating a webhook, ensure that a security key has been created at the top of this developer center section. You will not need to pass us back the key during the creation of the webhook, but you will receive an error if you did not already create a key or store one on file.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:

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

    InlineResponse2013 data, response status code and response headers



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

def create_webhook_subscription_with_http_info(opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: CreateNewWebhooksApi.create_webhook_subscription ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # resource path
  local_var_path = 'notification-subscriptions/v1/webhooks'

  # 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[:'create_webhook_request'])
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'CreateWebhookRequest', @api_client.config.host)
  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 => 'InlineResponse2013')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: CreateNewWebhooksApi#create_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

#find_products_to_subscribe(organization_id, opts = {}) ⇒ Array<InlineResponse2003>

Find Products You Can Subscribe To Retrieve a list of products and event types that your account is eligible for. These products and events are the ones that you may subscribe to in the next step of creating webhooks.

DISCLAIMER : Cybersource may allow Customer to access, use, and/or test a Cybersource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. Cybersource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR © FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.

Parameters:

  • organization_id

    The Organization Identifier.

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

    the optional parameters

Returns:



96
97
98
99
# File 'lib/cybersource_rest_client/api/create_new_webhooks_api.rb', line 96

def find_products_to_subscribe(organization_id, opts = {})
  data, status_code, headers = find_products_to_subscribe_with_http_info(organization_id, opts)
  return data, status_code, headers
end

#find_products_to_subscribe_with_http_info(organization_id, opts = {}) ⇒ Array<(Array<InlineResponse2003>, Fixnum, Hash)>

Find Products You Can Subscribe To Retrieve a list of products and event types that your account is eligible for. These products and events are the ones that you may subscribe to in the next step of creating webhooks.

Parameters:

  • organization_id

    The Organization Identifier.

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

    the optional parameters

Returns:

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

    Array<InlineResponse2003> data, response status code and response headers



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/cybersource_rest_client/api/create_new_webhooks_api.rb', line 106

def find_products_to_subscribe_with_http_info(organization_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: CreateNewWebhooksApi.find_products_to_subscribe ...'
        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 CreateNewWebhooksApi.find_products_to_subscribe"
  end
  # resource path
  local_var_path = 'notification-subscriptions/v1/products/{organizationId}'.sub('{' + 'organizationId' + '}', organization_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<InlineResponse2003>')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: CreateNewWebhooksApi#find_products_to_subscribe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#save_sym_egress_key(v_c_sender_organization_id, v_c_permissions, opts = {}) ⇒ InlineResponse2012

Create Webhook Security Keys Create security keys that CyberSource will use internally to connect to your servers and validate messages using a digital signature. Select the CREATE example for CyberSource to generate the key on our server and maintain it for you as well. Remeber to save the key in the API response, so that you can use it to validate messages later.

DISCLAIMER : Cybersource may allow Customer to access, use, and/or test a Cybersource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. Cybersource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR © FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS.

Parameters:

  • v_c_sender_organization_id

    Sender organization id

  • v_c_permissions

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

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

    the optional parameters

Options Hash (opts):

  • :v_c_correlation_id (String)

    A globally unique id associated with your request

  • :save_sym_egress_key (SaveSymEgressKey)

    Provide egress Symmetric key information to save (create or store or refresh)

Returns:



171
172
173
174
# File 'lib/cybersource_rest_client/api/create_new_webhooks_api.rb', line 171

def save_sym_egress_key(v_c_sender_organization_id, v_c_permissions, opts = {})
  data, status_code, headers = save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissions, opts)
  return data, status_code, headers
end

#save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissions, opts = {}) ⇒ Array<(InlineResponse2012, Fixnum, Hash)>

Create Webhook Security Keys Create security keys that CyberSource will use internally to connect to your servers and validate messages using a digital signature. Select the CREATE example for CyberSource to generate the key on our server and maintain it for you as well. Remeber to save the key in the API response, so that you can use it to validate messages later.

Parameters:

  • v_c_sender_organization_id

    Sender organization id

  • v_c_permissions

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

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

    the optional parameters

Options Hash (opts):

  • :v_c_correlation_id (String)

    A globally unique id associated with your request

  • :save_sym_egress_key (SaveSymEgressKey)

    Provide egress Symmetric key information to save (create or store or refresh)

Returns:

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

    InlineResponse2012 data, response status code and response headers



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/cybersource_rest_client/api/create_new_webhooks_api.rb', line 184

def save_sym_egress_key_with_http_info(v_c_sender_organization_id, v_c_permissions, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: CreateNewWebhooksApi.save_sym_egress_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'v_c_sender_organization_id' is set
  if @api_client.config.client_side_validation && v_c_sender_organization_id.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_sender_organization_id' when calling CreateNewWebhooksApi.save_sym_egress_key"
  end
  #if @api_client.config.client_side_validation && v_c_sender_organization_id !~ Regexp.new(/^[A-Za-z0-9\\-_]+$/)
    #fail ArgumentError, "invalid value for 'v_c_sender_organization_id' when calling CreateNewWebhooksApi.save_sym_egress_key, must conform to the pattern /^[A-Za-z0-9\\-_]+$/."
  #end

  # verify the required parameter 'v_c_permissions' is set
  if @api_client.config.client_side_validation && v_c_permissions.nil?
    fail ArgumentError, "Missing the required parameter 'v_c_permissions' when calling CreateNewWebhooksApi.save_sym_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 CreateNewWebhooksApi.save_sym_egress_key, must conform to the pattern /^[A-Za-z0-9\\.\\-_:]+$/."
  #end

  # resource path
  local_var_path = 'kms/egress/v2/keys-sym'

  # 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-sender-organization-id'] = v_c_sender_organization_id
  header_params[:'v-c-permissions'] = v_c_permissions
  header_params[:'v-c-correlation-id'] = opts[:'v_c_correlation_id'] if !opts[:'v_c_correlation_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'save_sym_egress_key'])
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'SaveSymEgressKey', @api_client.config.host)
  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 => 'InlineResponse2012')
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: CreateNewWebhooksApi#save_sym_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