Skip to content

Commit b12b52c

Browse files
feat(api): manual updates
1 parent e38fd8a commit b12b52c

15 files changed

Lines changed: 405 additions & 1 deletion

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 169
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-1d44bb7fad99487af1161eb24dfd5369440eda7e80ed237cbc1acc6802a7d212.yml
33
openapi_spec_hash: 1b6b6215b60094b76b91c56b925a251a
4-
config_hash: ac676e77c8ca051c7aad978c26e96345
4+
config_hash: e68a052fd109c0885732114753abc739

lib/lithic.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@
339339
require_relative "lithic/models/transaction_simulate_authorization_response"
340340
require_relative "lithic/models/transaction_simulate_clearing_params"
341341
require_relative "lithic/models/transaction_simulate_clearing_response"
342+
require_relative "lithic/models/transaction_simulate_credit_authorization_advice_params"
343+
require_relative "lithic/models/transaction_simulate_credit_authorization_advice_response"
342344
require_relative "lithic/models/transaction_simulate_credit_authorization_params"
343345
require_relative "lithic/models/transaction_simulate_credit_authorization_response"
344346
require_relative "lithic/models/transaction_simulate_return_params"

lib/lithic/models.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ module Lithic
375375

376376
TransactionSimulateClearingParams = Lithic::Models::TransactionSimulateClearingParams
377377

378+
TransactionSimulateCreditAuthorizationAdviceParams =
379+
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
380+
378381
TransactionSimulateCreditAuthorizationParams =
379382
Lithic::Models::TransactionSimulateCreditAuthorizationParams
380383

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# frozen_string_literal: true
2+
3+
module Lithic
4+
module Models
5+
# @see Lithic::Resources::Transactions#simulate_credit_authorization_advice
6+
class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel
7+
extend Lithic::Internal::Type::RequestParameters::Converter
8+
include Lithic::Internal::Type::RequestParameters
9+
10+
# @!attribute amount
11+
# Amount (in cents). Any value entered will be converted into a negative amount in
12+
# the simulated transaction. For example, entering 100 in this field will appear
13+
# as a -100 amount in the transaction.
14+
#
15+
# @return [Integer]
16+
required :amount, Integer
17+
18+
# @!attribute descriptor
19+
# Merchant descriptor.
20+
#
21+
# @return [String]
22+
required :descriptor, String
23+
24+
# @!attribute pan
25+
# Sixteen digit card number.
26+
#
27+
# @return [String]
28+
required :pan, String
29+
30+
# @!attribute mcc
31+
# Merchant category code for the transaction to be simulated. A four-digit number
32+
# listed in ISO 18245. Supported merchant category codes can be found
33+
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
34+
#
35+
# @return [String, nil]
36+
optional :mcc, String
37+
38+
# @!attribute merchant_acceptor_id
39+
# Unique identifier to identify the payment card acceptor.
40+
#
41+
# @return [String, nil]
42+
optional :merchant_acceptor_id, String
43+
44+
# @!method initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
45+
# Some parameter documentations has been truncated, see
46+
# {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more
47+
# details.
48+
#
49+
# @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
50+
#
51+
# @param descriptor [String] Merchant descriptor.
52+
#
53+
# @param pan [String] Sixteen digit card number.
54+
#
55+
# @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
56+
#
57+
# @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
58+
#
59+
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}]
60+
end
61+
end
62+
end
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
module Lithic
4+
module Models
5+
# @see Lithic::Resources::Transactions#simulate_credit_authorization_advice
6+
class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel
7+
# @!attribute token
8+
# A unique token to reference this transaction.
9+
#
10+
# @return [String, nil]
11+
optional :token, String
12+
13+
# @!attribute debugging_request_id
14+
# Debugging request ID to share with Lithic Support team.
15+
#
16+
# @return [String, nil]
17+
optional :debugging_request_id, String
18+
19+
# @!method initialize(token: nil, debugging_request_id: nil)
20+
# @param token [String] A unique token to reference this transaction.
21+
#
22+
# @param debugging_request_id [String] Debugging request ID to share with Lithic Support team.
23+
end
24+
end
25+
end

