@paykit-sdk/mercadopago 1.0.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/README.md +178 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4932 -0
- package/dist/index.mjs +4928 -0
- package/dist/mercadopago-provider.d.mts +54 -0
- package/dist/mercadopago-provider.d.ts +54 -0
- package/dist/mercadopago-provider.js +4914 -0
- package/dist/mercadopago-provider.mjs +4912 -0
- package/dist/schema.d.mts +624 -0
- package/dist/schema.d.ts +624 -0
- package/dist/schema.js +2 -0
- package/dist/schema.mjs +1 -0
- package/dist/utils/mapper.d.mts +44 -0
- package/dist/utils/mapper.d.ts +44 -0
- package/dist/utils/mapper.js +169 -0
- package/dist/utils/mapper.mjs +162 -0
- package/package.json +46 -0
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
interface MercadoPagoErrorResponse {
|
|
2
|
+
/**
|
|
3
|
+
* The error message.
|
|
4
|
+
*/
|
|
5
|
+
message: string;
|
|
6
|
+
/**
|
|
7
|
+
* The error code.
|
|
8
|
+
*/
|
|
9
|
+
error: string;
|
|
10
|
+
/**
|
|
11
|
+
* The HTTP status code.
|
|
12
|
+
*/
|
|
13
|
+
status: number;
|
|
14
|
+
/**
|
|
15
|
+
* The cause of the error.
|
|
16
|
+
*/
|
|
17
|
+
cause?: Array<{
|
|
18
|
+
code: string | number;
|
|
19
|
+
description: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
interface MercadoPagoItem {
|
|
23
|
+
/**
|
|
24
|
+
* The item ID.
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* The item title.
|
|
29
|
+
*/
|
|
30
|
+
title: string;
|
|
31
|
+
/**
|
|
32
|
+
* The item description.
|
|
33
|
+
*/
|
|
34
|
+
description?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The item picture URL.
|
|
37
|
+
*/
|
|
38
|
+
picture_url?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The item category ID.
|
|
41
|
+
*/
|
|
42
|
+
category_id?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The item quantity.
|
|
45
|
+
*/
|
|
46
|
+
quantity: number;
|
|
47
|
+
/**
|
|
48
|
+
* The item currency ID.
|
|
49
|
+
*/
|
|
50
|
+
currency_id?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The item unit price.
|
|
53
|
+
*/
|
|
54
|
+
unit_price: number;
|
|
55
|
+
}
|
|
56
|
+
interface MercadoPagoPayer {
|
|
57
|
+
/**
|
|
58
|
+
* The payer name.
|
|
59
|
+
*/
|
|
60
|
+
name?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The payer surname.
|
|
63
|
+
*/
|
|
64
|
+
surname?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The payer email.
|
|
67
|
+
*/
|
|
68
|
+
email?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The payer phone.
|
|
71
|
+
*/
|
|
72
|
+
phone?: {
|
|
73
|
+
area_code?: string;
|
|
74
|
+
number?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
interface MercadoPagoBackUrls {
|
|
78
|
+
success?: string;
|
|
79
|
+
pending?: string;
|
|
80
|
+
failure?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The shape returned by `POST /checkout/preferences/` and
|
|
84
|
+
* `GET /checkout/preferences/:id` (Checkout Pro).
|
|
85
|
+
*/
|
|
86
|
+
interface MercadoPagoPreference {
|
|
87
|
+
/**
|
|
88
|
+
* The preference ID.
|
|
89
|
+
*/
|
|
90
|
+
id: string;
|
|
91
|
+
/**
|
|
92
|
+
* The client ID.
|
|
93
|
+
*/
|
|
94
|
+
client_id?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The collector ID.
|
|
97
|
+
*/
|
|
98
|
+
collector_id?: number;
|
|
99
|
+
/**
|
|
100
|
+
* The date the preference was created.
|
|
101
|
+
*/
|
|
102
|
+
date_created?: string;
|
|
103
|
+
/**
|
|
104
|
+
* The items in the preference.
|
|
105
|
+
*/
|
|
106
|
+
items: MercadoPagoItem[];
|
|
107
|
+
/**
|
|
108
|
+
* The payer.
|
|
109
|
+
*/
|
|
110
|
+
payer?: MercadoPagoPayer;
|
|
111
|
+
/**
|
|
112
|
+
* The back URLs.
|
|
113
|
+
*/
|
|
114
|
+
back_urls?: MercadoPagoBackUrls;
|
|
115
|
+
auto_return?: string;
|
|
116
|
+
/**
|
|
117
|
+
* The external reference.
|
|
118
|
+
*/
|
|
119
|
+
external_reference?: string | null;
|
|
120
|
+
/**
|
|
121
|
+
* The notification URL.
|
|
122
|
+
*/
|
|
123
|
+
notification_url?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* The metadata.
|
|
126
|
+
*/
|
|
127
|
+
metadata?: Record<string, unknown> | null;
|
|
128
|
+
/** Production Checkout Pro URL. */
|
|
129
|
+
/**
|
|
130
|
+
* The production Checkout Pro URL.
|
|
131
|
+
*/
|
|
132
|
+
init_point?: string;
|
|
133
|
+
/**
|
|
134
|
+
* The sandbox Checkout Pro URL.
|
|
135
|
+
*/
|
|
136
|
+
sandbox_init_point?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The operation type.
|
|
139
|
+
*/
|
|
140
|
+
operation_type?: string;
|
|
141
|
+
}
|
|
142
|
+
interface MercadoPagoPaymentMethod {
|
|
143
|
+
/**
|
|
144
|
+
* The payment method ID.
|
|
145
|
+
*/
|
|
146
|
+
id?: string;
|
|
147
|
+
/**
|
|
148
|
+
* The payment method type.
|
|
149
|
+
*/
|
|
150
|
+
type?: string;
|
|
151
|
+
/**
|
|
152
|
+
* The issuer ID.
|
|
153
|
+
*/
|
|
154
|
+
issuer_id?: string;
|
|
155
|
+
}
|
|
156
|
+
interface MercadoPagoPaymentPayer {
|
|
157
|
+
/**
|
|
158
|
+
* The payer type.
|
|
159
|
+
*/
|
|
160
|
+
type?: string;
|
|
161
|
+
/**
|
|
162
|
+
* The payer ID.
|
|
163
|
+
*/
|
|
164
|
+
id?: string;
|
|
165
|
+
/**
|
|
166
|
+
* The payer email.
|
|
167
|
+
*/
|
|
168
|
+
email?: string;
|
|
169
|
+
/**
|
|
170
|
+
* The payer first name.
|
|
171
|
+
*/
|
|
172
|
+
first_name?: string;
|
|
173
|
+
/**
|
|
174
|
+
* The payer last name.
|
|
175
|
+
*/
|
|
176
|
+
last_name?: string;
|
|
177
|
+
}
|
|
178
|
+
interface MercadoPagoPayment {
|
|
179
|
+
/**
|
|
180
|
+
* The payment ID.
|
|
181
|
+
*/
|
|
182
|
+
id: number;
|
|
183
|
+
/**
|
|
184
|
+
* The date the payment was created.
|
|
185
|
+
*/
|
|
186
|
+
date_created?: string;
|
|
187
|
+
/**
|
|
188
|
+
* The date the payment was approved.
|
|
189
|
+
*/
|
|
190
|
+
date_approved?: string | null;
|
|
191
|
+
/**
|
|
192
|
+
* The date the payment was last updated.
|
|
193
|
+
*/
|
|
194
|
+
date_last_updated?: string;
|
|
195
|
+
/**
|
|
196
|
+
* The date the payment was released.
|
|
197
|
+
*/
|
|
198
|
+
money_release_date?: string;
|
|
199
|
+
/**
|
|
200
|
+
* The operation type.
|
|
201
|
+
*/
|
|
202
|
+
operation_type?: string;
|
|
203
|
+
/**
|
|
204
|
+
* The payment method ID.
|
|
205
|
+
*/
|
|
206
|
+
payment_method_id?: string;
|
|
207
|
+
/**
|
|
208
|
+
* The payment type ID.
|
|
209
|
+
*/
|
|
210
|
+
payment_type_id?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The payment method.
|
|
213
|
+
*/
|
|
214
|
+
payment_method?: MercadoPagoPaymentMethod;
|
|
215
|
+
/**
|
|
216
|
+
* The status of the payment.
|
|
217
|
+
*/
|
|
218
|
+
status: string;
|
|
219
|
+
/**
|
|
220
|
+
* The status detail of the payment.
|
|
221
|
+
*/
|
|
222
|
+
status_detail?: string;
|
|
223
|
+
/**
|
|
224
|
+
* The currency ID of the payment.
|
|
225
|
+
*/
|
|
226
|
+
currency_id: string;
|
|
227
|
+
/**
|
|
228
|
+
* The description of the payment.
|
|
229
|
+
*/
|
|
230
|
+
description?: string | null;
|
|
231
|
+
/**
|
|
232
|
+
* Whether the payment is in live mode.
|
|
233
|
+
*/
|
|
234
|
+
live_mode?: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* The external reference of the payment.
|
|
237
|
+
*/
|
|
238
|
+
external_reference?: string | null;
|
|
239
|
+
/**
|
|
240
|
+
* The transaction amount of the payment.
|
|
241
|
+
*/
|
|
242
|
+
transaction_amount: number;
|
|
243
|
+
/**
|
|
244
|
+
* The transaction amount refunded of the payment.
|
|
245
|
+
*/
|
|
246
|
+
transaction_amount_refunded?: number;
|
|
247
|
+
/**
|
|
248
|
+
* The installments of the payment.
|
|
249
|
+
*/
|
|
250
|
+
installments?: number;
|
|
251
|
+
/**
|
|
252
|
+
* Whether the payment was captured.
|
|
253
|
+
*/
|
|
254
|
+
captured?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Whether the payment is in binary mode.
|
|
257
|
+
*/
|
|
258
|
+
binary_mode?: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* The notification URL of the payment.
|
|
261
|
+
*/
|
|
262
|
+
notification_url?: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* The payer of the payment.
|
|
265
|
+
*/
|
|
266
|
+
payer?: MercadoPagoPaymentPayer;
|
|
267
|
+
/**
|
|
268
|
+
* The metadata of the payment.
|
|
269
|
+
*/
|
|
270
|
+
metadata?: Record<string, unknown> | null;
|
|
271
|
+
/**
|
|
272
|
+
* The refunds of the payment.
|
|
273
|
+
*/
|
|
274
|
+
refunds?: MercadoPagoRefund[];
|
|
275
|
+
/**
|
|
276
|
+
* The order of the payment.
|
|
277
|
+
*/
|
|
278
|
+
order?: {
|
|
279
|
+
id?: number;
|
|
280
|
+
type?: string;
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* The point of interaction of the payment.
|
|
284
|
+
*/
|
|
285
|
+
point_of_interaction?: {
|
|
286
|
+
/**
|
|
287
|
+
* The type of the point of interaction.
|
|
288
|
+
*/
|
|
289
|
+
type?: string;
|
|
290
|
+
/**
|
|
291
|
+
* The transaction data of the point of interaction.
|
|
292
|
+
*/
|
|
293
|
+
transaction_data?: {
|
|
294
|
+
/**
|
|
295
|
+
* The subscription ID of the transaction data.
|
|
296
|
+
*/
|
|
297
|
+
subscription_id?: string;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* The shape returned by `POST /v1/payments/:id/refunds` and
|
|
303
|
+
* `GET /v1/payments/:id/refunds/:refund_id`.
|
|
304
|
+
*/
|
|
305
|
+
interface MercadoPagoRefund {
|
|
306
|
+
/**
|
|
307
|
+
* The refund ID.
|
|
308
|
+
*/
|
|
309
|
+
id: number;
|
|
310
|
+
/**
|
|
311
|
+
* The payment ID.
|
|
312
|
+
*/
|
|
313
|
+
payment_id: number;
|
|
314
|
+
/**
|
|
315
|
+
* The refund amount.
|
|
316
|
+
*/
|
|
317
|
+
amount: number;
|
|
318
|
+
/**
|
|
319
|
+
* The refund metadata.
|
|
320
|
+
*/
|
|
321
|
+
metadata?: Record<string, unknown> | null;
|
|
322
|
+
/**
|
|
323
|
+
* The refund source.
|
|
324
|
+
*/
|
|
325
|
+
source?: {
|
|
326
|
+
id: string;
|
|
327
|
+
name: string;
|
|
328
|
+
type: string;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* The date the refund was created.
|
|
332
|
+
*/
|
|
333
|
+
date_created?: string;
|
|
334
|
+
/**
|
|
335
|
+
* The status of the refund.
|
|
336
|
+
*/
|
|
337
|
+
status?: string;
|
|
338
|
+
/**
|
|
339
|
+
* The reason for the refund.
|
|
340
|
+
*/
|
|
341
|
+
reason?: string | null;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* The shape returned by `POST /v1/customers`, `GET /v1/customers/:id`,
|
|
345
|
+
* and `PUT /v1/customers/:id`.
|
|
346
|
+
*/
|
|
347
|
+
interface MercadoPagoCustomer {
|
|
348
|
+
/**
|
|
349
|
+
* The customer ID.
|
|
350
|
+
*/
|
|
351
|
+
id: string;
|
|
352
|
+
/**
|
|
353
|
+
* The customer email.
|
|
354
|
+
*/
|
|
355
|
+
email: string;
|
|
356
|
+
/**
|
|
357
|
+
* The customer first name.
|
|
358
|
+
*/
|
|
359
|
+
first_name?: string | null;
|
|
360
|
+
/**
|
|
361
|
+
* The customer last name.
|
|
362
|
+
*/
|
|
363
|
+
last_name?: string | null;
|
|
364
|
+
/**
|
|
365
|
+
* The customer phone.
|
|
366
|
+
*/
|
|
367
|
+
phone?: {
|
|
368
|
+
area_code?: string;
|
|
369
|
+
number?: string;
|
|
370
|
+
} | null;
|
|
371
|
+
/**
|
|
372
|
+
* The customer identification.
|
|
373
|
+
*/
|
|
374
|
+
identification?: {
|
|
375
|
+
type?: string;
|
|
376
|
+
number?: string;
|
|
377
|
+
} | null;
|
|
378
|
+
/**
|
|
379
|
+
* The customer default address.
|
|
380
|
+
*/
|
|
381
|
+
default_address?: string | null;
|
|
382
|
+
/**
|
|
383
|
+
* The date the customer was registered.
|
|
384
|
+
*/
|
|
385
|
+
date_registered?: string | null;
|
|
386
|
+
/**
|
|
387
|
+
* The customer description.
|
|
388
|
+
*/
|
|
389
|
+
description?: string | null;
|
|
390
|
+
/**
|
|
391
|
+
* The date the customer was created.
|
|
392
|
+
*/
|
|
393
|
+
date_created?: string;
|
|
394
|
+
/**
|
|
395
|
+
* The date the customer was last updated.
|
|
396
|
+
*/
|
|
397
|
+
date_last_updated?: string;
|
|
398
|
+
/**
|
|
399
|
+
* The customer default card.
|
|
400
|
+
*/
|
|
401
|
+
default_card?: string | null;
|
|
402
|
+
/**
|
|
403
|
+
* Whether the customer is in live mode.
|
|
404
|
+
*/
|
|
405
|
+
live_mode?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* The customer metadata.
|
|
408
|
+
*/
|
|
409
|
+
metadata?: Record<string, unknown> | null;
|
|
410
|
+
}
|
|
411
|
+
interface MercadoPagoAutoRecurring {
|
|
412
|
+
/**
|
|
413
|
+
* The frequency.
|
|
414
|
+
*/
|
|
415
|
+
frequency: number;
|
|
416
|
+
/**
|
|
417
|
+
* The frequency type.
|
|
418
|
+
*/
|
|
419
|
+
frequency_type: string;
|
|
420
|
+
/**
|
|
421
|
+
* The transaction amount.
|
|
422
|
+
*/
|
|
423
|
+
transaction_amount?: number;
|
|
424
|
+
/**
|
|
425
|
+
* The currency ID.
|
|
426
|
+
*/
|
|
427
|
+
currency_id: string;
|
|
428
|
+
/**
|
|
429
|
+
* The free trial.
|
|
430
|
+
*/
|
|
431
|
+
free_trial?: {
|
|
432
|
+
frequency: number;
|
|
433
|
+
frequency_type: string;
|
|
434
|
+
} | null;
|
|
435
|
+
/**
|
|
436
|
+
* The start date.
|
|
437
|
+
*/
|
|
438
|
+
start_date?: string;
|
|
439
|
+
/**
|
|
440
|
+
* The end date.
|
|
441
|
+
*/
|
|
442
|
+
end_date?: string;
|
|
443
|
+
}
|
|
444
|
+
interface MercadoPagoPreApproval {
|
|
445
|
+
/**
|
|
446
|
+
* The preapproval ID.
|
|
447
|
+
*/
|
|
448
|
+
id: string;
|
|
449
|
+
/**
|
|
450
|
+
* The payer ID.
|
|
451
|
+
*/
|
|
452
|
+
payer_id?: number;
|
|
453
|
+
/**
|
|
454
|
+
* The payer email.
|
|
455
|
+
*/
|
|
456
|
+
payer_email?: string;
|
|
457
|
+
/**
|
|
458
|
+
* The collector ID.
|
|
459
|
+
*/
|
|
460
|
+
collector_id?: number;
|
|
461
|
+
/**
|
|
462
|
+
* The application ID.
|
|
463
|
+
*/
|
|
464
|
+
application_id?: number;
|
|
465
|
+
/**
|
|
466
|
+
* The status of the preapproval.
|
|
467
|
+
*/
|
|
468
|
+
status: string;
|
|
469
|
+
/**
|
|
470
|
+
* The reason for the preapproval.
|
|
471
|
+
*/
|
|
472
|
+
reason?: string;
|
|
473
|
+
/**
|
|
474
|
+
* The external reference.
|
|
475
|
+
*/
|
|
476
|
+
external_reference?: string | null;
|
|
477
|
+
/**
|
|
478
|
+
* The date the preapproval was created.
|
|
479
|
+
*/
|
|
480
|
+
date_created?: string;
|
|
481
|
+
/**
|
|
482
|
+
* The date the preapproval was last modified.
|
|
483
|
+
*/
|
|
484
|
+
last_modified?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The production Checkout Pro URL.
|
|
487
|
+
*/
|
|
488
|
+
init_point?: string;
|
|
489
|
+
/**
|
|
490
|
+
* The sandbox Checkout Pro URL.
|
|
491
|
+
*/
|
|
492
|
+
sandbox_init_point?: string;
|
|
493
|
+
/**
|
|
494
|
+
* The auto recurring.
|
|
495
|
+
*/
|
|
496
|
+
auto_recurring: MercadoPagoAutoRecurring;
|
|
497
|
+
/**
|
|
498
|
+
* The payment method ID.
|
|
499
|
+
*/
|
|
500
|
+
payment_method_id?: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* The first invoice offset.
|
|
503
|
+
*/
|
|
504
|
+
first_invoice_offset?: number | null;
|
|
505
|
+
/**
|
|
506
|
+
* The back URL.
|
|
507
|
+
*/
|
|
508
|
+
back_url?: string;
|
|
509
|
+
/**
|
|
510
|
+
* The next payment date.
|
|
511
|
+
*/
|
|
512
|
+
next_payment_date?: string;
|
|
513
|
+
/**
|
|
514
|
+
* The preapproval plan ID.
|
|
515
|
+
*/
|
|
516
|
+
preapproval_plan_id?: string;
|
|
517
|
+
}
|
|
518
|
+
interface MercadoPagoAuthorizedPayment {
|
|
519
|
+
/**
|
|
520
|
+
* The authorized payment ID.
|
|
521
|
+
*/
|
|
522
|
+
id: number;
|
|
523
|
+
/**
|
|
524
|
+
* The type of the authorized payment.
|
|
525
|
+
*/
|
|
526
|
+
type: string;
|
|
527
|
+
/**
|
|
528
|
+
* The date the authorized payment was created.
|
|
529
|
+
*/
|
|
530
|
+
date_created?: string;
|
|
531
|
+
/**
|
|
532
|
+
* The date the authorized payment was last modified.
|
|
533
|
+
*/
|
|
534
|
+
last_modified?: string;
|
|
535
|
+
/**
|
|
536
|
+
* The preapproval ID.
|
|
537
|
+
*/
|
|
538
|
+
preapproval_id: string;
|
|
539
|
+
/**
|
|
540
|
+
* The reason for the authorized payment.
|
|
541
|
+
*/
|
|
542
|
+
reason?: string;
|
|
543
|
+
/**
|
|
544
|
+
* The external reference.
|
|
545
|
+
*/
|
|
546
|
+
external_reference?: string | number | null;
|
|
547
|
+
/**
|
|
548
|
+
* The currency ID.
|
|
549
|
+
*/
|
|
550
|
+
currency_id: string;
|
|
551
|
+
/**
|
|
552
|
+
* The transaction amount.
|
|
553
|
+
*/
|
|
554
|
+
transaction_amount: string | number;
|
|
555
|
+
/**
|
|
556
|
+
* The date the authorized payment was debited.
|
|
557
|
+
*/
|
|
558
|
+
debit_date?: string;
|
|
559
|
+
/**
|
|
560
|
+
* The retry attempt.
|
|
561
|
+
*/
|
|
562
|
+
retry_attempt?: number;
|
|
563
|
+
/**
|
|
564
|
+
* The status of the authorized payment.
|
|
565
|
+
*/
|
|
566
|
+
status: string;
|
|
567
|
+
/**
|
|
568
|
+
* Whether the authorized payment was summarized.
|
|
569
|
+
*/
|
|
570
|
+
summarized?: string;
|
|
571
|
+
/**
|
|
572
|
+
* The payment of the authorized payment.
|
|
573
|
+
*/
|
|
574
|
+
payment?: {
|
|
575
|
+
id: number;
|
|
576
|
+
status: string;
|
|
577
|
+
status_detail?: string;
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
type MercadoPagoRawEvents = {
|
|
581
|
+
'mercadopago.payment.created': MercadoPagoWebhookEvent;
|
|
582
|
+
'mercadopago.payment.updated': MercadoPagoWebhookEvent;
|
|
583
|
+
'mercadopago.subscription_preapproval.created': MercadoPagoWebhookEvent;
|
|
584
|
+
'mercadopago.subscription_preapproval.updated': MercadoPagoWebhookEvent;
|
|
585
|
+
'mercadopago.subscription_authorized_payment.created': MercadoPagoWebhookEvent;
|
|
586
|
+
'mercadopago.subscription_authorized_payment.updated': MercadoPagoWebhookEvent;
|
|
587
|
+
};
|
|
588
|
+
type StripMercadoPagoPrefix<T> = T extends `mercadopago.${infer Rest}` ? Rest : T;
|
|
589
|
+
type MercadoPagoAction = StripMercadoPagoPrefix<keyof MercadoPagoRawEvents> | (string & {});
|
|
590
|
+
interface MercadoPagoWebhookEvent {
|
|
591
|
+
id: number;
|
|
592
|
+
/**
|
|
593
|
+
* Whether the webhook event is in live mode.
|
|
594
|
+
*/
|
|
595
|
+
live_mode: boolean;
|
|
596
|
+
/**
|
|
597
|
+
* The notification topic
|
|
598
|
+
*/
|
|
599
|
+
type: 'payment' | 'subscription_preapproval' | 'subscription_preapproval_plan' | 'subscription_authorized_payment' | (string & {});
|
|
600
|
+
/**
|
|
601
|
+
* The date the webhook event was created.
|
|
602
|
+
*/
|
|
603
|
+
date_created: string;
|
|
604
|
+
/**
|
|
605
|
+
* The user ID.
|
|
606
|
+
*/
|
|
607
|
+
user_id: number;
|
|
608
|
+
/**
|
|
609
|
+
* The API version.
|
|
610
|
+
*/
|
|
611
|
+
api_version: string;
|
|
612
|
+
/**
|
|
613
|
+
* The specific action within `type`, e.g. `payment.created`.
|
|
614
|
+
*/
|
|
615
|
+
action: MercadoPagoAction;
|
|
616
|
+
/**
|
|
617
|
+
* The data of the webhook event.
|
|
618
|
+
*/
|
|
619
|
+
data: {
|
|
620
|
+
id: string;
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export type { MercadoPagoAuthorizedPayment, MercadoPagoAutoRecurring, MercadoPagoBackUrls, MercadoPagoCustomer, MercadoPagoErrorResponse, MercadoPagoItem, MercadoPagoPayer, MercadoPagoPayment, MercadoPagoPaymentMethod, MercadoPagoPaymentPayer, MercadoPagoPreApproval, MercadoPagoPreference, MercadoPagoRawEvents, MercadoPagoRefund, MercadoPagoWebhookEvent };
|