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

Returns a new instance of 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.

Parameters:

  • tokenized_card_id

    The Id of a tokenized card.

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:

  • (nil)


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.

Parameters:

  • tokenized_card_id

    The Id of a tokenized card.

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:

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

    nil, response status code and response headers



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
# 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"])
    post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
  end
  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)
  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.

Parameters:

  • tokenized_card_id

    The Id of a tokenized card.

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:



107
108
109
110
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 107

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.

Parameters:

  • tokenized_card_id

    The Id of a tokenized card.

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:

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

    TokenizedcardRequest data, response status code and response headers



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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 118

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"])
    post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
  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 => 'TokenizedcardRequest')
  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_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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:



185
186
187
188
# File 'lib/cybersource_rest_client/api/tokenized_card_api.rb', line 185

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.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :profile_id (String)

    The Id of a profile containing user specific TMS configuration.

Returns:

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

    TokenizedcardRequest data, response status code and response headers



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

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 = "false"      
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["post_tokenized_card","post_tokenized_card_with_http_info"])
    post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
  end
  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')
  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