lib/lithic/resources/transactions.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ def simulate_clearing(params)
204204
)
205205
end
206206

207+
# @deprecated use `simulate_credit_authorization_advice` instead
208+
#
207209
# Some parameter documentations has been truncated, see
208210
# {Lithic::Models::TransactionSimulateCreditAuthorizationParams} for more details.
209211
#
@@ -238,6 +240,41 @@ def simulate_credit_authorization(params)
238240
)
239241
end
240242

243+
# Some parameter documentations has been truncated, see
244+
# {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more
245+
# details.
246+
#
247+
# Simulates a credit authorization advice from the card network. This message
248+
# indicates that the network approved a credit authorization on your behalf.
249+
#
250+
# @overload simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_id: nil, request_options: {})
251+
#
252+
# @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in
253+
#
254+
# @param descriptor [String] Merchant descriptor.
255+
#
256+
# @param pan [String] Sixteen digit card number.
257+
#
258+
# @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number
259+
#
260+
# @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor.
261+
#
262+
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
263+
#
264+
# @return [Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse]
265+
#
266+
# @see Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
267+
def simulate_credit_authorization_advice(params)
268+
parsed, options = Lithic::TransactionSimulateCreditAuthorizationAdviceParams.dump_request(params)
269+
@client.request(
270+
method: :post,
271+
path: "v1/simulate/credit_authorization_advice",
272+
body: parsed,
273+
model: Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse,
274+
options: options
275+
)
276+
end
277+
241278
# Returns, or refunds, an amount back to a card. Returns simulated via this
242279
# endpoint clear immediately, without prior authorization, and result in a
243280
# `SETTLED` transaction status.

rbi/lithic/models.rbi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ module Lithic
367367
TransactionSimulateClearingParams =
368368
Lithic::Models::TransactionSimulateClearingParams
369369

