Skip to content

Commit 1b3b8c8

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

File tree

6 files changed

+44
-30
lines changed

6 files changed

+44
-30
lines changed

.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

api.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ Types:
512512
- <code><a href="./src/resources/payments.ts">Payment</a></code>
513513
- <code><a href="./src/resources/payments.ts">PaymentCreateResponse</a></code>
514514
- <code><a href="./src/resources/payments.ts">PaymentRetryResponse</a></code>
515-
- <code><a href="./src/resources/payments.ts">PaymentReturnResponse</a></code>
516515
- <code><a href="./src/resources/payments.ts">PaymentSimulateActionResponse</a></code>
517516
- <code><a href="./src/resources/payments.ts">PaymentSimulateReceiptResponse</a></code>
518517
- <code><a href="./src/resources/payments.ts">PaymentSimulateReleaseResponse</a></code>
@@ -524,7 +523,7 @@ Methods:
524523
- <code title="get /v1/payments/{payment_token}">client.payments.<a href="./src/resources/payments.ts">retrieve</a>(paymentToken) -> Payment</code>
525524
- <code title="get /v1/payments">client.payments.<a href="./src/resources/payments.ts">list</a>({ ...params }) -> PaymentsCursorPage</code>
526525
- <code title="post /v1/payments/{payment_token}/retry">client.payments.<a href="./src/resources/payments.ts">retry</a>(paymentToken) -> PaymentRetryResponse</code>
527-
- <code title="post /v1/payments/{payment_token}/return">client.payments.<a href="./src/resources/payments.ts">return</a>(paymentToken, { ...params }) -> PaymentReturnResponse</code>
526+
- <code title="post /v1/payments/{payment_token}/return">client.payments.<a href="./src/resources/payments.ts">return</a>(paymentToken, { ...params }) -> Payment</code>
528527
- <code title="post /v1/simulate/payments/{payment_token}/action">client.payments.<a href="./src/resources/payments.ts">simulateAction</a>(paymentToken, { ...params }) -> PaymentSimulateActionResponse</code>
529528
- <code title="post /v1/simulate/payments/receipt">client.payments.<a href="./src/resources/payments.ts">simulateReceipt</a>({ ...params }) -> PaymentSimulateReceiptResponse</code>
530529
- <code title="post /v1/simulate/payments/release">client.payments.<a href="./src/resources/payments.ts">simulateRelease</a>({ ...params }) -> PaymentSimulateReleaseResponse</code>

src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ import {
131131
PaymentListParams,
132132
PaymentRetryResponse,
133133
PaymentReturnParams,
134-
PaymentReturnResponse,
135134
PaymentSimulateActionParams,
136135
PaymentSimulateActionResponse,
137136
PaymentSimulateReceiptParams,
@@ -774,7 +773,6 @@ export declare namespace Lithic {
774773
type Payment as Payment,
775774
type PaymentCreateResponse as PaymentCreateResponse,
776775
type PaymentRetryResponse as PaymentRetryResponse,
777-
type PaymentReturnResponse as PaymentReturnResponse,
778776
type PaymentSimulateActionResponse as PaymentSimulateActionResponse,
779777
type PaymentSimulateReceiptResponse as PaymentSimulateReceiptResponse,
780778
type PaymentSimulateReleaseResponse as PaymentSimulateReleaseResponse,

src/resources/financial-accounts/statements/statements.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ export interface Statement {
174174
* Date when the next billing period will end
175175
*/
176176
next_statement_end_date?: string;
177+
178+
/**
179+
* Details on number and size of payments to pay off balance
180+
*/
181+
payoff_details?: Statement.PayoffDetails | null;
177182
}
178183

179184
export namespace Statement {
@@ -269,6 +274,40 @@ export namespace Statement {
269274

270275
minimum_interest_charged?: number | null;
271276
}
277+
278+
/**
279+
* Details on number and size of payments to pay off balance
280+
*/
281+
export interface PayoffDetails {
282+
/**
283+
* The number of months it would take to pay off the balance in full by only paying
284+
* the minimum payment. "NA" will signal negative or zero amortization
285+
*/
286+
minimum_payment_months: string;
287+
288+
/**
289+
* The sum of all interest and principal paid, in cents, when only paying minimum
290+
* monthly payment. "NA" will signal negative or zero amortization
291+
*/
292+
minimum_payment_total: string;
293+
294+
/**
295+
* Number of months to full pay off
296+
*/
297+
payoff_period_length_months: number;
298+
299+
/**
300+
* The amount needed to be paid, in cents, each month in order to pay off current
301+
* balance in the payoff period
302+
*/
303+
payoff_period_monthly_payment_amount: number;
304+
305+
/**
306+
* The sum of all interest and principal paid, in cents, when paying off in the
307+
* payoff period
308+
*/
309+
payoff_period_payment_total: number;
310+
}
272311
}
273312

274313
export interface Statements {

src/resources/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ export {
191191
type Payment,
192192
type PaymentCreateResponse,
193193
type PaymentRetryResponse,
194-
type PaymentReturnResponse,
195194
type PaymentSimulateActionResponse,
196195
type PaymentSimulateReceiptResponse,
197196
type PaymentSimulateReleaseResponse,

src/resources/payments.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class Payments extends APIResource {
101101
*
102102
* @example
103103
* ```ts
104-
* const response = await client.payments.return(
104+
* const payment = await client.payments.return(
105105
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
106106
* {
107107
* financial_account_token:
@@ -115,7 +115,7 @@ export class Payments extends APIResource {
115115
paymentToken: string,
116116
body: PaymentReturnParams,
117117
options?: Core.RequestOptions,
118-
): Core.APIPromise<PaymentReturnResponse> {
118+
): Core.APIPromise<Payment> {
119119
return this._client.post(`/v1/payments/${paymentToken}/return`, { body, ...options });
120120
}
121121

@@ -517,26 +517,6 @@ export interface PaymentRetryResponse extends Payment {
517517
balance?: BalancesAPI.Balance;
518518
}
519519

520-
/**
521-
* Response from ACH operations including returns
522-
*/
523-
export interface PaymentReturnResponse {
524-
/**
525-
* Transaction result
526-
*/
527-
result: 'APPROVED' | 'DECLINED';
528-
529-
/**
530-
* Globally unique identifier for the transaction group
531-
*/
532-
transaction_group_uuid: string;
533-
534-
/**
535-
* Globally unique identifier for the transaction
536-
*/
537-
transaction_uuid: string;
538-
}
539-
540520
export interface PaymentSimulateActionResponse {
541521
/**
542522
* Debugging Request Id
@@ -787,7 +767,6 @@ export declare namespace Payments {
787767
type Payment as Payment,
788768
type PaymentCreateResponse as PaymentCreateResponse,
789769
type PaymentRetryResponse as PaymentRetryResponse,
790-
type PaymentReturnResponse as PaymentReturnResponse,
791770
type PaymentSimulateActionResponse as PaymentSimulateActionResponse,
792771
type PaymentSimulateReceiptResponse as PaymentSimulateReceiptResponse,
793772
type PaymentSimulateReleaseResponse as PaymentSimulateReleaseResponse,

0 commit comments

Comments
 (0)