Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.42"
".": "0.1.0-alpha.43"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 169
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1d44bb7fad99487af1161eb24dfd5369440eda7e80ed237cbc1acc6802a7d212.yml
openapi_spec_hash: 1b6b6215b60094b76b91c56b925a251a
config_hash: ac676e77c8ca051c7aad978c26e96345
config_hash: e68a052fd109c0885732114753abc739
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.43 (2025-09-11)

Full Changelog: [v0.1.0-alpha.42...v0.1.0-alpha.43](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.42...v0.1.0-alpha.43)

### Features

* **api:** manual updates ([bde90fd](https://github.com/lithic-com/lithic-ruby/commit/bde90fdad11812628ad656e2a32c40d06184cbaf))

## 0.1.0-alpha.42 (2025-09-09)

Full Changelog: [v0.1.0-alpha.41...v0.1.0-alpha.42](https://github.com/lithic-com/lithic-ruby/compare/v0.1.0-alpha.41...v0.1.0-alpha.42)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
lithic (0.1.0.pre.alpha.42)
lithic (0.1.0.pre.alpha.43)
connection_pool

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "lithic", "~> 0.1.0.pre.alpha.42"
gem "lithic", "~> 0.1.0.pre.alpha.43"
```

<!-- x-release-please-end -->
Expand Down
2 changes: 2 additions & 0 deletions lib/lithic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@
require_relative "lithic/models/transaction_simulate_authorization_response"
require_relative "lithic/models/transaction_simulate_clearing_params"
require_relative "lithic/models/transaction_simulate_clearing_response"
require_relative "lithic/models/transaction_simulate_credit_authorization_advice_params"
require_relative "lithic/models/transaction_simulate_credit_authorization_advice_response"
require_relative "lithic/models/transaction_simulate_credit_authorization_params"
require_relative "lithic/models/transaction_simulate_credit_authorization_response"
require_relative "lithic/models/transaction_simulate_return_params"
Expand Down
3 changes: 3 additions & 0 deletions lib/lithic/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ module Lithic

TransactionSimulateClearingParams = Lithic::Models::TransactionSimulateClearingParams

TransactionSimulateCreditAuthorizationAdviceParams =
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams

TransactionSimulateCreditAuthorizationParams =
Lithic::Models::TransactionSimulateCreditAuthorizationParams

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# frozen_string_literal: true

module Lithic
module Models
# @see Lithic::Resources::Transactions#simulate_credit_authorization_advice
class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel
extend Lithic::Internal::Type::RequestParameters::Converter
include Lithic::Internal::Type::RequestParameters

# @!attribute amount
# Amount (in cents). Any value entered will be converted into a negative amount in
# the simulated transaction. For example, entering 100 in this field will appear
# as a -100 amount in the transaction.
#
# @return [Integer]
required :amount, Integer

# @!attribute descriptor
# Merchant descriptor.
#
# @return [String]
required :descriptor, String

# @!attribute pan
# Sixteen digit card number.
#
# @return [String]
required :pan, String

# @!attribute mcc
# Merchant category code for the transaction to be simulated. A four-digit number
# listed in ISO 18245. Supported merchant category codes can be found
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
#
# @return [String, nil]
optional :mcc, String

# @!attribute merchant_acceptor_id
# Unique identifier to identify the payment card acceptor.
#
# @return [String, nil]
optional :merchant_acceptor_id, String

# @!method initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
# Some parameter documentations has been truncated, see
# {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more
# details.
#
# @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
#
# @param descriptor [String] Merchant descriptor.
#
# @param pan [String] Sixteen digit card number.
#
# @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
#
# @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
#
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

module Lithic
module Models
# @see Lithic::Resources::Transactions#simulate_credit_authorization_advice
class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel
# @!attribute token
# A unique token to reference this transaction.
#
# @return [String, nil]
optional :token, String

# @!attribute debugging_request_id
# Debugging request ID to share with Lithic Support team.
#
# @return [String, nil]
optional :debugging_request_id, String

# @!method initialize(token: nil, debugging_request_id: nil)
# @param token [String] A unique token to reference this transaction.
#
# @param debugging_request_id [String] Debugging request ID to share with Lithic Support team.
end
end
end
37 changes: 37 additions & 0 deletions lib/lithic/resources/transactions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ def simulate_clearing(params)
)
end

# @deprecated use `simulate_credit_authorization_advice` instead
#
# Some parameter documentations has been truncated, see
# {Lithic::Models::TransactionSimulateCreditAuthorizationParams} for more details.
#
Expand Down Expand Up @@ -238,6 +240,41 @@ def simulate_credit_authorization(params)
)
end

# Some parameter documentations has been truncated, see
# {Lithic::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.
#
# @overload simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
#
# @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
#
# @param descriptor [String] Merchant descriptor.
#
# @param pan [String] Sixteen digit card number.
#
# @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
#
# @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
#
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
#
# @return [Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse]
#
# @see Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
def simulate_credit_authorization_advice(params)
parsed, options = Lithic::TransactionSimulateCreditAuthorizationAdviceParams.dump_request(params)
@client.request(
method: :post,
path: "v1/simulate/credit_authorization_advice",
body: parsed,
model: Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse,
options: options
)
end

# 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.
Expand Down
2 changes: 1 addition & 1 deletion lib/lithic/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Lithic
VERSION = "0.1.0.pre.alpha.42"
VERSION = "0.1.0.pre.alpha.43"
end
3 changes: 3 additions & 0 deletions rbi/lithic/models.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ module Lithic
TransactionSimulateClearingParams =
Lithic::Models::TransactionSimulateClearingParams

TransactionSimulateCreditAuthorizationAdviceParams =
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams

TransactionSimulateCreditAuthorizationParams =
Lithic::Models::TransactionSimulateCreditAuthorizationParams

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# typed: strong

module Lithic
module Models
class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel
extend Lithic::Internal::Type::RequestParameters::Converter
include Lithic::Internal::Type::RequestParameters

OrHash =
T.type_alias do
T.any(
Lithic::TransactionSimulateCreditAuthorizationAdviceParams,
Lithic::Internal::AnyHash
)
end

# Amount (in cents). Any value entered will be converted into a negative amount in
# the simulated transaction. For example, entering 100 in this field will appear
# as a -100 amount in the transaction.
sig { returns(Integer) }
attr_accessor :amount

# Merchant descriptor.
sig { returns(String) }
attr_accessor :descriptor

# Sixteen digit card number.
sig { returns(String) }
attr_accessor :pan

# Merchant category code for the transaction to be simulated. A four-digit number
# listed in ISO 18245. Supported merchant category codes can be found
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
sig { returns(T.nilable(String)) }
attr_reader :mcc

sig { params(mcc: String).void }
attr_writer :mcc

# Unique identifier to identify the payment card acceptor.
sig { returns(T.nilable(String)) }
attr_reader :merchant_acceptor_id

sig { params(merchant_acceptor_id: String).void }
attr_writer :merchant_acceptor_id

sig do
params(
amount: Integer,
descriptor: String,
pan: String,
mcc: String,
merchant_acceptor_id: String,
request_options: Lithic::RequestOptions::OrHash
).returns(T.attached_class)
end
def self.new(
# Amount (in cents). Any value entered will be converted into a negative amount in
# the simulated transaction. For example, entering 100 in this field will appear
# as a -100 amount in the transaction.
amount:,
# Merchant descriptor.
descriptor:,
# Sixteen digit card number.
pan:,
# Merchant category code for the transaction to be simulated. A four-digit number
# listed in ISO 18245. Supported merchant category codes can be found
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
mcc: nil,
# Unique identifier to identify the payment card acceptor.
merchant_acceptor_id: nil,
request_options: {}
)
end

sig do
override.returns(
{
amount: Integer,
descriptor: String,
pan: String,
mcc: String,
merchant_acceptor_id: String,
request_options: Lithic::RequestOptions
}
)
end
def to_hash
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# typed: strong

module Lithic
module Models
class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel
OrHash =
T.type_alias do
T.any(
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse,
Lithic::Internal::AnyHash
)
end

# A unique token to reference this transaction.
sig { returns(T.nilable(String)) }
attr_reader :token

sig { params(token: String).void }
attr_writer :token

# Debugging request ID to share with Lithic Support team.
sig { returns(T.nilable(String)) }
attr_reader :debugging_request_id

sig { params(debugging_request_id: String).void }
attr_writer :debugging_request_id

sig do
params(token: String, debugging_request_id: String).returns(
T.attached_class
)
end
def self.new(
# A unique token to reference this transaction.
token: nil,
# Debugging request ID to share with Lithic Support team.
debugging_request_id: nil
)
end

sig { override.returns({ token: String, debugging_request_id: String }) }
def to_hash
end
end
end
end
33 changes: 33 additions & 0 deletions rbi/lithic/resources/transactions.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,39 @@ module Lithic
)
end

# Simulates a credit authorization advice from the card network. This message
# indicates that the network approved a credit authorization on your behalf.
sig do
params(
amount: Integer,
descriptor: String,
pan: String,
mcc: String,
merchant_acceptor_id: String,
request_options: Lithic::RequestOptions::OrHash
).returns(
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse
)
end
def simulate_credit_authorization_advice(
# Amount (in cents). Any value entered will be converted into a negative amount in
# the simulated transaction. For example, entering 100 in this field will appear
# as a -100 amount in the transaction.
amount:,
# Merchant descriptor.
descriptor:,
# Sixteen digit card number.
pan:,
# Merchant category code for the transaction to be simulated. A four-digit number
# listed in ISO 18245. Supported merchant category codes can be found
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
mcc: nil,
# Unique identifier to identify the payment card acceptor.
merchant_acceptor_id: nil,
request_options: {}
)
end

# 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.
Expand Down
Loading