-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfinancial-transactions.ts
97 lines (85 loc) · 3.05 KB
/
financial-transactions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import * as FinancialAccountsAPI from './financial-accounts';
import { FinancialTransactionsSinglePage } from './financial-accounts';
export class FinancialTransactions extends APIResource {
/**
* Get the financial transaction for the provided token.
*/
retrieve(
financialAccountToken: string,
financialTransactionToken: string,
options?: Core.RequestOptions,
): Core.APIPromise<FinancialAccountsAPI.FinancialTransaction> {
return this._client.get(
`/v1/financial_accounts/${financialAccountToken}/financial_transactions/${financialTransactionToken}`,
options,
);
}
/**
* List the financial transactions for a given financial account.
*/
list(
financialAccountToken: string,
query?: FinancialTransactionListParams,
options?: Core.RequestOptions,
): Core.PagePromise<FinancialTransactionsSinglePage, FinancialAccountsAPI.FinancialTransaction>;
list(
financialAccountToken: string,
options?: Core.RequestOptions,
): Core.PagePromise<FinancialTransactionsSinglePage, FinancialAccountsAPI.FinancialTransaction>;
list(
financialAccountToken: string,
query: FinancialTransactionListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<FinancialTransactionsSinglePage, FinancialAccountsAPI.FinancialTransaction> {
if (isRequestOptions(query)) {
return this.list(financialAccountToken, {}, query);
}
return this._client.getAPIList(
`/v1/financial_accounts/${financialAccountToken}/financial_transactions`,
FinancialTransactionsSinglePage,
{ query, ...options },
);
}
}
export interface FinancialTransactionListParams {
/**
* Date string in RFC 3339 format. Only entries created after the specified time
* will be included. UTC time zone.
*/
begin?: string;
/**
* Financial Transaction category to be returned.
*/
category?: 'ACH' | 'CARD' | 'TRANSFER';
/**
* Date string in RFC 3339 format. Only entries created before the specified time
* will be included. UTC time zone.
*/
end?: string;
/**
* A cursor representing an item's token before which a page of results should end.
* Used to retrieve the previous page of results before this item.
*/
ending_before?: string;
/**
* Financial Transaction result to be returned.
*/
result?: 'APPROVED' | 'DECLINED';
/**
* A cursor representing an item's token after which a page of results should
* begin. Used to retrieve the next page of results after this item.
*/
starting_after?: string;
/**
* Financial Transaction status to be returned.
*/
status?: 'DECLINED' | 'EXPIRED' | 'PENDING' | 'RETURNED' | 'SETTLED' | 'VOIDED';
}
export declare namespace FinancialTransactions {
export { type FinancialTransactionListParams as FinancialTransactionListParams };
}
export { FinancialTransactionsSinglePage };