@miguelmorales13/nestkit 0.11.0 → 0.16.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.
Files changed (90) hide show
  1. package/README.md +469 -9
  2. package/dist/audit/audit.module.d.ts +23 -0
  3. package/dist/audit/audit.options.d.ts +16 -0
  4. package/dist/audit/audit.port.d.ts +37 -0
  5. package/dist/audit/audit.service.d.ts +29 -0
  6. package/dist/audit/index.cjs +72 -0
  7. package/dist/audit/index.d.ts +7 -0
  8. package/dist/audit/index.js +72 -0
  9. package/dist/audit/sinks.d.ts +18 -0
  10. package/dist/auth/index.cjs +4 -3
  11. package/dist/auth/index.js +2 -1
  12. package/dist/auth/oauth/index.cjs +6 -5
  13. package/dist/auth/oauth/index.js +2 -1
  14. package/dist/bootstrap/index.cjs +6 -5
  15. package/dist/bootstrap/index.js +5 -4
  16. package/dist/chunk-47FXU74G.cjs +205 -0
  17. package/dist/{chunk-54ZXIB5T.cjs → chunk-4GT66KQS.cjs} +4 -4
  18. package/dist/{chunk-J7TURDAL.cjs → chunk-67B7IYAV.cjs} +2 -2
  19. package/dist/{chunk-NVCI3CQI.cjs → chunk-C5DV4RAX.cjs} +6 -1
  20. package/dist/{chunk-KDAA6GFF.js → chunk-DABTRWA6.js} +12 -7
  21. package/dist/{chunk-ZA56XBCK.cjs → chunk-EBPEMVZU.cjs} +15 -0
  22. package/dist/{chunk-EYURGACO.js → chunk-JV4EAOF2.js} +1 -1
  23. package/dist/chunk-KP2ZHJSR.js +35 -0
  24. package/dist/{chunk-7I2Y7V52.js → chunk-KRC47OX6.js} +1 -1
  25. package/dist/chunk-LK3OINS7.js +205 -0
  26. package/dist/{chunk-A3B2EY4V.js → chunk-MLOQDUBN.js} +6 -1
  27. package/dist/chunk-TCAMLNUZ.js +27 -0
  28. package/dist/{chunk-V2M75FN3.cjs → chunk-U7QK24HL.cjs} +2 -2
  29. package/dist/{chunk-AOCF5QCZ.js → chunk-UIVBPNH4.js} +4 -4
  30. package/dist/{chunk-TJHRABML.cjs → chunk-UWDHAZVE.cjs} +12 -7
  31. package/dist/chunk-XHW4CTBS.js +57 -0
  32. package/dist/chunk-XX5ROVSC.cjs +57 -0
  33. package/dist/chunk-Y72D5L6I.cjs +27 -0
  34. package/dist/crud/crud.controller.d.ts +3 -1
  35. package/dist/crud/crud.service.d.ts +63 -4
  36. package/dist/crud/index.cjs +7 -2
  37. package/dist/crud/index.d.ts +2 -1
  38. package/dist/crud/index.js +6 -1
  39. package/dist/crud/list-query.dto.d.ts +23 -0
  40. package/dist/crud/repository.port.d.ts +33 -1
  41. package/dist/errors/index.cjs +4 -4
  42. package/dist/errors/index.js +4 -4
  43. package/dist/idempotency/idempotency.interceptor.d.ts +35 -0
  44. package/dist/idempotency/idempotency.module.d.ts +27 -0
  45. package/dist/idempotency/idempotency.options.d.ts +29 -0
  46. package/dist/idempotency/idempotency.port.d.ts +43 -0
  47. package/dist/idempotency/index.cjs +206 -0
  48. package/dist/idempotency/index.d.ts +7 -0
  49. package/dist/idempotency/index.js +206 -0
  50. package/dist/idempotency/memory.store.d.ts +24 -0
  51. package/dist/index.cjs +26 -15
  52. package/dist/index.js +27 -16
  53. package/dist/invoicing/adapters/facturama.invoicing.d.ts +50 -0
  54. package/dist/invoicing/adapters/facturapi.invoicing.d.ts +35 -0
  55. package/dist/invoicing/amounts.d.ts +52 -0
  56. package/dist/invoicing/index.cjs +577 -0
  57. package/dist/invoicing/index.d.ts +11 -0
  58. package/dist/invoicing/index.js +577 -0
  59. package/dist/invoicing/invoicing.module.d.ts +42 -0
  60. package/dist/invoicing/invoicing.options.d.ts +51 -0
  61. package/dist/invoicing/invoicing.port.d.ts +156 -0
  62. package/dist/invoicing/lines.d.ts +21 -0
  63. package/dist/invoicing/provider-http.d.ts +21 -0
  64. package/dist/payments/adapters/clip.terminal.d.ts +101 -0
  65. package/dist/payments/adapters/mercadopago.terminal.d.ts +74 -0
  66. package/dist/payments/index.cjs +795 -0
  67. package/dist/payments/index.d.ts +12 -0
  68. package/dist/payments/index.js +795 -0
  69. package/dist/payments/money.d.ts +20 -0
  70. package/dist/payments/payments-webhook.controller.d.ts +30 -0
  71. package/dist/payments/payments.module.d.ts +45 -0
  72. package/dist/payments/payments.options.d.ts +84 -0
  73. package/dist/payments/payments.port.d.ts +174 -0
  74. package/dist/payments/provider-http.d.ts +26 -0
  75. package/dist/response/api-response.d.ts +7 -0
  76. package/dist/response/index.cjs +12 -4
  77. package/dist/response/index.d.ts +2 -0
  78. package/dist/response/index.js +12 -4
  79. package/dist/response/paginated.d.ts +25 -0
  80. package/dist/response/response.interceptor.d.ts +4 -0
  81. package/dist/tracking/index.cjs +3 -3
  82. package/dist/tracking/index.d.ts +1 -1
  83. package/dist/tracking/index.js +2 -2
  84. package/dist/tracking/request-context.d.ts +22 -0
  85. package/package.json +25 -3
  86. package/dist/chunk-3CLYZC3T.cjs +0 -104
  87. package/dist/chunk-EBO6UKHL.js +0 -20
  88. package/dist/chunk-JOVBJDJ2.js +0 -104
  89. /package/dist/{chunk-MR2IFCZE.cjs → chunk-H2EHN366.cjs} +0 -0
  90. /package/dist/{chunk-NAK4WDKS.js → chunk-ODPSIFOB.js} +0 -0
