Skip to content

Commit e21e546

Browse files
fix(api): Modify return type of returns API to payment-transaction
feat(api): Add Payoff Details
1 parent 0730dce commit e21e546

13 files changed

Lines changed: 245 additions & 200 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: 172
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-e1901db484e520cc1f6aa88c8b00d0fcda30c8f9e5ea562a12b9edfc3fb3b6d6.yml
3-
openapi_spec_hash: 59c317749628f3ed4cc7911b68f6351f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-9791980619fc7ce8afb01f77dfe3c660a540975327378287cb666136ae4b0a99.yml
3+
openapi_spec_hash: 0752074b2a7b0534329a1e3176c94a62
44
config_hash: aab05d0cf41f1f6b9f4d5677273c1600

lib/lithic.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@
289289
require_relative "lithic/models/payment_retry_params"
290290
require_relative "lithic/models/payment_retry_response"
291291
require_relative "lithic/models/payment_return_params"
292-
require_relative "lithic/models/payment_return_response"
293292
require_relative "lithic/models/payment_simulate_action_params"
294293
require_relative "lithic/models/payment_simulate_action_response"
295294
require_relative "lithic/models/payment_simulate_receipt_params"

lib/lithic/models/financial_accounts/statement.rb

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ class Statement < Lithic::Internal::Type::BaseModel
126126
# @return [Date, nil]
127127
optional :next_statement_end_date, Date
128128

129-
# @!method initialize(token:, account_standing:, amount_due:, available_credit:, created:, credit_limit:, credit_product_token:, days_in_billing_cycle:, ending_balance:, financial_account_token:, payment_due_date:, period_totals:, starting_balance:, statement_end_date:, statement_start_date:, statement_type:, updated:, ytd_totals:, interest_details: nil, next_payment_due_date: nil, next_statement_end_date: nil)
129+
# @!attribute payoff_details
130+
# Details on number and size of payments to pay off balance
131+
#
132+
# @return [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil]
133+
optional :payoff_details, -> { Lithic::FinancialAccounts::Statement::PayoffDetails }, nil?: true
134+
135+
# @!method initialize(token:, account_standing:, amount_due:, available_credit:, created:, credit_limit:, credit_product_token:, days_in_billing_cycle:, ending_balance:, financial_account_token:, payment_due_date:, period_totals:, starting_balance:, statement_end_date:, statement_start_date:, statement_type:, updated:, ytd_totals:, interest_details: nil, next_payment_due_date: nil, next_statement_end_date: nil, payoff_details: nil)
130136
# Some parameter documentations has been truncated, see
131137
# {Lithic::Models::FinancialAccounts::Statement} for more details.
132138
#
@@ -171,6 +177,8 @@ class Statement < Lithic::Internal::Type::BaseModel
171177
# @param next_payment_due_date [Date] Date when the next payment is due
172178
#
173179
# @param next_statement_end_date [Date] Date when the next billing period will end
180+
#
181+
# @param payoff_details [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil] Details on number and size of payments to pay off balance
174182

175183
# @see Lithic::Models::FinancialAccounts::Statement#account_standing
176184
class AccountStanding < Lithic::Internal::Type::BaseModel
@@ -406,6 +414,59 @@ module InterestCalculationMethod
406414
# @return [Array<Symbol>]
407415
end
408416
end
417+
418+
# @see Lithic::Models::FinancialAccounts::Statement#payoff_details
419+
class PayoffDetails < Lithic::Internal::Type::BaseModel
420+
# @!attribute minimum_payment_months
421+
# The number of months it would take to pay off the balance in full by only paying
422+
# the minimum payment. "NA" will signal negative or zero amortization
423+
#
424+
# @return [String]
425+
required :minimum_payment_months, String
426+
427+
# @!attribute minimum_payment_total
428+
# The sum of all interest and principal paid, in cents, when only paying minimum
429+
# monthly payment. "NA" will signal negative or zero amortization
430+
#
431+
# @return [String]
432+
required :minimum_payment_total, String
433+
434+
# @!attribute payoff_period_length_months
435+
# Number of months to full pay off
436+
#
437+
# @return [Integer]
438+
required :payoff_period_length_months, Integer
439+
440+
# @!attribute payoff_period_monthly_payment_amount
441+
# The amount needed to be paid, in cents, each month in order to pay off current
442+
# balance in the payoff period
443+
#
444+
# @return [Integer]
445+
required :payoff_period_monthly_payment_amount, Integer
446+
447+
# @!attribute payoff_period_payment_total
448+
# The sum of all interest and principal paid, in cents, when paying off in the
449+
# payoff period
450+
#
451+
# @return [Integer]
452+
required :payoff_period_payment_total, Integer
453+
454+
# @!method initialize(minimum_payment_months:, minimum_payment_total:, payoff_period_length_months:, payoff_period_monthly_payment_amount:, payoff_period_payment_total:)
455+
# Some parameter documentations has been truncated, see
456+
# {Lithic::Models::FinancialAccounts::Statement::PayoffDetails} for more details.
457+
#
458+
# Details on number and size of payments to pay off balance
459+
#
460+
# @param minimum_payment_months [String] The number of months it would take to pay off the balance in full by only paying
461+
#
462+
# @param minimum_payment_total [String] The sum of all interest and principal paid, in cents, when only paying minimum m
463+
#
464+
# @param payoff_period_length_months [Integer] Number of months to full pay off
465+
#
466+
# @param payoff_period_monthly_payment_amount [Integer] The amount needed to be paid, in cents, each month in order to pay off current b
467+
#
468+
# @param payoff_period_payment_total [Integer] The sum of all interest and principal paid, in cents, when paying off in the pay
469+
end
409470
end
410471
end
411472
end

