Class: Lithic::Resources::Transactions
- Inherits:
-
Object
- Object
- Lithic::Resources::Transactions
- Defined in:
- lib/lithic/resources/transactions.rb,
lib/lithic/resources/transactions/events.rb,
lib/lithic/resources/transactions/enhanced_commercial_data.rb,
lib/lithic/resources/transactions/events/enhanced_commercial_data.rb
Defined Under Namespace
Classes: EnhancedCommercialData, Events
Instance Attribute Summary collapse
- #enhanced_commercial_data ⇒ Lithic::Resources::Transactions::EnhancedCommercialData readonly
- #events ⇒ Lithic::Resources::Transactions::Events readonly
Instance Method Summary collapse
-
#expire_authorization(transaction_token, request_options: {}) ⇒ nil
Expire authorization.
-
#initialize(client:) ⇒ Transactions
constructor
private
A new instance of Transactions.
-
#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: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Transaction>
Some parameter documentations has been truncated, see Models::TransactionListParams for more details.
-
#retrieve(transaction_token, request_options: {}) ⇒ Lithic::Models::Transaction
Get a specific card transaction.
-
#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: {}) ⇒ Lithic::Models::TransactionSimulateAuthorizationResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateAuthorizationParams for more details.
-
#simulate_authorization_advice(token:, amount:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateAuthorizationAdviceResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateAuthorizationAdviceParams for more details.
-
#simulate_clearing(token:, amount: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateClearingResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateClearingParams for more details.
-
#simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateCreditAuthorizationAdviceParams for more details.
-
#simulate_return(amount:, descriptor:, pan:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateReturnResponse
Returns, or refunds, an amount back to a card.
-
#simulate_return_reversal(token:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateReturnReversalResponse
Reverses a return, i.e.
-
#simulate_void(token:, amount: nil, type: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateVoidResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateVoidParams for more details.
Constructor Details
#initialize(client:) ⇒ Transactions
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 Transactions.
329 330 331 332 333 |
# File 'lib/lithic/resources/transactions.rb', line 329 def initialize(client:) @client = client @enhanced_commercial_data = Lithic::Resources::Transactions::EnhancedCommercialData.new(client: client) @events = Lithic::Resources::Transactions::Events.new(client: client) end |
Instance Attribute Details
#enhanced_commercial_data ⇒ Lithic::Resources::Transactions::EnhancedCommercialData (readonly)
7 8 9 |
# File 'lib/lithic/resources/transactions.rb', line 7 def enhanced_commercial_data @enhanced_commercial_data end |
#events ⇒ Lithic::Resources::Transactions::Events (readonly)
10 11 12 |
# File 'lib/lithic/resources/transactions.rb', line 10 def events @events end |
Instance Method Details
#expire_authorization(transaction_token, request_options: {}) ⇒ nil
Expire authorization
87 88 89 90 91 92 93 94 |
# File 'lib/lithic/resources/transactions.rb', line 87 def (transaction_token, params = {}) @client.request( method: :post, path: ["v1/transactions/%1$s/expire_authorization", transaction_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, result: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Transaction>
Some parameter documentations has been truncated, see Models::TransactionListParams for more details.
List card transactions. All amounts are in the smallest unit of their respective currency (e.g., cents for USD) and inclusive of any acquirer fees.
64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/lithic/resources/transactions.rb', line 64 def list(params = {}) parsed, = 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: ) end |
#retrieve(transaction_token, request_options: {}) ⇒ Lithic::Models::Transaction
Get a specific card transaction. All amounts are in the smallest unit of their respective currency (e.g., cents for USD).
24 25 26 27 28 29 30 31 |
# File 'lib/lithic/resources/transactions.rb', line 24 def retrieve(transaction_token, params = {}) @client.request( method: :get, path: ["v1/transactions/%1$s", transaction_token], model: Lithic::Transaction, options: params[:request_options] ) end |
#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: {}) ⇒ Lithic::Models::TransactionSimulateAuthorizationResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateAuthorizationParams for more details.
Simulates an authorization request from the card network as if it came from a merchant acquirer. If you are configured for ASA, simulating authorizations requires your ASA client to be set up properly, i.e. be able to respond to the ASA request with a valid JSON. For users that are not configured for ASA, a daily transaction limit of $5000 USD is applied by default. You can update this limit via the [update account](docs.lithic.com/reference/patchaccountbytoken) endpoint.
135 136 137 138 139 140 141 142 143 144 |
# File 'lib/lithic/resources/transactions.rb', line 135 def (params) parsed, = Lithic::TransactionSimulateAuthorizationParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/authorize", body: parsed, model: Lithic::Models::TransactionSimulateAuthorizationResponse, options: ) end |
#simulate_authorization_advice(token:, amount:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateAuthorizationAdviceResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateAuthorizationAdviceParams for more details.
Simulates an authorization advice from the card network as if it came from a merchant acquirer. An authorization advice changes the pending amount of the transaction.
164 165 166 167 168 169 170 171 172 173 |
# File 'lib/lithic/resources/transactions.rb', line 164 def (params) parsed, = Lithic::TransactionSimulateAuthorizationAdviceParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/authorization_advice", body: parsed, model: Lithic::Models::TransactionSimulateAuthorizationAdviceResponse, options: ) end |
#simulate_clearing(token:, amount: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateClearingResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateClearingParams for more details.
Clears an existing authorization, either debit or credit. After this event, the transaction transitions from ‘PENDING` to `SETTLED` status.
If ‘amount` is not set, the full amount of the transaction will be cleared. Transactions that have already cleared, either partially or fully, cannot be cleared again using this endpoint.
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/lithic/resources/transactions.rb', line 196 def simulate_clearing(params) parsed, = Lithic::TransactionSimulateClearingParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/clearing", body: parsed, model: Lithic::Models::TransactionSimulateClearingResponse, options: ) end |
#simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateCreditAuthorizationAdviceParams for more details.
Simulates a credit authorization advice from the card network. This message indicates that the network approved a credit authorization on your behalf.
231 232 233 234 235 236 237 238 239 240 |
# File 'lib/lithic/resources/transactions.rb', line 231 def (params) parsed, = Lithic::TransactionSimulateCreditAuthorizationAdviceParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/credit_authorization_advice", body: parsed, model: Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse, options: ) end |
#simulate_return(amount:, descriptor:, pan:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateReturnResponse
Returns, or refunds, an amount back to a card. Returns simulated via this endpoint clear immediately, without prior authorization, and result in a ‘SETTLED` transaction status.
259 260 261 262 263 264 265 266 267 268 |
# File 'lib/lithic/resources/transactions.rb', line 259 def simulate_return(params) parsed, = Lithic::TransactionSimulateReturnParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/return", body: parsed, model: Lithic::Models::TransactionSimulateReturnResponse, options: ) end |
#simulate_return_reversal(token:, request_options: {}) ⇒ Lithic::Models::TransactionSimulateReturnReversalResponse
Reverses a return, i.e. a credit transaction with a ‘SETTLED` status. Returns can be financial credit authorizations, or credit authorizations that have cleared.
283 284 285 286 287 288 289 290 291 292 |
# File 'lib/lithic/resources/transactions.rb', line 283 def simulate_return_reversal(params) parsed, = Lithic::TransactionSimulateReturnReversalParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/return_reversal", body: parsed, model: Lithic::Models::TransactionSimulateReturnReversalResponse, options: ) end |
#simulate_void(token:, amount: nil, type: nil, request_options: {}) ⇒ Lithic::Models::TransactionSimulateVoidResponse
Some parameter documentations has been truncated, see Models::TransactionSimulateVoidParams for more details.
Voids a pending authorization. If ‘amount` is not set, the full amount will be voided. Can be used on partially voided transactions but not partially cleared transactions. _Simulating an authorization expiry on credit authorizations or credit authorization advice is not currently supported but will be added soon._
315 316 317 318 319 320 321 322 323 324 |
# File 'lib/lithic/resources/transactions.rb', line 315 def simulate_void(params) parsed, = Lithic::TransactionSimulateVoidParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/void", body: parsed, model: Lithic::Models::TransactionSimulateVoidResponse, options: ) end |