@@ -0,0 +1,156 @@
1
+ /**
2
+ * DI token for the invoicing adapter. Inject with
3
+ * `@Inject(INVOICING) invoicing: InvoicingPort`.
4
+ */
5
+ export declare const INVOICING: unique symbol;
6
+ /** `TipoDeComprobante`: income, egress, transfer, payroll, payment. */
7
+ export type CfdiType = 'I' | 'E' | 'T' | 'N' | 'P';
8
+ /**
9
+ * `MetodoPago`. `PUE` is paid in one go; `PPD` is paid later or in
10
+ * instalments, and **obliges you to issue a payment complement** (a `type: 'P'`
11
+ * CFDI) for every payment received afterwards. Choosing PPD and never issuing
12
+ * the complement is the most common way a business ends up with an invoice the
13
+ * SAT considers unfinished.
14
+ */
15
+ export type PaymentMethod = 'PUE' | 'PPD';
16
+ /**
17
+ * Why an invoice is being cancelled. Mandatory since the 2022 rules — there is
18
+ * no cancellation without one:
19
+ *
20
+ * - `01` issued with errors, replaced by another invoice (needs `substitutionId`)
21
+ * - `02` issued with errors, not replaced
22
+ * - `03` the operation never happened
23
+ * - `04` nominative operation related to a global invoice
24
+ */
25
+ export type CancelMotive = '01' | '02' | '03' | '04';
26
+ export type InvoiceStatus = 'draft' | 'stamped' | 'cancelled' | 'pending' | 'unknown';
27
+ /**
28
+ * The receiver.
29
+ *
30
+ * `legalName`, `taxSystem` and `zip` have to match what the SAT has on file for
31
+ * that RFC, character for character — CFDI 4.0 validates them against the
32
+ * padrón. A name with `S.A. de C.V.` when the SAT stored it without, or last
33
+ * year's postal code, is rejected at stamping time, and the message names the
34
+ * field but not the right value. Ask the customer for their *constancia de
35
+ * situación fiscal* instead of typing what is on the invoice they sent you.
36
+ */
37
+ export interface InvoiceCustomer {
38
+ /** RFC. */
39
+ taxId: string;
40
+ /** Razón social exactly as the SAT holds it. */
41
+ legalName: string;
42
+ /** Régimen fiscal, e.g. `601` (general de ley), `626` (RESICO), `616` (sin obligaciones). */
43
+ taxSystem: string;
44
+ /** Código postal of the receiver's tax domicile. */
45
+ zip: string;
46
+ /** `UsoCFDI`, e.g. `G01` acquisition of goods, `G03` general expenses, `S01` no tax effect. */
47
+ use?: string;
48
+ email?: string;
49
+ }
50
+ export interface InvoiceTax {
51
+ type: 'IVA' | 'ISR' | 'IEPS';
52
+ /** Decimal rate as the SAT writes it: `0.16`, `0.08`, `0.106666`. */
53
+ rate: number;
54
+ /** A withholding (retención) rather than a transfer (traslado). */
55
+ withholding?: boolean;
56
+ }
57
+ export interface InvoiceItem {
58
+ description: string;
59
+ /** `ClaveProdServ` from the SAT catalogue. */
60
+ productKey: string;
61
+ /** `ClaveUnidad`. Defaults to `H87` (pieza). */
62
+ unitKey?: string;
63
+ /** Free-text unit name shown on the PDF. */
64
+ unitName?: string;
65
+ /** Defaults to 1. May be fractional — kilos, litres, hours. */
66
+ quantity?: number;
67
+ /** Unit price in integer cents. Use this unless you genuinely need more than two decimals. */
68
+ unitPriceCents?: number;
69
+ /**
70
+ * Unit price as an exact decimal string, up to six places — per-litre or
71
+ * per-kilo pricing. Passed through untouched; never parsed into a float and
72
+ * printed back.
73
+ */
74
+ unitPrice?: string;
75
+ /** `NoIdentificacion`: your own SKU. */
76
+ sku?: string;
77
+ /** Defaults to a single 16% transferred IVA. Pass `[]` for something genuinely untaxed. */
78
+ taxes?: InvoiceTax[];
79
+ /** `ObjetoImp`. Defaults to `02` (subject to tax); `01` is not subject. */
80
+ taxObject?: string;
81
+ }
82
+ export interface InvoiceDraft {
83
+ /** The receiver, inline — or the id of one already stored at the provider. */
84
+ customer: InvoiceCustomer | string;
85
+ items: InvoiceItem[];
86
+ /** `FormaPago`: `01` cash, `03` transfer, `04` credit card, `28` debit card, `99` to be defined. */
87
+ paymentForm: string;
88
+ /** Defaults to `PUE`. */
89
+ paymentMethod?: PaymentMethod;
90
+ /** `UsoCFDI` for this invoice, when it differs from the customer's default. */
91
+ use?: string;
92
+ /** Defaults to `I` (ingreso). */
93
+ type?: CfdiType;
94
+ /** Defaults to `MXN`. */
95
+ currency?: string;
96
+ /** `TipoCambio`, required by the SAT whenever the currency is not MXN. */
97
+ exchangeRate?: number;
98
+ series?: string;
99
+ folioNumber?: number;
100
+ /** Your own id for this invoice, echoed back by the provider. */
101
+ externalId?: string;
102
+ }
103
+ export interface Invoice {
104
+ /** The provider's id — what every other method here takes. */
105
+ id: string;
106
+ provider: string;
107
+ status: InvoiceStatus;
108
+ /** Folio fiscal. Present once it is actually stamped. */
109
+ uuid?: string;
110
+ series?: string;
111
+ folioNumber?: number;
112
+ subtotalCents?: number;
113
+ totalCents: number;
114
+ currency: string;
115
+ customerTaxId?: string;
116
+ issuedAt?: Date;
117
+ raw: unknown;
118
+ }
119
+ /**
120
+ * One port, several PACs. Nothing above this interface knows which one stamps.
121
+ *
122
+ * The port models the **invoice**, not the XML. Providers that build and sign
123
+ * the CFDI for you (Facturapi, Facturama) fit behind it; a PAC that only stamps
124
+ * an XML you sealed yourself with your own CSD is a different job — you would
125
+ * be generating the document, and this library does not do that.
126
+ *
127
+ * What it does do, before either adapter sees the draft, is the arithmetic:
128
+ * line amount, tax, total, in integer cents. Facturapi recomputes and would
129
+ * forgive a bad number; Facturama prints ours onto the document. One
130
+ * calculation, one answer, whichever is registered.
131
+ */
132
+ export interface InvoicingPort {
133
+ /** Which PAC this is: `'facturapi'`, `'facturama'`. */
134
+ readonly provider: string;
135
+ /** Build, sign and stamp an invoice. In a test environment it is validated but not sent to the SAT. */
136
+ issue(draft: InvoiceDraft): Promise<Invoice>;
137
+ get(id: string): Promise<Invoice>;
138
+ /**
139
+ * Cancel a stamped invoice. `motive` is mandatory, and `01` also requires the
140
+ * id of the invoice that replaces this one.
141
+ *
142
+ * Cancelling is a request, not a command: outside the allowed window, or when
143
+ * the receiver has to authorise it, the SAT leaves it pending and the status
144
+ * only settles later. Read it back rather than assuming it worked.
145
+ */
146
+ cancel(id: string, options: {
147
+ motive: CancelMotive;
148
+ substitutionId?: string;
149
+ }): Promise<Invoice>;
150
+ /** The printed representation, as bytes. */
151
+ pdf(id: string): Promise<Uint8Array>;
152
+ /** The stamped XML — the document that legally matters, the PDF is a courtesy. */
153
+ xml(id: string): Promise<string>;
154
+ /** Send it to the receiver. Defaults to the email on the customer record. */
155
+ sendByEmail(id: string, to?: string): Promise<void>;
156
+ }
@@ -0,0 +1,21 @@
1
+ import { centsToDecimal } from './amounts.js';
2
+ import type { InvoiceItem, InvoiceTax } from './invoicing.port.js';
3
+ /** Every number a line needs, computed once, in cents. */
4
+ export interface ComputedLine {
5
+ item: InvoiceItem;
6
+ quantity: number;
7
+ unitPriceDecimal: string;
8
+ amountCents: number;
9
+ taxes: {
10
+ tax: InvoiceTax;
11
+ baseCents: number;
12
+ amountCents: number;
13
+ }[];
14
+ /** Amount plus transfers minus withholdings. */
15
+ totalCents: number;
16
+ }
17
+ export declare function computeLine(item: InvoiceItem): ComputedLine;
18
+ export declare function computeLines(items: InvoiceItem[]): ComputedLine[];
19
+ export declare function sumCents(lines: ComputedLine[], field: 'amountCents' | 'totalCents'): number;
20
+ /** Convenience for adapters that print the numbers rather than recompute them. */
21
+ export declare const decimal: typeof centsToDecimal;
@@ -0,0 +1,21 @@
1
+ import { AppException } from '../errors/app.exception.js';
2
+ /**
3
+ * A call to the PAC that came back wrong.
4
+ *
5
+ * 502, not the PAC's own status: a stamping rejection is not the caller's
6
+ * request being malformed, and turning a 400 from the SAT into a 400 for your
7
+ * client sends them to fix something they did not break. The original status
8
+ * and body stay in `details` — with a CFDI that matters more than usual,
9
+ * because the SAT's message names the field that failed validation.
10
+ */
11
+ export declare class InvoicingProviderException extends AppException {
12
+ constructor(provider: string, status: number, body: unknown, message?: string);
13
+ }
14
+ /** Thrown when an adapter is asked for something its PAC does not do. */
15
+ export declare class UnsupportedByProviderException extends AppException {
16
+ constructor(provider: string, message: string);
17
+ }
18
+ /** JSON in, JSON out, with any non-2xx turned into {@link InvoicingProviderException}. */
19
+ export declare function requestJson<T>(provider: string, fetchImpl: typeof fetch, url: string, init: RequestInit): Promise<T>;
20
+ /** For endpoints that answer with the file itself rather than with JSON. */
21
+ export declare function requestBytes(provider: string, fetchImpl: typeof fetch, url: string, init: RequestInit): Promise<Uint8Array>;
@@ -0,0 +1,101 @@
1
+ import type { ClipPinpadOptions } from '../payments.options.js';
2
+ import type { ChargeInput, Terminal, TerminalPayment, TerminalPaymentsPort, TerminalWebhookEvent, WebhookRequestLike } from '../payments.port.js';
3
+ /** One settled card transaction behind a PinPad charge. Its id is what a refund takes. */
4
+ export interface ClipTransaction {
5
+ id?: string;
6
+ transaction_id?: string;
7
+ status?: string;
8
+ amount?: string | number;
9
+ paid_amount?: string | number;
10
+ amount_refunded?: string | number;
11
+ }
12
+ /**
13
+ * Clip card readers over the PinPad API.
14
+ *
15
+ * Two things to know before wiring this up, because neither is recoverable in
16
+ * code: the API has **no sandbox** (it runs against production and a physical
17
+ * reader only), and the reader's serial number must be **registered with Clip**
18
+ * beforehand. Until then every charge comes back "unable to connect to pinpad
19
+ * terminal", which reads like a network problem and is not one.
20
+ *
21
+ * Clip never reports an `at_terminal` state — a charge is `PENDING` from the
22
+ * moment it is queued until the customer finishes. Code that keys off
23
+ * `at_terminal` will simply never see it here; key off `pending` instead.
24
+ */
25
+ export declare class ClipTerminalPayments implements TerminalPaymentsPort {
26
+ private readonly options;
27
+ readonly provider = "clip";
28
+ private readonly baseUrl;
29
+ private readonly apiBaseUrl;
30
+ private readonly fetchImpl;
31
+ private readonly token;
32
+ constructor(options: ClipPinpadOptions);
33
+ private headers;
34
+ private url;
35
+ /**
36
+ * Clip's device status, which is a heartbeat: a reader that has not checked
37
+ * in for 20 seconds turns `expired`, not `inactive`. Both mean "do not send
38
+ * a charge there right now", so both map to offline; `unknown` means the
39
+ * account does not have the feature on, which is not a statement about the
40
+ * device at all and stays `undefined`.
41
+ */
42
+ listTerminals(): Promise<Terminal[]>;
43
+ charge(input: ChargeInput): Promise<TerminalPayment>;
44
+ get(id: string): Promise<TerminalPayment>;
45
+ /**
46
+ * Withdraws a queued charge — and only a queued one. Clip accepts this
47
+ * "if the payment attempt has not yet been picked up by the terminal"; after
48
+ * that the reader owns it and it has to be cancelled on the device.
49
+ */
50
+ cancel(id: string): Promise<TerminalPayment>;
51
+ /**
52
+ * The charge plus the transactions behind it, which is where the ids that
53
+ * can be refunded live. Split payments produce more than one.
54
+ */
55
+ getWithTransactions(id: string): Promise<{
56
+ payment: TerminalPayment;
57
+ transactions: ClipTransaction[];
58
+ }>;
59
+ /**
60
+ * Refunds a settled charge.
61
+ *
62
+ * Two calls, because Clip refunds a **transaction** and the id you hold is a
63
+ * PinPad request: the transaction id has to be read out of the charge's
64
+ * detail first. The refund itself lives on the other host
65
+ * (`api.payclip.com`), with the same Basic credentials.
66
+ */
67
+ refund(id: string, options?: {
68
+ amountCents?: number;
69
+ reason?: string;
70
+ }): Promise<TerminalPayment>;
71
+ /**
72
+ * Cancels whatever is queued on a reader, when you do not have the request
73
+ * id — a terminal left waiting after a crash, typically. Same limit as
74
+ * {@link cancel}: only before the device picks it up.
75
+ */
76
+ cancelByTerminal(serialNumber: string): Promise<TerminalPayment>;
77
+ /**
78
+ * Kiosk mode: the reader stays on the payment screen and nobody can walk out
79
+ * of it, for unattended terminals. `timeoutSeconds` auto-cancels an
80
+ * untouched charge; without it a kiosk waits forever.
81
+ *
82
+ * Up to 25 serial numbers per call, which is Clip's limit, not ours.
83
+ */
84
+ setKioskMode(serialNumbers: string[], preferences: {
85
+ enabled: boolean;
86
+ timeoutSeconds?: number;
87
+ }): Promise<void>;
88
+ /**
89
+ * Clip signs nothing. The notification is `{ id, origin, event_type }` over
90
+ * plain POST, so there is no signature to check and no way to tell Clip's
91
+ * request from anyone else's.
92
+ *
93
+ * What is left is to make the URL itself the credential: register a
94
+ * `webhook_url` carrying a random token and require it back here. That does
95
+ * not authenticate Clip — it only keeps a stranger from making your service
96
+ * do lookups — which is precisely why the event carries an id and never a
97
+ * status. The status comes from `get()`, over an authenticated call, every
98
+ * time.
99
+ */
100
+ verifyWebhook(request: WebhookRequestLike): TerminalWebhookEvent;
101
+ }
@@ -0,0 +1,74 @@
1
+ import type { MercadoPagoPointOptions } from '../payments.options.js';
2
+ import type { ChargeInput, Terminal, TerminalPayment, TerminalPaymentsPort, TerminalWebhookEvent, WebhookRequestLike } from '../payments.port.js';
3
+ /**
4
+ * Mercado Pago Point over the Orders API.
5
+ *
6
+ * A terminal only answers API charges in **PDV** operating mode; in
7
+ * `standalone` it runs the merchant app and ignores everything sent here,
8
+ * silently. That is why {@link listTerminals} reports `operatingMode` — a
9
+ * charge that never appears on a working terminal is almost always this.
10
+ */
11
+ export declare class MercadoPagoTerminalPayments implements TerminalPaymentsPort {
12
+ private readonly options;
13
+ readonly provider = "mercadopago";
14
+ private readonly baseUrl;
15
+ private readonly fetchImpl;
16
+ constructor(options: MercadoPagoPointOptions);
17
+ private headers;
18
+ listTerminals(): Promise<Terminal[]>;
19
+ charge(input: ChargeInput): Promise<TerminalPayment>;
20
+ get(id: string): Promise<TerminalPayment>;
21
+ cancel(id: string): Promise<TerminalPayment>;
22
+ /**
23
+ * Refunds a settled order: the whole thing, or `amountCents` of it.
24
+ *
25
+ * Mercado Pago allows this for card payments within 90 days, only while the
26
+ * order is `processed`, and it is not idempotent on its own — the header is,
27
+ * for 24 hours. A partial refund has to name the payment it is refunding,
28
+ * which is why the order is read first: the id the caller holds is the
29
+ * order's, and the API wants the payment's.
30
+ */
31
+ refund(id: string, options?: {
32
+ amountCents?: number;
33
+ reason?: string;
34
+ }): Promise<TerminalPayment>;
35
+ /**
36
+ * Puts terminals into the mode that makes them answer the API at all.
37
+ *
38
+ * A terminal ships in `STANDALONE`, where it runs the merchant app and
39
+ * **ignores API charges without saying so**. `PDV` is the integrated mode,
40
+ * and the terminal has to be **restarted** for the change to take — an
41
+ * unrestarted terminal keeps swallowing charges, which is the single most
42
+ * expensive way to discover this.
43
+ */
44
+ setOperatingMode(terminalIds: string[], mode: 'PDV' | 'STANDALONE'): Promise<Terminal[]>;
45
+ /**
46
+ * Forces a final status on an order created with **test credentials**, so a
47
+ * whole flow — order, status change, webhook — can be exercised without a
48
+ * terminal in the room.
49
+ *
50
+ * This is the reason this integration is testable at all: pair it with the
51
+ * virtual device serial `SBX0000001` (e.g. `NEWLAND_N950__SBX0000001`) and
52
+ * the notification that arrives is the same one production sends. Takes up
53
+ * to 10 seconds to land, 40 for `action_required`. Against production
54
+ * credentials it does nothing but fail.
55
+ */
56
+ simulateStatus(orderId: string, event: {
57
+ status: 'processed' | 'canceled' | 'expired' | 'action_required';
58
+ statusDetail?: string;
59
+ paymentMethodId?: 'visa' | 'master' | 'amex';
60
+ paymentMethodType?: 'credit_card';
61
+ installments?: number;
62
+ }): Promise<void>;
63
+ /**
64
+ * Verifies the `x-signature` header: HMAC-SHA256 of
65
+ * `id:<data.id>;request-id:<x-request-id>;ts:<ts>;` keyed with the webhook
66
+ * secret, compared in constant time.
67
+ *
68
+ * The id is lowercased before hashing, per Mercado Pago's own rule for
69
+ * alphanumeric ids — an order id like `ORD01J6...` hashed as sent never
70
+ * matches, and the failure looks exactly like a forged request.
71
+ */
72
+ verifyWebhook(request: WebhookRequestLike): TerminalWebhookEvent;
73
+ private toPayment;
74
+ }