class Lithic::Resources::Transactions

def expire_authorization(transaction_token, params = {})

Other tags:
    See: Lithic::Models::TransactionExpireAuthorizationParams -

Returns:
  • (nil) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • transaction_token (String) -- The token of the transaction to expire.

Overloads:
  • expire_authorization(transaction_token, request_options: {})
def expire_authorization(transaction_token, params = {})
  @client.request(
    method: :post,
    path: ["v1/transactions/%1$s/expire_authorization", transaction_token],
    model: NilClass,
    options: params[:request_options]
  )
end

def initialize(client:)

Parameters:
  • client (Lithic::Client) --

Other tags:
    Api: - private
def initialize(client:)
  @client = client
  @enhanced_commercial_data = Lithic::Resources::Transactions::EnhancedCommercialData.new(client: client)
  @events = Lithic::Resources::Transactions::Events.new(client: client)
end

def list(params = {})

Other tags:
    See: Lithic::Models::TransactionListParams -

Returns:
  • (Lithic::Internal::CursorPage) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • status (Symbol, Lithic::TransactionListParams::Status) -- Filters for transactions using transaction status field.
  • starting_after (String) -- A cursor representing an item's token after which a page of results should begin
  • result (Symbol, Lithic::TransactionListParams::Result) -- Filters for transactions using transaction result field. Can filter by `APPROVED
  • page_size (Integer) -- Page size (for pagination).
  • ending_before (String) -- A cursor representing an item's token before which a page of results should end.
  • end_ (Time) -- Date string in RFC 3339 format. Only entries created before the specified time w
  • card_token (String) -- Filters for transactions associated with a specific card.
  • begin_ (Time) -- Date string in RFC 3339 format. Only entries created after the specified time wi
  • account_token (String) -- Filters for transactions associated with a specific account.

Overloads:
  • list(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {})
def list(params = {})
  parsed, options = Lithic::TransactionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/transactions",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::Transaction,
    options: options
  )
end

def retrieve(transaction_token, params = {})

Other tags:
    See: Lithic::Models::TransactionRetrieveParams -

Returns:
  • (Lithic::Transaction) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • transaction_token (String) -- Globally unique identifier for the transaction.

Overloads:
  • retrieve(transaction_token, request_options: {})
def retrieve(transaction_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/transactions/%1$s", transaction_token],
    model: Lithic::Transaction,
    options: params[:request_options]
  )
end

def simulate_authorization(params)

Other tags:
    See: Lithic::Models::TransactionSimulateAuthorizationParams -

Returns:
  • (Lithic::Models::TransactionSimulateAuthorizationResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • status (Symbol, Lithic::TransactionSimulateAuthorizationParams::Status) -- Type of event to simulate.
  • pin (String) -- Simulate entering a PIN. If omitted, PIN check will not be performed.
  • partial_approval_capable (Boolean) -- Set to true if the terminal is capable of partial approval otherwise false.
  • merchant_currency (String) -- 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD,
  • merchant_amount (Integer) -- Amount of the transaction to be simulated in currency specified in merchant_curr
  • merchant_acceptor_id (String) -- Unique identifier to identify the payment card acceptor.
  • mcc (String) -- Merchant category code for the transaction to be simulated. A four-digit number
  • pan (String) -- Sixteen digit card number.
  • descriptor (String) -- Merchant descriptor.
  • amount (Integer) -- Amount (in cents) to authorize. For credit authorizations and financial credit a

Overloads:
  • simulate_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, merchant_amount: nil, merchant_currency: nil, partial_approval_capable: nil, pin: nil, status: nil, request_options: {})
def simulate_authorization(params)
  parsed, options = Lithic::TransactionSimulateAuthorizationParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/authorize",
    body: parsed,
    model: Lithic::Models::TransactionSimulateAuthorizationResponse,
    options: options
  )
end

def simulate_authorization_advice(params)

Other tags:
    See: Lithic::Models::TransactionSimulateAuthorizationAdviceParams -

Returns:
  • (Lithic::Models::TransactionSimulateAuthorizationAdviceResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • amount (Integer) -- Amount (in cents) to authorize. This amount will override the transaction's amou
  • token (String) -- The transaction token returned from the /v1/simulate/authorize. response.

Overloads:
  • simulate_authorization_advice(token:, amount:, request_options: {})
def simulate_authorization_advice(params)
  parsed, options = Lithic::TransactionSimulateAuthorizationAdviceParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/authorization_advice",
    body: parsed,
    model: Lithic::Models::TransactionSimulateAuthorizationAdviceResponse,
    options: options
  )
end

def simulate_clearing(params)

Other tags:
    See: Lithic::Models::TransactionSimulateClearingParams -

Returns:
  • (Lithic::Models::TransactionSimulateClearingResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • amount (Integer) -- Amount (in cents) to clear. Typically this will match the amount in the original
  • token (String) -- The transaction token returned from the /v1/simulate/authorize response.

Overloads:
  • simulate_clearing(token:, amount: nil, request_options: {})
def simulate_clearing(params)
  parsed, options = Lithic::TransactionSimulateClearingParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/clearing",
    body: parsed,
    model: Lithic::Models::TransactionSimulateClearingResponse,
    options: options
  )
end

def simulate_credit_authorization(params)

Other tags:
    See: Lithic::Models::TransactionSimulateCreditAuthorizationParams -

Returns:
  • (Lithic::Models::TransactionSimulateCreditAuthorizationResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • merchant_acceptor_id (String) -- Unique identifier to identify the payment card acceptor.
  • mcc (String) -- Merchant category code for the transaction to be simulated. A four-digit number
  • pan (String) -- Sixteen digit card number.
  • descriptor (String) -- Merchant descriptor.
  • amount (Integer) -- Amount (in cents). Any value entered will be converted into a negative amount in

Overloads:
  • simulate_credit_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
def simulate_credit_authorization(params)
  parsed, options = Lithic::TransactionSimulateCreditAuthorizationParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/credit_authorization_advice",
    body: parsed,
    model: Lithic::Models::TransactionSimulateCreditAuthorizationResponse,
    options: options
  )
end

def simulate_return(params)

Other tags:
    See: Lithic::Models::TransactionSimulateReturnParams -

Returns:
  • (Lithic::Models::TransactionSimulateReturnResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • pan (String) -- Sixteen digit card number.
  • descriptor (String) -- Merchant descriptor.
  • amount (Integer) -- Amount (in cents) to authorize.

Overloads:
  • simulate_return(amount:, descriptor:, pan:, request_options: {})
def simulate_return(params)
  parsed, options = Lithic::TransactionSimulateReturnParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/return",
    body: parsed,
    model: Lithic::Models::TransactionSimulateReturnResponse,
    options: options
  )
end

def simulate_return_reversal(params)

Other tags:
    See: Lithic::Models::TransactionSimulateReturnReversalParams -

Returns:
  • (Lithic::Models::TransactionSimulateReturnReversalResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • token (String) -- The transaction token returned from the /v1/simulate/authorize response.

Overloads:
  • simulate_return_reversal(token:, request_options: {})
def simulate_return_reversal(params)
  parsed, options = Lithic::TransactionSimulateReturnReversalParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/return_reversal",
    body: parsed,
    model: Lithic::Models::TransactionSimulateReturnReversalResponse,
    options: options
  )
end

def simulate_void(params)

Other tags:
    See: Lithic::Models::TransactionSimulateVoidParams -

Returns:
  • (Lithic::Models::TransactionSimulateVoidResponse) -

Parameters:
  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil) --
  • type (Symbol, Lithic::TransactionSimulateVoidParams::Type) -- Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`.
  • amount (Integer) -- Amount (in cents) to void. Typically this will match the amount in the original
  • token (String) -- The transaction token returned from the /v1/simulate/authorize response.

Overloads:
  • simulate_void(token:, amount: nil, type: nil, request_options: {})
def simulate_void(params)
  parsed, options = Lithic::TransactionSimulateVoidParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/void",
    body: parsed,
    model: Lithic::Models::TransactionSimulateVoidResponse,
    options: options
  )
end