Skip to content

Commit 659f771

Browse files
feat(api): Add Hold API for financial account fund reservations
1 parent 6806361 commit 659f771

7 files changed

Lines changed: 84 additions & 4 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 185
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-df289940d26615072a7c5c9dd4d32b9bc7a86d977642b377c58abbe7a4cb93d0.yml
3-
openapi_spec_hash: 836bb078df7ac5f8d2dd5081c2e833be
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-45bd51c1d7885bde620179da56671e3378571e301528c60975604c4fbaa2c800.yml
3+
openapi_spec_hash: e1355583b829f269875b6f800078a9e0
44
config_hash: fb5070d41fcabdedbc084b83964b592a

lib/lithic/models/payment_create_params.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class PaymentCreateParams < Lithic::Internal::Type::BaseModel
4444
# @return [String, nil]
4545
optional :token, String
4646

47+
# @!attribute hold
48+
# Optional hold to settle when this payment is initiated.
49+
#
50+
# @return [Lithic::Models::PaymentCreateParams::Hold, nil]
51+
optional :hold, -> { Lithic::PaymentCreateParams::Hold }
52+
4753
# @!attribute memo
4854
#
4955
# @return [String, nil]
@@ -54,7 +60,7 @@ class PaymentCreateParams < Lithic::Internal::Type::BaseModel
5460
# @return [String, nil]
5561
optional :user_defined_id, String
5662

57-
# @!method initialize(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, memo: nil, user_defined_id: nil, request_options: {})
63+
# @!method initialize(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {})
5864
# Some parameter documentations has been truncated, see
5965
# {Lithic::Models::PaymentCreateParams} for more details.
6066
#
@@ -72,6 +78,8 @@ class PaymentCreateParams < Lithic::Internal::Type::BaseModel
7278
#
7379
# @param token [String] Customer-provided token that will serve as an idempotency token. This token will
7480
#
81+
# @param hold [Lithic::Models::PaymentCreateParams::Hold] Optional hold to settle when this payment is initiated.
82+
#
7583
# @param memo [String]
7684
#
7785
# @param user_defined_id [String]
@@ -134,6 +142,19 @@ module Type
134142
# @!method self.values
135143
# @return [Array<Symbol>]
136144
end
145+
146+
class Hold < Lithic::Internal::Type::BaseModel
147+
# @!attribute token
148+
# Token of the hold to settle when this payment is initiated.
149+
#
150+
# @return [String]
151+
required :token, String
152+
153+
# @!method initialize(token:)
154+
# Optional hold to settle when this payment is initiated.
155+
#
156+
# @param token [String] Token of the hold to settle when this payment is initiated.
157+
end
137158
end
138159
end
139160
end

lib/lithic/resources/payments.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Payments
88
#
99
# Initiates a payment between a financial account and an external bank account.
1010
#
11-
# @overload create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, memo: nil, user_defined_id: nil, request_options: {})
11+
# @overload create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {})
1212
#
1313
# @param amount [Integer]
1414
#
@@ -24,6 +24,8 @@ class Payments
2424
#
2525
# @param token [String] Customer-provided token that will serve as an idempotency token. This token will
2626
#
27+
# @param hold [Lithic::Models::PaymentCreateParams::Hold] Optional hold to settle when this payment is initiated.
28+
#
2729
# @param memo [String]
2830
#
2931
# @param user_defined_id [String]

rbi/lithic/models/payment_create_params.rbi

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ module Lithic
4545
sig { params(token: String).void }
4646
attr_writer :token
4747

48+
# Optional hold to settle when this payment is initiated.
49+
sig { returns(T.nilable(Lithic::PaymentCreateParams::Hold)) }
50+
attr_reader :hold
51+
52+
sig { params(hold: Lithic::PaymentCreateParams::Hold::OrHash).void }
53+
attr_writer :hold
54+
4855
sig { returns(T.nilable(String)) }
4956
attr_reader :memo
5057

