-
Notifications
You must be signed in to change notification settings - Fork 719
/
ReceivedDebits.d.ts
216 lines (175 loc) · 6.41 KB
/
ReceivedDebits.d.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
namespace Treasury {
/**
* ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount.
*/
interface ReceivedDebit {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'treasury.received_debit';
/**
* Amount (in cents) transferred.
*/
amount: number;
/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;
/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;
/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description: string;
/**
* Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen.
*/
failure_code: ReceivedDebit.FailureCode | null;
/**
* The FinancialAccount that funds were pulled from.
*/
financial_account: string | null;
/**
* A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
*/
hosted_regulatory_receipt_url: string | null;
initiating_payment_method_details?: ReceivedDebit.InitiatingPaymentMethodDetails;
linked_flows: ReceivedDebit.LinkedFlows;
/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;
/**
* The network used for the ReceivedDebit.
*/
network: ReceivedDebit.Network;
/**
* Details describing when a ReceivedDebit might be reversed.
*/
reversal_details: ReceivedDebit.ReversalDetails | null;
/**
* Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`.
*/
status: ReceivedDebit.Status;
/**
* The Transaction associated with this object.
*/
transaction: string | Stripe.Treasury.Transaction | null;
}
namespace ReceivedDebit {
type FailureCode =
| 'account_closed'
| 'account_frozen'
| 'insufficient_funds'
| 'other';
interface InitiatingPaymentMethodDetails {
/**
* Set when `type` is `balance`.
*/
balance?: 'payments';
billing_details: InitiatingPaymentMethodDetails.BillingDetails;
financial_account?: InitiatingPaymentMethodDetails.FinancialAccount;
/**
* Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID.
*/
issuing_card?: string;
/**
* Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount.
*/
type: InitiatingPaymentMethodDetails.Type;
us_bank_account?: InitiatingPaymentMethodDetails.UsBankAccount;
}
namespace InitiatingPaymentMethodDetails {
interface BillingDetails {
address: Stripe.Address;
/**
* Email address.
*/
email: string | null;
/**
* Full name.
*/
name: string | null;
}
interface FinancialAccount {
/**
* The FinancialAccount ID.
*/
id: string;
/**
* The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`.
*/
network: 'stripe';
}
type Type =
| 'balance'
| 'financial_account'
| 'issuing_card'
| 'stripe'
| 'us_bank_account';
interface UsBankAccount {
/**
* Bank name.
*/
bank_name: string | null;
/**
* The last four digits of the bank account number.
*/
last4: string | null;
/**
* The routing number for the bank account.
*/
routing_number: string | null;
}
}
interface LinkedFlows {
/**
* The DebitReversal created as a result of this ReceivedDebit being reversed.
*/
debit_reversal: string | null;
/**
* Set if the ReceivedDebit is associated with an InboundTransfer's return of funds.
*/
inbound_transfer: string | null;
/**
* Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object.
*/
issuing_authorization: string | null;
/**
* Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object.
*/
issuing_transaction: string | null;
}
type Network = 'ach' | 'card' | 'stripe';
interface ReversalDetails {
/**
* Time before which a ReceivedDebit can be reversed.
*/
deadline: number | null;
/**
* Set if a ReceivedDebit can't be reversed.
*/
restricted_reason: ReversalDetails.RestrictedReason | null;
}
namespace ReversalDetails {
type RestrictedReason =
| 'already_reversed'
| 'deadline_passed'
| 'network_restricted'
| 'other'
| 'source_flow_restricted';
}
type Status = 'failed' | 'succeeded';
}
}
}
}