Class: Lithic::Resources::Tokenizations

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/tokenizations.rb,
sig/lithic/resources/tokenizations.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Tokenizations

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Tokenizations.

Parameters:



288
289
290
# File 'lib/lithic/resources/tokenizations.rb', line 288

def initialize(client:)
  @client = client
end

Instance Method Details

#activate(tokenization_token, request_options: {}) ⇒ nil

This endpoint is used to ask the card network to activate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network activates the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on digital wallet tokenizations with status INACTIVE, PENDING_ACTIVATION, or PENDING_2FA. This will put the tokenization in an active state, and transactions will be allowed. Reach out at lithic.com/contact for more information.

Parameters:

  • tokenization_token (String)

    Tokenization token

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



85
86
87
88
89
90
91
92
# File 'lib/lithic/resources/tokenizations.rb', line 85

def activate(tokenization_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/activate", tokenization_token],
    model: NilClass,
    options: params[:request_options]
  )
end

#deactivate(tokenization_token, request_options: {}) ⇒ nil

This endpoint is used to ask the card network to deactivate a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network deactivates the tokenization, the state will be updated and a tokenization.updated event will be sent. Authorizations attempted with a deactivated tokenization will be blocked and will not be forwarded to Lithic from the network. Deactivating the token is a permanent operation. If the target is a digital wallet tokenization, it will be removed from its device. Reach out at lithic.com/contact for more information.

Parameters:

  • tokenization_token (String)

    Tokenization token

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



113
114
115
116
117
118
119
120
# File 'lib/lithic/resources/tokenizations.rb', line 113

def deactivate(tokenization_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/deactivate", tokenization_token],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, tokenization_channel: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Tokenization>

Some parameter documentations has been truncated, see Models::TokenizationListParams for more details.

List card tokenizations

Parameters:

  • account_token (String)

    Filters for tokenizations associated with a specific account.

  • begin_ (Date)

    Filter for tokenizations created after this date.

  • card_token (String)

    Filters for tokenizations associated with a specific card.

  • end_ (Date)

    Filter for tokenizations created before this date.

  • ending_before (String)

    A cursor representing an item's token before which a page of results should end.

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item's token after which a page of results should begin

  • tokenization_channel (Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel)

    Filter for tokenizations by tokenization channel. If this is not specified, only

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/lithic/resources/tokenizations.rb', line 54

def list(params = {})
  parsed, options = Lithic::TokenizationListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/tokenizations",
    query: query.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::Tokenization,
    options: options
  )
end

#pause(tokenization_token, request_options: {}) ⇒ nil

This endpoint is used to ask the card network to pause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network pauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status ACTIVE. A paused token will prevent merchants from sending authorizations, and is a temporary status that can be changed. Reach out at lithic.com/contact for more information.

Parameters:

  • tokenization_token (String)

    Tokenization token

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



140
141
142
143
144
145
146
147
# File 'lib/lithic/resources/tokenizations.rb', line 140

def pause(tokenization_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/pause", tokenization_token],
    model: NilClass,
    options: params[:request_options]
  )
end

#resend_activation_code(tokenization_token, activation_method_type: nil, request_options: {}) ⇒ nil

Some parameter documentations has been truncated, see Models::TokenizationResendActivationCodeParams for more details.

This endpoint is used to ask the card network to send another activation code to a cardholder that has already tried tokenizing a card. A successful response indicates that the request was successfully delivered to the card network. The endpoint may only be used on Mastercard digital wallet tokenizations with status INACTIVE, PENDING_ACTIVATION, or PENDING_2FA. The network will send a new activation code to the one of the contact methods provided in the initial tokenization flow. If a user fails to enter the code correctly 3 times, the contact method will not be eligible for resending the activation code, and the cardholder must restart the provision process. Reach out at lithic.com/contact for more information.

Parameters:

Returns:

  • (nil)

See Also:



174
175
176
177
178
179
180
181
182
183
# File 'lib/lithic/resources/tokenizations.rb', line 174