@@ -67,6 +74,7 @@ module Lithic
6774
Lithic::PaymentCreateParams::MethodAttributes::OrHash,
6875
type: Lithic::PaymentCreateParams::Type::OrSymbol,
6976
token: String,
77+
hold: Lithic::PaymentCreateParams::Hold::OrHash,
7078
memo: String,
7179
user_defined_id: String,
7280
request_options: Lithic::RequestOptions::OrHash
@@ -82,6 +90,8 @@ module Lithic
8290
# Customer-provided token that will serve as an idempotency token. This token will
8391
# become the transaction token.
8492
token: nil,
93+
# Optional hold to settle when this payment is initiated.
94+
hold: nil,
8595
memo: nil,
8696
user_defined_id: nil,
8797
request_options: {}
@@ -98,6 +108,7 @@ module Lithic
98108
method_attributes: Lithic::PaymentCreateParams::MethodAttributes,
99109
type: Lithic::PaymentCreateParams::Type::OrSymbol,
100110
token: String,
111+
hold: Lithic::PaymentCreateParams::Hold,
101112
memo: String,
102113
user_defined_id: String,
103114
request_options: Lithic::RequestOptions
@@ -249,6 +260,29 @@ module Lithic
249260
def self.values
250261
end
251262
end
263+
264+
class Hold < Lithic::Internal::Type::BaseModel
265+
OrHash =
266+
T.type_alias do
267+
T.any(Lithic::PaymentCreateParams::Hold, Lithic::Internal::AnyHash)
268+
end
269+
270+
# Token of the hold to settle when this payment is initiated.
271+
sig { returns(String) }
272+
attr_accessor :token
273+
274+
# Optional hold to settle when this payment is initiated.
275+
sig { params(token: String).returns(T.attached_class) }
276+
def self.new(
277+
# Token of the hold to settle when this payment is initiated.
278+
token:
279+
)
280+
end
281+
282+
sig { override.returns({ token: String }) }
283+
def to_hash
284+
end
285+
end
252286
end
253287
end
254288
end

rbi/lithic/resources/payments.rbi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Lithic
1414
Lithic::PaymentCreateParams::MethodAttributes::OrHash,
1515
type: Lithic::PaymentCreateParams::Type::OrSymbol,
1616
token: String,
17+
hold: Lithic::PaymentCreateParams::Hold::OrHash,
1718
memo: String,
1819
user_defined_id: String,
1920
request_options: Lithic::RequestOptions::OrHash
@@ -29,6 +30,8 @@ module Lithic
2930
# Customer-provided token that will serve as an idempotency token. This token will
3031
# become the transaction token.
3132
token: nil,
33+
# Optional hold to settle when this payment is initiated.
34+
hold: nil,
3235
memo: nil,
3336
user_defined_id: nil,
3437
request_options: {}

sig/lithic/models/payment_create_params.rbs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Lithic
99
method_attributes: Lithic::PaymentCreateParams::MethodAttributes,
1010
type: Lithic::Models::PaymentCreateParams::type_,
1111
token: String,
12+
hold: Lithic::PaymentCreateParams::Hold,
1213
memo: String,
1314
user_defined_id: String
1415
}
@@ -34,6 +35,12 @@ module Lithic
3435

3536
def token=: (String) -> String
3637

38+
attr_reader hold: Lithic::PaymentCreateParams::Hold?
39+
40+
def hold=: (
41+
Lithic::PaymentCreateParams::Hold
42+
) -> Lithic::PaymentCreateParams::Hold
43+
3744
attr_reader memo: String?
3845

3946
def memo=: (String) -> String
@@ -50,6 +57,7 @@ module Lithic
5057
method_attributes: Lithic::PaymentCreateParams::MethodAttributes,
5158
type: Lithic::Models::PaymentCreateParams::type_,
5259
?token: String,
60+
?hold: Lithic::PaymentCreateParams::Hold,
5361
?memo: String,
5462
?user_defined_id: String,
5563
?request_options: Lithic::request_opts
@@ -63,6 +71,7 @@ module Lithic
6371
method_attributes: Lithic::PaymentCreateParams::MethodAttributes,
6472
type: Lithic::Models::PaymentCreateParams::type_,
6573
token: String,
74+
hold: Lithic::PaymentCreateParams::Hold,
6675
memo: String,
6776
user_defined_id: String,
6877
request_options: Lithic::RequestOptions
@@ -130,6 +139,16 @@ module Lithic
130139

131140
def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::type_]
132141
end
142+
143+
type hold = { token: String }
144+
145+
class Hold < Lithic::Internal::Type::BaseModel
146+
attr_accessor token: String
147+
148+
def initialize: (token: String) -> void
149+
150+
def to_hash: -> { token: String }
151+
end
133152
end
134153
end
135154
end

sig/lithic/resources/payments.rbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Lithic
99
method_attributes: Lithic::PaymentCreateParams::MethodAttributes,
1010
type: Lithic::Models::PaymentCreateParams::type_,
1111
?token: String,
12+
?hold: Lithic::PaymentCreateParams::Hold,
1213
?memo: String,
1314
?user_defined_id: String,
1415
?request_options: Lithic::request_opts

0 commit comments

Comments
 (0)