Class: CyberSource::TokenApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TokenApi.



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

def api_client
  @api_client
end

Instance Method Details

#get_card_art_asset(instrument_identifier_id, token_provider, asset_type, opts = {}) ⇒ InlineResponse2002

Retrieve Card Art Retrieves Card Art for a specific Instrument Identifier. The Card Art is a visual representation of the cardholder’s payment card. Card Art is only available if a Network Token is successfully provisioned.

Parameters:

  • instrument_identifier_id

    The Id of an Instrument Identifier.

  • token_provider

    The token provider.

  • asset_type

    The type of asset.

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

    the optional parameters

Returns:



31
32
33
34
# File 'lib/cybersource_rest_client/api/token_api.rb', line 31

def get_card_art_asset(instrument_identifier_id, token_provider, asset_type, opts = {})
  data, status_code, headers = get_card_art_asset_with_http_info(instrument_identifier_id, token_provider, asset_type, opts)
  return data, status_code, headers
end

#get_card_art_asset_with_http_info(instrument_identifier_id, token_provider, asset_type, opts = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>

Retrieve Card Art Retrieves Card Art for a specific Instrument Identifier. The Card Art is a visual representation of the cardholder&#39;s payment card. Card Art is only available if a Network Token is successfully provisioned.

Parameters:

  • instrument_identifier_id

    The Id of an Instrument Identifier.

  • token_provider

    The token provider.

  • asset_type

    The type of asset.

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

    the optional parameters

Returns:

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

    InlineResponse2002 data, response status code and response headers



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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/cybersource_rest_client/api/token_api.rb', line 43