370+
TransactionSimulateCreditAuthorizationAdviceParams =
371+
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams
372+
370373
TransactionSimulateCreditAuthorizationParams =
371374
Lithic::Models::TransactionSimulateCreditAuthorizationParams
372375

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# typed: strong
2+
3+
module Lithic
4+
module Models
5+
class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel
6+
extend Lithic::Internal::Type::RequestParameters::Converter
7+
include Lithic::Internal::Type::RequestParameters
8+
9+
OrHash =
10+
T.type_alias do
11+
T.any(
12+
Lithic::TransactionSimulateCreditAuthorizationAdviceParams,
13+
Lithic::Internal::AnyHash
14+
)
15+
end
16+
17+
# Amount (in cents). Any value entered will be converted into a negative amount in
18+
# the simulated transaction. For example, entering 100 in this field will appear
19+
# as a -100 amount in the transaction.
20+
sig { returns(Integer) }
21+
attr_accessor :amount
22+
23+
# Merchant descriptor.
24+
sig { returns(String) }
25+
attr_accessor :descriptor
26+
27+
# Sixteen digit card number.
28+
sig { returns(String) }
29+
attr_accessor :pan
30+
31+
# Merchant category code for the transaction to be simulated. A four-digit number
32+
# listed in ISO 18245. Supported merchant category codes can be found
33+
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
34+
sig { returns(T.nilable(String)) }
35+
attr_reader :mcc
36+
37+
sig { params(mcc: String).void }
38+
attr_writer :mcc
39+
40+
# Unique identifier to identify the payment card acceptor.
41+
sig { returns(T.nilable(String)) }
42+
attr_reader :merchant_acceptor_id
43+
44+
sig { params(merchant_acceptor_id: String).void }
45+
attr_writer :merchant_acceptor_id
46+
47+
sig do
48+
params(
49+
amount: Integer,
50+
descriptor: String,
51+
pan: String,
52+
mcc: String,
53+
merchant_acceptor_id: String,
54+
request_options: Lithic::RequestOptions::OrHash
55+
).returns(T.attached_class)
56+
end
57+
def self.new(
58+
# Amount (in cents). Any value entered will be converted into a negative amount in
59+
# the simulated transaction. For example, entering 100 in this field will appear
60+
# as a -100 amount in the transaction.
61+
amount:,
62+
# Merchant descriptor.
63+
descriptor:,
64+
# Sixteen digit card number.
65+
pan:,
66+
# Merchant category code for the transaction to be simulated. A four-digit number
67+
# listed in ISO 18245. Supported merchant category codes can be found
68+
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
69+
mcc: nil,
70+
# Unique identifier to identify the payment card acceptor.
71+
merchant_acceptor_id: nil,
72+
request_options: {}
73+
)
74+
end
75+
76+
sig do
77+
override.returns(
78+
{
79+
amount: Integer,
80+
descriptor: String,
81+
pan: String,
82+
mcc: String,
83+
merchant_acceptor_id: String,
84+
request_options: Lithic::RequestOptions
85+
}
86+
)
87+
end
88+
def to_hash
89+
end
90+
end
91+
end
92+
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# typed: strong
2+
3+
module Lithic
4+
module Models
5+
class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel
6+
OrHash =
7+
T.type_alias do
8+
T.any(
9+
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse,
10+
Lithic::Internal::AnyHash
11+
)
12+
end
13+
14+
# A unique token to reference this transaction.
15+
sig { returns(T.nilable(String)) }
16+
attr_reader :token
17+
18+
sig { params(token: String).void }
19+
attr_writer :token
20+
21+
# Debugging request ID to share with Lithic Support team.
22+
sig { returns(T.nilable(String)) }
23+
attr_reader :debugging_request_id
24+
25+
sig { params(debugging_request_id: String).void }
26+
attr_writer :debugging_request_id
27+
28+
sig do
29+
params(token: String, debugging_request_id: String).returns(
30+
T.attached_class
31+
)
32+
end
33+
def self.new(
34+
# A unique token to reference this transaction.
35+
token: nil,
36+
# Debugging request ID to share with Lithic Support team.
37+
debugging_request_id: nil
38+
)
39+
end
40+
41+
sig { override.returns({ token: String, debugging_request_id: String }) }
42+
def to_hash
43+
end
44+
end
45+
end
46+
end

rbi/lithic/resources/transactions.rbi

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,39 @@ module Lithic
241241
)
242242
end
243243

244+
# Simulates a credit authorization advice from the card network. This message
245+
# indicates that the network approved a credit authorization on your behalf.
246+
sig do
247+
params(
248+
amount: Integer,
249+
descriptor: String,
250+
pan: String,
251+
mcc: String,
252+
merchant_acceptor_id: String,
253+
request_options: Lithic::RequestOptions::OrHash
254+
).returns(
255+
Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse
256+
)
257+
end
258+
def simulate_credit_authorization_advice(
259+
# Amount (in cents). Any value entered will be converted into a negative amount in
260+
# the simulated transaction. For example, entering 100 in this field will appear
261+
# as a -100 amount in the transaction.
262+
amount:,
263+
# Merchant descriptor.
264+
descriptor:,
265+
# Sixteen digit card number.
266+
pan:,
267+
# Merchant category code for the transaction to be simulated. A four-digit number
268+
# listed in ISO 18245. Supported merchant category codes can be found
269+
# [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs).
270+
mcc: nil,
271+
# Unique identifier to identify the payment card acceptor.
272+
merchant_acceptor_id: nil,
273+
request_options: {}
274+
)
275+
end
276+
244277
# Returns, or refunds, an amount back to a card. Returns simulated via this
245278
# endpoint clear immediately, without prior authorization, and result in a
246279
# `SETTLED` transaction status.

0 commit comments

Comments
 (0)