lib/lithic/models/payment_return_response.rb

Lines changed: 0 additions & 48 deletions
This file was deleted.

lib/lithic/resources/payments.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def retry_(payment_token, params = {})
162162
#
163163
# @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil]
164164
#
165-
# @return [Lithic::Models::PaymentReturnResponse]
165+
# @return [Lithic::Models::Payment]
166166
#
167167
# @see Lithic::Models::PaymentReturnParams
168168
def return_(payment_token, params)
@@ -171,7 +171,7 @@ def return_(payment_token, params)
171171
method: :post,
172172
path: ["v1/payments/%1$s/return", payment_token],
173173
body: parsed,
174-
model: Lithic::Models::PaymentReturnResponse,
174+
model: Lithic::Payment,
175175
options: options
176176
)
177177
end

rbi/lithic/models/financial_accounts/statement.rbi

Lines changed: 105 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,24 @@ module Lithic
136136
sig { params(next_statement_end_date: Date).void }
137137
attr_writer :next_statement_end_date
138138

139+
# Details on number and size of payments to pay off balance
140+
sig do
141+
returns(
142+
T.nilable(Lithic::FinancialAccounts::Statement::PayoffDetails)
143+
)
144+
end
145+
attr_reader :payoff_details
146+
147+
sig do
148+
params(
149+
payoff_details:
150+
T.nilable(
151+
Lithic::FinancialAccounts::Statement::PayoffDetails::OrHash
152+
)
153+
).void
154+
end
155+
attr_writer :payoff_details
156+
139157
sig do
140158
params(
141159
token: String,
@@ -163,7 +181,11 @@ module Lithic
163181
Lithic::FinancialAccounts::Statement::InterestDetails::OrHash
164182
),
165183
next_payment_due_date: Date,
166-
next_statement_end_date: Date
184+
next_statement_end_date: Date,
185+
payoff_details:
186+
T.nilable(
187+
Lithic::FinancialAccounts::Statement::PayoffDetails::OrHash
188+
)
167189
).returns(T.attached_class)
168190
end
169191
def self.new(
@@ -203,7 +225,9 @@ module Lithic
203225
# Date when the next payment is due
204226
next_payment_due_date: nil,
205227
# Date when the next billing period will end
206-
next_statement_end_date: nil
228+
next_statement_end_date: nil,
229+
# Details on number and size of payments to pay off balance
230+
payoff_details: nil
207231
)
208232
end
209233

@@ -235,7 +259,9 @@ module Lithic
235259
Lithic::FinancialAccounts::Statement::InterestDetails
236260
),
237261
next_payment_due_date: Date,
238-
next_statement_end_date: Date
262+
next_statement_end_date: Date,
263+
payoff_details:
264+
T.nilable(Lithic::FinancialAccounts::Statement::PayoffDetails)
239265
}
240266
)
241267
end
@@ -743,6 +769,82 @@ module Lithic
743769
end
744770
end
745771
end
772+
773+
class PayoffDetails < Lithic::Internal::Type::BaseModel
774+
OrHash =
775+
T.type_alias do
776+
T.any(
777+
Lithic::FinancialAccounts::Statement::PayoffDetails,
778+
Lithic::Internal::AnyHash
779+
)
780+
end
781+
782+
# The number of months it would take to pay off the balance in full by only paying
783+
# the minimum payment. "NA" will signal negative or zero amortization
784+
sig { returns(String) }
785+
attr_accessor :minimum_payment_months
786+
787+
# The sum of all interest and principal paid, in cents, when only paying minimum
788+
# monthly payment. "NA" will signal negative or zero amortization
789+
sig { returns(String) }
790+
attr_accessor :minimum_payment_total
791+
792+
# Number of months to full pay off
793+
sig { returns(Integer) }
794+
attr_accessor :payoff_period_length_months
795+
796+
# The amount needed to be paid, in cents, each month in order to pay off current
797+
# balance in the payoff period
798+
sig { returns(Integer) }
799+
attr_accessor :payoff_period_monthly_payment_amount
800+
801+
# The sum of all interest and principal paid, in cents, when paying off in the
802+
# payoff period
803+
sig { returns(Integer) }
804+
attr_accessor :payoff_period_payment_total
805+
806+
# Details on number and size of payments to pay off balance
807+
sig do
808+
params(
809+
minimum_payment_months: String,
810+
minimum_payment_total: String,
811+
payoff_period_length_months: Integer,
812+
payoff_period_monthly_payment_amount: Integer,
813+
payoff_period_payment_total: Integer
814+
).returns(T.attached_class)
815+
end
816+
def self.new(
817+
# The number of months it would take to pay off the balance in full by only paying
818+
# the minimum payment. "NA" will signal negative or zero amortization
819+
minimum_payment_months:,
820+
# The sum of all interest and principal paid, in cents, when only paying minimum
821+
# monthly payment. "NA" will signal negative or zero amortization
822+
minimum_payment_total:,
823+
# Number of months to full pay off
824+
payoff_period_length_months:,
825+
# The amount needed to be paid, in cents, each month in order to pay off current
826+
# balance in the payoff period
827+
payoff_period_monthly_payment_amount:,
828+
# The sum of all interest and principal paid, in cents, when paying off in the
829+
# payoff period
830+
payoff_period_payment_total:
831+
)
832+
end
833+
834+
sig do
835+
override.returns(
836+
{
837+
minimum_payment_months: String,
838+
minimum_payment_total: String,
839+
payoff_period_length_months: Integer,
840+
payoff_period_monthly_payment_amount: Integer,
841+
payoff_period_payment_total: Integer
842+
}
843+
)
844+
end
845+
def to_hash
846+
end
847+
end
746848
end
747849
end
748850
end

0 commit comments

Comments
 (0)