def resend_activation_code(tokenization_token, params = {})
  parsed, options = Lithic::TokenizationResendActivationCodeParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/resend_activation_code", tokenization_token],
    body: parsed,
    model: NilClass,
    options: options
  )
end

#retrieve(tokenization_token, request_options: {}) ⇒ Lithic::Models::Tokenization

Get tokenization

Parameters:

  • tokenization_token (String)

    Tokenization token

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/lithic/resources/tokenizations.rb', line 17

def retrieve(tokenization_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/tokenizations/%1$s", tokenization_token],
    model: Lithic::Tokenization,
    options: params[:request_options]
  )
end

#simulate(cvv:, expiration_date:, pan:, tokenization_source:, account_score: nil, device_score: nil, entity: nil, wallet_recommended_decision: nil, request_options: {}) ⇒ Lithic::Models::Tokenization

Some parameter documentations has been truncated, see Models::TokenizationSimulateParams for more details.

This endpoint is used to simulate a card's tokenization in the Digital Wallet and merchant tokenization ecosystem.

Parameters:

  • cvv (String)

    The three digit cvv for the card.

  • expiration_date (String)

    The expiration date of the card in 'MM/YY' format.

  • pan (String)

    The sixteen digit card number.

  • tokenization_source (Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource)

    The source of the tokenization request.

  • account_score (Integer)

    The account score (1-5) that represents how the Digital Wallet's view on how rep

  • device_score (Integer)

    The device score (1-5) that represents how the Digital Wallet's view on how repu

  • entity (String)

    Optional field to specify the token requestor name for a merchant token simulati

  • wallet_recommended_decision (Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision)

    The decision that the Digital Wallet's recommend

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



214
215
216
217
218
219
220
221
222
223
# File 'lib/lithic/resources/tokenizations.rb', line 214

def simulate(params)
  parsed, options = Lithic::TokenizationSimulateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/tokenizations",
    body: parsed,
    model: Lithic::Tokenization,
    options: options
  )
end

#unpause(tokenization_token, request_options: {}) ⇒ nil

This endpoint is used to ask the card network to unpause a tokenization. A successful response indicates that the request was successfully delivered to the card network. When the card network unpauses the tokenization, the state will be updated and a tokenization.updated event will be sent. The endpoint may only be used on tokenizations with status PAUSED. This will put the tokenization in an active state, and transactions may resume. Reach out at lithic.com/contact for more information.

Parameters:

  • tokenization_token (String)

    Tokenization token

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



242
243
244
245
246
247
248
249
# File 'lib/lithic/resources/tokenizations.rb', line 242

def unpause(tokenization_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/unpause", tokenization_token],
    model: NilClass,
    options: params[:request_options]
  )
end

#update_digital_card_art(tokenization_token, digital_card_art_token: nil, request_options: {}) ⇒ Lithic::Models::Tokenization

Some parameter documentations has been truncated, see Models::TokenizationUpdateDigitalCardArtParams for more details.

This endpoint is used update the digital card art for a digital wallet tokenization. A successful response indicates that the card network has updated the tokenization's art, and the tokenization's digital_cart_art_token field was updated. The endpoint may not be used on tokenizations with status DEACTIVATED. Note that this updates the art for one specific tokenization, not all tokenizations for a card. New tokenizations for a card will be created with the art referenced in the card object's digital_card_art_token field. Reach out at lithic.com/contact for more information.

Parameters:

  • tokenization_token (String)

    Tokenization token

  • digital_card_art_token (String)

    Specifies the digital card art to be displayed in the user’s digital wallet for

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



274
275
276
277
278
279
280
281
282
283
# File 'lib/lithic/resources/tokenizations.rb', line 274

def update_digital_card_art(tokenization_token, params = {})
  parsed, options = Lithic::TokenizationUpdateDigitalCardArtParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/tokenizations/%1$s/update_digital_card_art", tokenization_token],
    body: parsed,
    model: Lithic::Tokenization,
    options: options
  )
end