@naturalpay/sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/client.d.mts +22 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +22 -10
- package/client.d.ts.map +1 -1
- package/client.js +14 -2
- package/client.js.map +1 -1
- package/client.mjs +15 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/api-keys.d.mts +16 -2
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +16 -2
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +7 -4
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +7 -4
- package/resources/api-keys.mjs.map +1 -1
- package/resources/escalations.d.mts +1124 -0
- package/resources/escalations.d.mts.map +1 -0
- package/resources/escalations.d.ts +1124 -0
- package/resources/escalations.d.ts.map +1 -0
- package/resources/escalations.js +110 -0
- package/resources/escalations.js.map +1 -0
- package/resources/escalations.mjs +106 -0
- package/resources/escalations.mjs.map +1 -0
- package/resources/index.d.mts +6 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invitations.d.mts +16 -7
- package/resources/invitations.d.mts.map +1 -1
- package/resources/invitations.d.ts +16 -7
- package/resources/invitations.d.ts.map +1 -1
- package/resources/invitations.js +6 -4
- package/resources/invitations.js.map +1 -1
- package/resources/invitations.mjs +6 -4
- package/resources/invitations.mjs.map +1 -1
- package/resources/parties.d.mts +53 -26
- package/resources/parties.d.mts.map +1 -1
- package/resources/parties.d.ts +53 -26
- package/resources/parties.d.ts.map +1 -1
- package/resources/parties.js +27 -1
- package/resources/parties.js.map +1 -1
- package/resources/parties.mjs +27 -1
- package/resources/parties.mjs.map +1 -1
- package/resources/payment-requests.d.mts +738 -33
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +738 -33
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +82 -1
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +82 -1
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +390 -24
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +390 -24
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +53 -3
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +53 -3
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +50 -118
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +50 -118
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +2 -2
- package/resources/transactions.mjs +2 -2
- package/resources/transfers.d.mts +1030 -0
- package/resources/transfers.d.mts.map +1 -0
- package/resources/transfers.d.ts +1030 -0
- package/resources/transfers.d.ts.map +1 -0
- package/resources/transfers.js +114 -0
- package/resources/transfers.js.map +1 -0
- package/resources/transfers.mjs +110 -0
- package/resources/transfers.mjs.map +1 -0
- package/resources/wallet.d.mts +1 -189
- package/resources/wallet.d.mts.map +1 -1
- package/resources/wallet.d.ts +1 -189
- package/resources/wallet.d.ts.map +1 -1
- package/resources/wallet.js +0 -66
- package/resources/wallet.js.map +1 -1
- package/resources/wallet.mjs +0 -66
- package/resources/wallet.mjs.map +1 -1
- package/resources/webhooks.d.mts +7 -7
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +7 -7
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +87 -11
- package/src/resources/api-keys.ts +26 -4
- package/src/resources/escalations.ts +1422 -0
- package/src/resources/index.ts +39 -5
- package/src/resources/invitations.ts +26 -10
- package/src/resources/parties.ts +85 -30
- package/src/resources/payment-requests.ts +949 -58
- package/src/resources/payments.ts +518 -23
- package/src/resources/transactions.ts +50 -136
- package/src/resources/transfers.ts +1338 -0
- package/src/resources/wallet.ts +0 -268
- package/src/resources/webhooks.ts +7 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/payments.d.ts
CHANGED
|
@@ -2,31 +2,182 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
/**
|
|
5
|
-
* Payment
|
|
5
|
+
* Payment operations
|
|
6
6
|
*/
|
|
7
7
|
export declare class Payments extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Create a payment
|
|
9
|
+
* Create a payment.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
13
|
* const payment = await client.payments.create({
|
|
14
14
|
* amount: 1,
|
|
15
|
-
* counterparty:
|
|
15
|
+
* counterparty: {
|
|
16
|
+
* type: 'type',
|
|
17
|
+
* value: 'dev@stainless.com',
|
|
18
|
+
* },
|
|
16
19
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
17
20
|
* });
|
|
18
21
|
* ```
|
|
19
22
|
*/
|
|
20
23
|
create(params: PaymentCreateParams, options?: RequestOptions): APIPromise<PaymentCreateResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* List payments initiated by the authenticated party.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const payments = await client.payments.list();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(params?: PaymentListParams | null | undefined, options?: RequestOptions): APIPromise<PaymentListResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a payment initiated by the authenticated party.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const payment = await client.payments.get(
|
|
39
|
+
* 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
get(paymentID: string, params?: PaymentGetParams | null | undefined, options?: RequestOptions): APIPromise<PaymentGetResponse>;
|
|
21
44
|
}
|
|
22
45
|
export interface PaymentCreateResponse {
|
|
23
46
|
data: PaymentCreateResponse.Data;
|
|
24
47
|
}
|
|
25
48
|
export declare namespace PaymentCreateResponse {
|
|
26
49
|
interface Data {
|
|
50
|
+
id: string;
|
|
51
|
+
/**
|
|
52
|
+
* Resource attributes
|
|
53
|
+
*/
|
|
54
|
+
attributes: Data.Attributes;
|
|
55
|
+
/**
|
|
56
|
+
* Resource relationships
|
|
57
|
+
*/
|
|
58
|
+
relationships: Data.Relationships;
|
|
59
|
+
type: string;
|
|
60
|
+
}
|
|
61
|
+
namespace Data {
|
|
27
62
|
/**
|
|
28
|
-
* Resource
|
|
63
|
+
* Resource attributes
|
|
29
64
|
*/
|
|
65
|
+
interface Attributes {
|
|
66
|
+
/**
|
|
67
|
+
* Amount in cents
|
|
68
|
+
*/
|
|
69
|
+
amount: number;
|
|
70
|
+
/**
|
|
71
|
+
* When this payment was created
|
|
72
|
+
*/
|
|
73
|
+
createdAt: string;
|
|
74
|
+
/**
|
|
75
|
+
* Currency code
|
|
76
|
+
*/
|
|
77
|
+
currency: string;
|
|
78
|
+
/**
|
|
79
|
+
* Payment description
|
|
80
|
+
*/
|
|
81
|
+
description: string | null;
|
|
82
|
+
/**
|
|
83
|
+
* Payment status
|
|
84
|
+
*/
|
|
85
|
+
status: 'CREATED' | 'PROCESSING' | 'PENDING_CLAIM' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'APPROVAL_DENIED' | 'CANCELLED';
|
|
86
|
+
/**
|
|
87
|
+
* When this payment was last updated
|
|
88
|
+
*/
|
|
89
|
+
updatedAt: string | null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Resource relationships
|
|
93
|
+
*/
|
|
94
|
+
interface Relationships {
|
|
95
|
+
/**
|
|
96
|
+
* Recipient party for this payment, when known.
|
|
97
|
+
*/
|
|
98
|
+
recipient: Relationships.Recipient;
|
|
99
|
+
/**
|
|
100
|
+
* Party that initiated the payment
|
|
101
|
+
*/
|
|
102
|
+
sender: Relationships.Sender;
|
|
103
|
+
/**
|
|
104
|
+
* Sender-side transaction row for this payment, when available.
|
|
105
|
+
*/
|
|
106
|
+
transaction: Relationships.Transaction;
|
|
107
|
+
}
|
|
108
|
+
namespace Relationships {
|
|
109
|
+
/**
|
|
110
|
+
* Recipient party for this payment, when known.
|
|
111
|
+
*/
|
|
112
|
+
interface Recipient {
|
|
113
|
+
/**
|
|
114
|
+
* Related resource identifier
|
|
115
|
+
*/
|
|
116
|
+
data: Recipient.Data | null;
|
|
117
|
+
}
|
|
118
|
+
namespace Recipient {
|
|
119
|
+
/**
|
|
120
|
+
* Related resource identifier
|
|
121
|
+
*/
|
|
122
|
+
interface Data {
|
|
123
|
+
id: string;
|
|
124
|
+
/**
|
|
125
|
+
* Resource type
|
|
126
|
+
*/
|
|
127
|
+
type: string;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Party that initiated the payment
|
|
132
|
+
*/
|
|
133
|
+
interface Sender {
|
|
134
|
+
/**
|
|
135
|
+
* Related resource identifier
|
|
136
|
+
*/
|
|
137
|
+
data: Sender.Data;
|
|
138
|
+
}
|
|
139
|
+
namespace Sender {
|
|
140
|
+
/**
|
|
141
|
+
* Related resource identifier
|
|
142
|
+
*/
|
|
143
|
+
interface Data {
|
|
144
|
+
id: string;
|
|
145
|
+
/**
|
|
146
|
+
* Resource type
|
|
147
|
+
*/
|
|
148
|
+
type: string;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Sender-side transaction row for this payment, when available.
|
|
153
|
+
*/
|
|
154
|
+
interface Transaction {
|
|
155
|
+
/**
|
|
156
|
+
* Related resource identifier
|
|
157
|
+
*/
|
|
158
|
+
data: Transaction.Data | null;
|
|
159
|
+
}
|
|
160
|
+
namespace Transaction {
|
|
161
|
+
/**
|
|
162
|
+
* Related resource identifier
|
|
163
|
+
*/
|
|
164
|
+
interface Data {
|
|
165
|
+
id: string;
|
|
166
|
+
/**
|
|
167
|
+
* Resource type
|
|
168
|
+
*/
|
|
169
|
+
type: string;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export interface PaymentListResponse {
|
|
176
|
+
data: Array<PaymentListResponse.Data>;
|
|
177
|
+
meta: PaymentListResponse.Meta;
|
|
178
|
+
}
|
|
179
|
+
export declare namespace PaymentListResponse {
|
|
180
|
+
interface Data {
|
|
30
181
|
id: string;
|
|
31
182
|
/**
|
|
32
183
|
* Resource attributes
|
|
@@ -48,9 +199,144 @@ export declare namespace PaymentCreateResponse {
|
|
|
48
199
|
*/
|
|
49
200
|
amount: number;
|
|
50
201
|
/**
|
|
51
|
-
*
|
|
202
|
+
* When this payment was created
|
|
52
203
|
*/
|
|
53
|
-
|
|
204
|
+
createdAt: string;
|
|
205
|
+
/**
|
|
206
|
+
* Currency code
|
|
207
|
+
*/
|
|
208
|
+
currency: string;
|
|
209
|
+
/**
|
|
210
|
+
* Payment description
|
|
211
|
+
*/
|
|
212
|
+
description: string | null;
|
|
213
|
+
/**
|
|
214
|
+
* Payment status
|
|
215
|
+
*/
|
|
216
|
+
status: 'CREATED' | 'PROCESSING' | 'PENDING_CLAIM' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'APPROVAL_DENIED' | 'CANCELLED';
|
|
217
|
+
/**
|
|
218
|
+
* When this payment was last updated
|
|
219
|
+
*/
|
|
220
|
+
updatedAt: string | null;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Resource relationships
|
|
224
|
+
*/
|
|
225
|
+
interface Relationships {
|
|
226
|
+
/**
|
|
227
|
+
* Recipient party for this payment, when known.
|
|
228
|
+
*/
|
|
229
|
+
recipient: Relationships.Recipient;
|
|
230
|
+
/**
|
|
231
|
+
* Party that initiated the payment
|
|
232
|
+
*/
|
|
233
|
+
sender: Relationships.Sender;
|
|
234
|
+
/**
|
|
235
|
+
* Sender-side transaction row for this payment, when available.
|
|
236
|
+
*/
|
|
237
|
+
transaction: Relationships.Transaction;
|
|
238
|
+
}
|
|
239
|
+
namespace Relationships {
|
|
240
|
+
/**
|
|
241
|
+
* Recipient party for this payment, when known.
|
|
242
|
+
*/
|
|
243
|
+
interface Recipient {
|
|
244
|
+
/**
|
|
245
|
+
* Related resource identifier
|
|
246
|
+
*/
|
|
247
|
+
data: Recipient.Data | null;
|
|
248
|
+
}
|
|
249
|
+
namespace Recipient {
|
|
250
|
+
/**
|
|
251
|
+
* Related resource identifier
|
|
252
|
+
*/
|
|
253
|
+
interface Data {
|
|
254
|
+
id: string;
|
|
255
|
+
/**
|
|
256
|
+
* Resource type
|
|
257
|
+
*/
|
|
258
|
+
type: string;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Party that initiated the payment
|
|
263
|
+
*/
|
|
264
|
+
interface Sender {
|
|
265
|
+
/**
|
|
266
|
+
* Related resource identifier
|
|
267
|
+
*/
|
|
268
|
+
data: Sender.Data;
|
|
269
|
+
}
|
|
270
|
+
namespace Sender {
|
|
271
|
+
/**
|
|
272
|
+
* Related resource identifier
|
|
273
|
+
*/
|
|
274
|
+
interface Data {
|
|
275
|
+
id: string;
|
|
276
|
+
/**
|
|
277
|
+
* Resource type
|
|
278
|
+
*/
|
|
279
|
+
type: string;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Sender-side transaction row for this payment, when available.
|
|
284
|
+
*/
|
|
285
|
+
interface Transaction {
|
|
286
|
+
/**
|
|
287
|
+
* Related resource identifier
|
|
288
|
+
*/
|
|
289
|
+
data: Transaction.Data | null;
|
|
290
|
+
}
|
|
291
|
+
namespace Transaction {
|
|
292
|
+
/**
|
|
293
|
+
* Related resource identifier
|
|
294
|
+
*/
|
|
295
|
+
interface Data {
|
|
296
|
+
id: string;
|
|
297
|
+
/**
|
|
298
|
+
* Resource type
|
|
299
|
+
*/
|
|
300
|
+
type: string;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
interface Meta {
|
|
306
|
+
pagination: Meta.Pagination;
|
|
307
|
+
}
|
|
308
|
+
namespace Meta {
|
|
309
|
+
interface Pagination {
|
|
310
|
+
hasMore: boolean;
|
|
311
|
+
nextCursor: string | null;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
export interface PaymentGetResponse {
|
|
316
|
+
data: PaymentGetResponse.Data;
|
|
317
|
+
}
|
|
318
|
+
export declare namespace PaymentGetResponse {
|
|
319
|
+
interface Data {
|
|
320
|
+
id: string;
|
|
321
|
+
/**
|
|
322
|
+
* Resource attributes
|
|
323
|
+
*/
|
|
324
|
+
attributes: Data.Attributes;
|
|
325
|
+
/**
|
|
326
|
+
* Resource relationships
|
|
327
|
+
*/
|
|
328
|
+
relationships: Data.Relationships;
|
|
329
|
+
type: string;
|
|
330
|
+
}
|
|
331
|
+
namespace Data {
|
|
332
|
+
/**
|
|
333
|
+
* Resource attributes
|
|
334
|
+
*/
|
|
335
|
+
interface Attributes {
|
|
336
|
+
/**
|
|
337
|
+
* Amount in cents
|
|
338
|
+
*/
|
|
339
|
+
amount: number;
|
|
54
340
|
/**
|
|
55
341
|
* When this payment was created
|
|
56
342
|
*/
|
|
@@ -66,36 +352,40 @@ export declare namespace PaymentCreateResponse {
|
|
|
66
352
|
/**
|
|
67
353
|
* Payment status
|
|
68
354
|
*/
|
|
69
|
-
status: 'PROCESSING' | 'PENDING_CLAIM' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
|
|
355
|
+
status: 'CREATED' | 'PROCESSING' | 'PENDING_CLAIM' | 'IN_REVIEW' | 'COMPLETED' | 'FAILED' | 'APPROVAL_DENIED' | 'CANCELLED';
|
|
70
356
|
/**
|
|
71
357
|
* When this payment was last updated
|
|
72
358
|
*/
|
|
73
|
-
updatedAt: string;
|
|
359
|
+
updatedAt: string | null;
|
|
74
360
|
}
|
|
75
361
|
/**
|
|
76
362
|
* Resource relationships
|
|
77
363
|
*/
|
|
78
364
|
interface Relationships {
|
|
79
365
|
/**
|
|
80
|
-
*
|
|
366
|
+
* Recipient party for this payment, when known.
|
|
81
367
|
*/
|
|
82
|
-
|
|
368
|
+
recipient: Relationships.Recipient;
|
|
83
369
|
/**
|
|
84
|
-
* Party that
|
|
370
|
+
* Party that initiated the payment
|
|
85
371
|
*/
|
|
86
|
-
|
|
372
|
+
sender: Relationships.Sender;
|
|
373
|
+
/**
|
|
374
|
+
* Sender-side transaction row for this payment, when available.
|
|
375
|
+
*/
|
|
376
|
+
transaction: Relationships.Transaction;
|
|
87
377
|
}
|
|
88
378
|
namespace Relationships {
|
|
89
379
|
/**
|
|
90
|
-
*
|
|
380
|
+
* Recipient party for this payment, when known.
|
|
91
381
|
*/
|
|
92
|
-
interface
|
|
382
|
+
interface Recipient {
|
|
93
383
|
/**
|
|
94
384
|
* Related resource identifier
|
|
95
385
|
*/
|
|
96
|
-
data:
|
|
386
|
+
data: Recipient.Data | null;
|
|
97
387
|
}
|
|
98
|
-
namespace
|
|
388
|
+
namespace Recipient {
|
|
99
389
|
/**
|
|
100
390
|
* Related resource identifier
|
|
101
391
|
*/
|
|
@@ -108,15 +398,36 @@ export declare namespace PaymentCreateResponse {
|
|
|
108
398
|
}
|
|
109
399
|
}
|
|
110
400
|
/**
|
|
111
|
-
* Party that
|
|
401
|
+
* Party that initiated the payment
|
|
112
402
|
*/
|
|
113
|
-
interface
|
|
403
|
+
interface Sender {
|
|
114
404
|
/**
|
|
115
405
|
* Related resource identifier
|
|
116
406
|
*/
|
|
117
|
-
data:
|
|
407
|
+
data: Sender.Data;
|
|
118
408
|
}
|
|
119
|
-
namespace
|
|
409
|
+
namespace Sender {
|
|
410
|
+
/**
|
|
411
|
+
* Related resource identifier
|
|
412
|
+
*/
|
|
413
|
+
interface Data {
|
|
414
|
+
id: string;
|
|
415
|
+
/**
|
|
416
|
+
* Resource type
|
|
417
|
+
*/
|
|
418
|
+
type: string;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Sender-side transaction row for this payment, when available.
|
|
423
|
+
*/
|
|
424
|
+
interface Transaction {
|
|
425
|
+
/**
|
|
426
|
+
* Related resource identifier
|
|
427
|
+
*/
|
|
428
|
+
data: Transaction.Data | null;
|
|
429
|
+
}
|
|
430
|
+
namespace Transaction {
|
|
120
431
|
/**
|
|
121
432
|
* Related resource identifier
|
|
122
433
|
*/
|
|
@@ -137,9 +448,10 @@ export interface PaymentCreateParams {
|
|
|
137
448
|
*/
|
|
138
449
|
amount: number;
|
|
139
450
|
/**
|
|
140
|
-
* Body param: Recipient
|
|
451
|
+
* Body param: Recipient identifier. Provide exactly one typed email, phone, party
|
|
452
|
+
* ID, or agent ID value.
|
|
141
453
|
*/
|
|
142
|
-
counterparty:
|
|
454
|
+
counterparty: PaymentCreateParams.UnionMember0 | PaymentCreateParams.UnionMember1;
|
|
143
455
|
/**
|
|
144
456
|
* Header param: Unique key for idempotent request handling. If a request with the
|
|
145
457
|
* same key was already processed, the original response is returned.
|
|
@@ -155,7 +467,7 @@ export interface PaymentCreateParams {
|
|
|
155
467
|
*/
|
|
156
468
|
customerPartyId?: string;
|
|
157
469
|
/**
|
|
158
|
-
* Body param: Payment description
|
|
470
|
+
* Body param: Payment description. Maximum 500 characters.
|
|
159
471
|
*/
|
|
160
472
|
description?: string;
|
|
161
473
|
/**
|
|
@@ -168,7 +480,61 @@ export interface PaymentCreateParams {
|
|
|
168
480
|
*/
|
|
169
481
|
'X-Instance-ID'?: string;
|
|
170
482
|
}
|
|
483
|
+
export declare namespace PaymentCreateParams {
|
|
484
|
+
interface UnionMember0 {
|
|
485
|
+
type: string;
|
|
486
|
+
/**
|
|
487
|
+
* Email address
|
|
488
|
+
*/
|
|
489
|
+
value: string;
|
|
490
|
+
}
|
|
491
|
+
interface UnionMember1 {
|
|
492
|
+
type: string;
|
|
493
|
+
/**
|
|
494
|
+
* Phone number in E.164 format
|
|
495
|
+
*/
|
|
496
|
+
value: string;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
export interface PaymentListParams {
|
|
500
|
+
/**
|
|
501
|
+
* Query param: Pagination cursor from previous response
|
|
502
|
+
*/
|
|
503
|
+
cursor?: string;
|
|
504
|
+
/**
|
|
505
|
+
* Query param: Results per page
|
|
506
|
+
*/
|
|
507
|
+
limit?: number;
|
|
508
|
+
/**
|
|
509
|
+
* Query param: Party ID for delegated payment lookup
|
|
510
|
+
*/
|
|
511
|
+
partyId?: string;
|
|
512
|
+
/**
|
|
513
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
514
|
+
*/
|
|
515
|
+
'X-Agent-ID'?: string;
|
|
516
|
+
/**
|
|
517
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
518
|
+
* for agent observability.
|
|
519
|
+
*/
|
|
520
|
+
'X-Instance-ID'?: string;
|
|
521
|
+
}
|
|
522
|
+
export interface PaymentGetParams {
|
|
523
|
+
/**
|
|
524
|
+
* Query param: Party ID for delegated payment lookup
|
|
525
|
+
*/
|
|
526
|
+
partyId?: string;
|
|
527
|
+
/**
|
|
528
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
529
|
+
*/
|
|
530
|
+
'X-Agent-ID'?: string;
|
|
531
|
+
/**
|
|
532
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
533
|
+
* for agent observability.
|
|
534
|
+
*/
|
|
535
|
+
'X-Instance-ID'?: string;
|
|
536
|
+
}
|
|
171
537
|
export declare namespace Payments {
|
|
172
|
-
export { type PaymentCreateResponse as PaymentCreateResponse, type PaymentCreateParams as PaymentCreateParams, };
|
|
538
|
+
export { type PaymentCreateResponse as PaymentCreateResponse, type PaymentListResponse as PaymentListResponse, type PaymentGetResponse as PaymentGetResponse, type PaymentCreateParams as PaymentCreateParams, type PaymentListParams as PaymentListParams, type PaymentGetParams as PaymentGetParams, };
|
|
173
539
|
}
|
|
174
540
|
//# sourceMappingURL=payments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/resources/payments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../src/resources/payments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAqBhG;;;;;;;OAOG;IACH,IAAI,CACF,MAAM,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAelC;;;;;;;;;OASG;IACH,GAAG,CACD,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;CAclC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;CAClC;AAED,yBAAiB,qBAAqB,CAAC;IACrC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AEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
package/resources/payments.js
CHANGED
|
@@ -4,18 +4,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Payments = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
8
|
/**
|
|
8
|
-
* Payment
|
|
9
|
+
* Payment operations
|
|
9
10
|
*/
|
|
10
11
|
class Payments extends resource_1.APIResource {
|
|
11
12
|
/**
|
|
12
|
-
* Create a payment
|
|
13
|
+
* Create a payment.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
16
|
* ```ts
|
|
16
17
|
* const payment = await client.payments.create({
|
|
17
18
|
* amount: 1,
|
|
18
|
-
* counterparty:
|
|
19
|
+
* counterparty: {
|
|
20
|
+
* type: 'type',
|
|
21
|
+
* value: 'dev@stainless.com',
|
|
22
|
+
* },
|
|
19
23
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
20
24
|
* });
|
|
21
25
|
* ```
|
|
@@ -35,6 +39,52 @@ class Payments extends resource_1.APIResource {
|
|
|
35
39
|
]),
|
|
36
40
|
});
|
|
37
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* List payments initiated by the authenticated party.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const payments = await client.payments.list();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
list(params = {}, options) {
|
|
51
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
52
|
+
return this._client.get('/payments', {
|
|
53
|
+
query,
|
|
54
|
+
...options,
|
|
55
|
+
headers: (0, headers_1.buildHeaders)([
|
|
56
|
+
{
|
|
57
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
58
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
59
|
+
},
|
|
60
|
+
options?.headers,
|
|
61
|
+
]),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get a payment initiated by the authenticated party.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const payment = await client.payments.get(
|
|
70
|
+
* 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
get(paymentID, params = {}, options) {
|
|
75
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
76
|
+
return this._client.get((0, path_1.path) `/payments/${paymentID}`, {
|
|
77
|
+
query,
|
|
78
|
+
...options,
|
|
79
|
+
headers: (0, headers_1.buildHeaders)([
|
|
80
|
+
{
|
|
81
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
82
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
83
|
+
},
|
|
84
|
+
options?.headers,
|
|
85
|
+
]),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
38
88
|
}
|
|
39
89
|
exports.Payments = Payments;
|
|
40
90
|
//# sourceMappingURL=payments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../src/resources/payments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../src/resources/payments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EACJ,iBAAiB,EAAE,cAAc,EACjC,YAAY,EAAE,QAAQ,EACtB,eAAe,EAAE,WAAW,EAC5B,GAAG,IAAI,EACR,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE;YACpC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB;oBACE,iBAAiB,EAAE,cAAc;oBACjC,GAAG,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC9D,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;iBACxE;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CACF,SAA+C,EAAE,EACjD,OAAwB;QAExB,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,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1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
4
5
|
/**
|
|
5
|
-
* Payment
|
|
6
|
+
* Payment operations
|
|
6
7
|
*/
|
|
7
8
|
export class Payments extends APIResource {
|
|
8
9
|
/**
|
|
9
|
-
* Create a payment
|
|
10
|
+
* Create a payment.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* ```ts
|
|
13
14
|
* const payment = await client.payments.create({
|
|
14
15
|
* amount: 1,
|
|
15
|
-
* counterparty:
|
|
16
|
+
* counterparty: {
|
|
17
|
+
* type: 'type',
|
|
18
|
+
* value: 'dev@stainless.com',
|
|
19
|
+
* },
|
|
16
20
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
17
21
|
* });
|
|
18
22
|
* ```
|
|
@@ -32,5 +36,51 @@ export class Payments extends APIResource {
|
|
|
32
36
|
]),
|
|
33
37
|
});
|
|
34
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* List payments initiated by the authenticated party.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const payments = await client.payments.list();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
list(params = {}, options) {
|
|
48
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
49
|
+
return this._client.get('/payments', {
|
|
50
|
+
query,
|
|
51
|
+
...options,
|
|
52
|
+
headers: buildHeaders([
|
|
53
|
+
{
|
|
54
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
55
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
56
|
+
},
|
|
57
|
+
options?.headers,
|
|
58
|
+
]),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get a payment initiated by the authenticated party.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* const payment = await client.payments.get(
|
|
67
|
+
* 'pay_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
get(paymentID, params = {}, options) {
|
|
72
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
73
|
+
return this._client.get(path `/payments/${paymentID}`, {
|
|
74
|
+
query,
|
|
75
|
+
...options,
|
|
76
|
+
headers: buildHeaders([
|
|
77
|
+
{
|
|
78
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
79
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
80
|
+
},
|
|
81
|
+
options?.headers,
|
|
82
|
+
]),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
35
85
|
}
|
|
36
86
|
//# sourceMappingURL=payments.mjs.map
|