-
Notifications
You must be signed in to change notification settings - Fork 719
/
Transactions.d.ts
368 lines (301 loc) · 11.6 KB
/
Transactions.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
// File generated from our OpenAPI spec
declare module 'stripe' {
namespace Stripe {
namespace Issuing {
/**
* Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving
* your Stripe account, such as a completed purchase or refund, is represented by an Issuing
* `Transaction` object.
*
* Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions)
*/
interface Transaction {
/**
* Unique identifier for the object.
*/
id: string;
/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'issuing.transaction';
/**
* The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
amount: number;
/**
* Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
amount_details: Transaction.AmountDetails | null;
/**
* The `Authorization` object that led to this transaction.
*/
authorization: string | Stripe.Issuing.Authorization | null;
/**
* ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction.
*/
balance_transaction: string | Stripe.BalanceTransaction | null;
/**
* The card used to make this transaction.
*/
card: string | Stripe.Issuing.Card;
/**
* The cardholder to whom this transaction belongs.
*/
cardholder: string | Stripe.Issuing.Cardholder | null;
/**
* 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;
/**
* If you've disputed the transaction, the ID of the dispute.
*/
dispute: string | Stripe.Issuing.Dispute | null;
/**
* 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 amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency.
*/
merchant_amount: number;
/**
* The currency with which the merchant is taking payment.
*/
merchant_currency: string;
merchant_data: Transaction.MerchantData;
/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
*/
metadata: Stripe.Metadata;
/**
* Details about the transaction, such as processing dates, set by the card network.
*/
network_data: Transaction.NetworkData | null;
/**
* Additional purchase information that is optionally provided by the merchant.
*/
purchase_details?: Transaction.PurchaseDetails | null;
/**
* [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
*/
token?: string | Stripe.Issuing.Token | null;
/**
* [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
*/
treasury?: Transaction.Treasury | null;
/**
* The nature of the transaction.
*/
type: Transaction.Type;
/**
* The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`.
*/
wallet: Transaction.Wallet | null;
}
namespace Transaction {
interface AmountDetails {
/**
* The fee charged by the ATM for the cash withdrawal.
*/
atm_fee: number | null;
/**
* The amount of cash requested by the cardholder.
*/
cashback_amount: number | null;
}
interface MerchantData {
/**
* A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values.
*/
category: string;
/**
* The merchant category code for the seller's business
*/
category_code: string;
/**
* City where the seller is located
*/
city: string | null;
/**
* Country where the seller is located
*/
country: string | null;
/**
* Name of the seller
*/
name: string | null;
/**
* Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant.
*/
network_id: string;
/**
* Postal code where the seller is located
*/
postal_code: string | null;
/**
* State where the seller is located
*/
state: string | null;
/**
* An ID assigned by the seller to the location of the sale.
*/
terminal_id: string | null;
/**
* URL provided by the merchant on a 3DS request
*/
url: string | null;
}
interface NetworkData {
/**
* A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations.
*/
authorization_code: string | null;
/**
* The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network.
*/
processing_date: string | null;
/**
* Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions.
*/
transaction_id: string | null;
}
interface PurchaseDetails {
/**
* Information about the flight that was purchased with this transaction.
*/
flight: PurchaseDetails.Flight | null;
/**
* Information about fuel that was purchased with this transaction.
*/
fuel: PurchaseDetails.Fuel | null;
/**
* Information about lodging that was purchased with this transaction.
*/
lodging: PurchaseDetails.Lodging | null;
/**
* The line items in the purchase.
*/
receipt: Array<PurchaseDetails.Receipt> | null;
/**
* A merchant-specific order number.
*/
reference: string | null;
}
namespace PurchaseDetails {
interface Flight {
/**
* The time that the flight departed.
*/
departure_at: number | null;
/**
* The name of the passenger.
*/
passenger_name: string | null;
/**
* Whether the ticket is refundable.
*/
refundable: boolean | null;
/**
* The legs of the trip.
*/
segments: Array<Flight.Segment> | null;
/**
* The travel agency that issued the ticket.
*/
travel_agency: string | null;
}
namespace Flight {
interface Segment {
/**
* The three-letter IATA airport code of the flight's destination.
*/
arrival_airport_code: string | null;
/**
* The airline carrier code.
*/
carrier: string | null;
/**
* The three-letter IATA airport code that the flight departed from.
*/
departure_airport_code: string | null;
/**
* The flight number.
*/
flight_number: string | null;
/**
* The flight's service class.
*/
service_class: string | null;
/**
* Whether a stopover is allowed on this flight.
*/
stopover_allowed: boolean | null;
}
}
interface Fuel {
/**
* The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`.
*/
type: string;
/**
* The units for `volume_decimal`. One of `liter`, `us_gallon`, or `other`.
*/
unit: string;
/**
* The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
*/
unit_cost_decimal: string;
/**
* The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places.
*/
volume_decimal: string | null;
}
interface Lodging {
/**
* The time of checking into the lodging.
*/
check_in_at: number | null;
/**
* The number of nights stayed at the lodging.
*/
nights: number | null;
}
interface Receipt {
/**
* The description of the item. The maximum length of this field is 26 characters.
*/
description: string | null;
/**
* The quantity of the item.
*/
quantity: number | null;
/**
* The total for this line item in cents.
*/
total: number | null;
/**
* The unit cost of the item in cents.
*/
unit_cost: number | null;
}
}
interface Treasury {
/**
* The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund
*/
received_credit: string | null;
/**
* The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture
*/
received_debit: string | null;
}
type Type = 'capture' | 'refund';
type Wallet = 'apple_pay' | 'google_pay' | 'samsung_pay';
}
}
}
}