def get_card_art_asset_with_http_info(instrument_identifier_id, token_provider, asset_type, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: TokenApi.get_card_art_asset ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'instrument_identifier_id' is set
  if @api_client.config.client_side_validation && instrument_identifier_id.nil?
    fail ArgumentError, "Missing the required parameter 'instrument_identifier_id' when calling TokenApi.get_card_art_asset"
  end
  # verify the required parameter 'token_provider' is set
  if @api_client.config.client_side_validation && token_provider.nil?
    fail ArgumentError, "Missing the required parameter 'token_provider' when calling TokenApi.get_card_art_asset"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['vts', 'mdes', 'amex', 'mscof'].include?(token_provider)
    fail ArgumentError, "invalid value for 'token_provider', must be one of vts, mdes, amex, mscof"
  end
  # verify the required parameter 'asset_type' is set
  if @api_client.config.client_side_validation && asset_type.nil?
    fail ArgumentError, "Missing the required parameter 'asset_type' when calling TokenApi.get_card_art_asset"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['card-art-combined', 'brand-logo', 'issuer-logo', 'icon-logo'].include?(asset_type)
    fail ArgumentError, "invalid value for 'asset_type', must be one of card-art-combined, brand-logo, issuer-logo, icon-logo"
  end
  # resource path
  local_var_path = 'tms/v2/tokens/{instrumentIdentifierId}/{tokenProvider}/assets/{assetType}'.sub('{' + 'instrumentIdentifierId' + '}', instrument_identifier_id.to_s).sub('{' + 'tokenProvider' + '}', token_provider.to_s).sub('{' + 'assetType' + '}', asset_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;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_card_art_asset","get_card_art_asset_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_card_art_asset","get_card_art_asset_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 => 'InlineResponse2002',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: TokenApi#get_card_art_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#post_token_payment_credentials(token_id, post_payment_credentials_request, opts = {}) ⇒ String

Generate Payment Credentials v2 Note: This resource will be replace by [payment credentials version 3](#/paths/~1tms~1v3~1tokens~1tokenId~1payment-credentials/post). The SDK will remain available for now; however, it will no longer be documented or maintain in the Developer Centre.
Token
A Token can represent your tokenized Customer, Payment Instrument, Instrument Identifier or Tokenized Card information.
**Payment Credentials**
Contains payment information such as the network token, generated cryptogram for Visa & MasterCard or dynamic CVV for Amex in a JSON Web Encryption (JWE) response.
Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.
Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful.

Parameters:

  • token_id

    The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.

  • post_payment_credentials_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:

  • (String)


134
135
136
137
# File 'lib/cybersource_rest_client/api/token_api.rb', line 134

def post_token_payment_credentials(token_id, post_payment_credentials_request, opts = {})
  data, status_code, headers = post_token_payment_credentials_with_http_info(token_id, post_payment_credentials_request, opts)
  return data, status_code, headers
end

#post_token_payment_credentials_v3(token_id, post_payment_credentials_request, opts = {}) ⇒ InlineResponse2011

Generate Payment Credentials Latest Version v3 **Payment Credentials**
Contains payment information such as the network token, generated TAVV cryptogram for Visa & MasterCard, dynamic CVV for Amex, or DTVV cryptogram for VISA. This latest version (v3) returns the Primary Account Number details, if the network token is not present. The response is provided in JSON Web Encryption (JWE) format.
Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.
Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful.

Parameters:

  • token_id

    The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.

  • post_payment_credentials_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:



224
225
226
227
# File 'lib/cybersource_rest_client/api/token_api.rb', line 224

def post_token_payment_credentials_v3(token_id, post_payment_credentials_request, opts = {})
  data, status_code, headers = post_token_payment_credentials_v3_with_http_info(token_id, post_payment_credentials_request, opts)
  return data, status_code, headers
end

#post_token_payment_credentials_v3_with_http_info(token_id, post_payment_credentials_request, opts = {}) ⇒ Array<(InlineResponse2011, Fixnum, Hash)>

Generate Payment Credentials Latest Version v3 **Payment Credentials**&lt;br&gt;Contains payment information such as the network token, generated TAVV cryptogram for Visa &amp; MasterCard, dynamic CVV for Amex, or DTVV cryptogram for VISA. This latest version (v3) returns the Primary Account Number details, if the network token is not present. The response is provided in JSON Web Encryption (JWE) format. &lt;br&gt;Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.&lt;br&gt;Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful.

Parameters:

  • token_id

    The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.

  • post_payment_credentials_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<(InlineResponse2011, Fixnum, Hash)>)

    InlineResponse2011 data, response status code and response headers



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
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/cybersource_rest_client/api/token_api.rb', line 236

def post_token_payment_credentials_v3_with_http_info(token_id, post_payment_credentials_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: TokenApi.post_token_payment_credentials_v3 ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokenApi.post_token_payment_credentials_v3"
  end
  # verify the required parameter 'post_payment_credentials_request' is set
  if @api_client.config.client_side_validation && post_payment_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_payment_credentials_request' when calling TokenApi.post_token_payment_credentials_v3"
  end
  # resource path
  local_var_path = 'tms/v3/tokens/{tokenId}/payment-credentials'.sub('{' + 'tokenId' + '}', token_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/jose;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(post_payment_credentials_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostPaymentCredentialsRequest', @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_token_payment_credentials_v3","post_token_payment_credentials_v3_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_token_payment_credentials_v3","post_token_payment_credentials_v3_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 => 'InlineResponse2011',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: TokenApi#post_token_payment_credentials_v3\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#post_token_payment_credentials_with_http_info(token_id, post_payment_credentials_request, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Generate Payment Credentials v2 Note: This resource will be replace by [payment credentials version 3](#/paths/~1tms~1v3~1tokens~1tokenId~1payment-credentials/post). The SDK will remain available for now; however, it will no longer be documented or maintain in the Developer Centre.&lt;br&gt; Token&lt;br&gt;A Token can represent your tokenized Customer, Payment Instrument, Instrument Identifier or Tokenized Card information.&lt;br&gt; **Payment Credentials**&lt;br&gt;Contains payment information such as the network token, generated cryptogram for Visa &amp; MasterCard or dynamic CVV for Amex in a JSON Web Encryption (JWE) response.&lt;br&gt;Your system can use this API to retrieve the Payment Credentials for an existing Customer, Payment Instrument, Instrument Identifier or Tokenized Card.&lt;br&gt;Optionally, **authenticated identities** information from Passkey authentication can be provided to potentially achieve liability shift, which may result in the return of an e-commerce indicator of 5 if successful.

Parameters:

  • token_id

    The Id of a token representing a Customer, Payment Instrument or Instrument Identifier.

  • post_payment_credentials_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<(String, Fixnum, Hash)>)

    String data, response status code and response headers



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
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/cybersource_rest_client/api/token_api.rb', line 146

def post_token_payment_credentials_with_http_info(token_id, post_payment_credentials_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: TokenApi.post_token_payment_credentials ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokenApi.post_token_payment_credentials"
  end
  # verify the required parameter 'post_payment_credentials_request' is set
  if @api_client.config.client_side_validation && post_payment_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'post_payment_credentials_request' when calling TokenApi.post_token_payment_credentials"
  end
  # resource path
  local_var_path = 'tms/v2/tokens/{tokenId}/payment-credentials'.sub('{' + 'tokenId' + '}', token_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/jose;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(post_payment_credentials_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'PostPaymentCredentialsRequest1', @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_token_payment_credentials","post_token_payment_credentials_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_token_payment_credentials","post_token_payment_credentials_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 => 'String',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: TokenApi#post_token_payment_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end