Class: CyberSource::TokenizedCardApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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



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

def api_client
  @api_client
end

Instance Method Details

#delete_tokenized_card(tokenized_card_id, opts = {}) ⇒ nil

Delete a Tokenized Card | | | | | — | — | — | | The Network Token will attempt to be deleted from the card association and if successful the corresponding TMS Network Token will be deleted.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



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

def delete_tokenized_card(tokenized_card_id, opts = {})
  data, status_code, headers = delete_tokenized_card_with_http_info(tokenized_card_id, opts)
  return data, status_code, headers
end

#delete_tokenized_card_with_http_info(tokenized_card_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete a Tokenized Card | | | | | — | — | — | | The Network Token will attempt to be deleted from the card association and if successful the corresponding TMS Network Token will be deleted.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



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

def delete_tokenized_card_with_http_info(tokenized_card_id, opts = {})

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

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

  local_var_path = 'tms/v2/tokenized-cards/{tokenizedCardId}'.sub('{' + 'tokenizedCardId' + '}', tokenized_card_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'])
  header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?

  # 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_tokenized_card","delete_tokenized_card_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_tokenized_card","delete_tokenized_card_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: TokenizedCardApi#delete_tokenized_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_tokenized_card(tokenized_card_id, opts = {}) ⇒ TokenizedcardRequest

Retrieve a Tokenized Card | | | | | — | — | — | |**Tokenized Cards**
A Tokenized Card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



115
116
117
118
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 115

def get_tokenized_card(tokenized_card_id, opts = {})
  data, status_code, headers = get_tokenized_card_with_http_info(tokenized_card_id, opts)
  return data, status_code, headers
end

#get_tokenized_card_with_http_info(tokenized_card_id, opts = {}) ⇒ Array<(TokenizedcardRequest, Fixnum, Hash)>

Retrieve a Tokenized Card | | | | | — | — | — | |**Tokenized Cards**&lt;br&gt;A Tokenized Card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



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
187
188
189
190
191
192
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 126

def get_tokenized_card_with_http_info(tokenized_card_id, opts = {})

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

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

  local_var_path = 'tms/v2/tokenized-cards/{tokenizedCardId}'.sub('{' + 'tokenizedCardId' + '}', tokenized_card_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'])
  header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?

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

#post_issuer_life_cycle_simulation(profile_id, tokenized_card_id, post_issuer_life_cycle_simulation_request, opts = {}) ⇒ nil

Simulate Issuer Life Cycle Management Events **Lifecycle Management Events**
Simulates an issuer life cycle manegement event for updates on the tokenized card. The events that can be simulated are: - Token status changes (e.g. active, suspended, deleted) - Updates to the underlying card, including card art changes, expiration date changes, and card number suffix. Note: This is only available in CAS environment.



202
203
204
205
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 202

def post_issuer_life_cycle_simulation(profile_id, tokenized_card_id, post_issuer_life_cycle_simulation_request, opts = {})
  data, status_code, headers = post_issuer_life_cycle_simulation_with_http_info(profile_id, tokenized_card_id, post_issuer_life_cycle_simulation_request, opts)
  return data, status_code, headers
end

#post_issuer_life_cycle_simulation_with_http_info(profile_id, tokenized_card_id, post_issuer_life_cycle_simulation_request, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Simulate Issuer Life Cycle Management Events **Lifecycle Management Events**&lt;br&gt;Simulates an issuer life cycle manegement event for updates on the tokenized card. The events that can be simulated are: - Token status changes (e.g. active, suspended, deleted) - Updates to the underlying card, including card art changes, expiration date changes, and card number suffix. Note: This is only available in CAS environment.



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
277
278
279
280
281
282
283
284
285
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 214

def post_issuer_life_cycle_simulation_with_http_info(profile_id, tokenized_card_id, post_issuer_life_cycle_simulation_request, opts = {})

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

  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling TokenizedCardApi.post_issuer_life_cycle_simulation"
  end
  # verify the required parameter 'tokenized_card_id' is set

  if @api_client.config.client_side_validation && tokenized_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'tokenized_card_id' when calling TokenizedCardApi.post_issuer_life_cycle_simulation"
  end
  # verify the required parameter 'post_issuer_life_cycle_simulation_request' is set

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

  local_var_path = 'tms/v2/tokenized-cards/{tokenizedCardId}/issuer-life-cycle-event-simulations'.sub('{' + 'tokenizedCardId' + '}', tokenized_card_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'])
  header_params[:'profile-id'] = profile_id

  # form parameters

  form_params = {}

  # http body (model)

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

#post_tokenized_card(tokenizedcard_request, opts = {}) ⇒ TokenizedcardRequest

Create a Tokenized Card | | | | | — | — | — | |**Tokenized cards**
A Tokenized card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



294
295
296
297
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 294

def post_tokenized_card(tokenizedcard_request, opts = {})
  data, status_code, headers = post_tokenized_card_with_http_info(tokenizedcard_request, opts)
  return data, status_code, headers
end

#post_tokenized_card_with_http_info(tokenizedcard_request, opts = {}) ⇒ Array<(TokenizedcardRequest, Fixnum, Hash)>

Create a Tokenized Card | | | | | — | — | — | |**Tokenized cards**&lt;br&gt;A Tokenized card represents a network token. Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.



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
360
361
362
363
364
365
366
367
368
369
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 305

def post_tokenized_card_with_http_info(tokenizedcard_request, opts = {})

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

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

  local_var_path = 'tms/v2/tokenized-cards'

  # 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[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?

  # form parameters

  form_params = {}

  # http body (model)

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