platform-types 1.10.856 → 1.10.857
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/dist/balancePayment.d.ts +181 -0
- package/dist/balancePayment.js +72 -0
- package/dist/cjs/balancePayment.js +75 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/notification.js +13 -1
- package/dist/cjs/socket.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/notification.d.ts +30 -0
- package/dist/notification.js +13 -1
- package/dist/payment.d.ts +7 -0
- package/dist/socket.d.ts +1 -1
- package/dist/socket.js +9 -0
- package/dist/store.d.ts +16 -1
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Online cuenta-corriente payment — a signed-in storefront buyer pays open
|
|
3
|
+
* debits of their own ledger through the store's Mercado Pago Checkout Pro.
|
|
4
|
+
*
|
|
5
|
+
* Available while `Ecommerce.config.onlineBalancePayment` reads `true` on the
|
|
6
|
+
* public store frame: that key carries the VERDICT there (the stored switch AND
|
|
7
|
+
* the `customerAccounts` module on AND Mercado Pago linked AND a peso ledger),
|
|
8
|
+
* never the stored value alone.
|
|
9
|
+
*
|
|
10
|
+
* Which debits can be paid, and in what shape:
|
|
11
|
+
*
|
|
12
|
+
* - `prefix` — the OLDEST open debits, in the order {@link OpenAccountDebitsResponse}
|
|
13
|
+
* lists them, from the first one on, with no gap. The payment credits the
|
|
14
|
+
* customer, and an unstamped credit settles debits oldest-first, so any
|
|
15
|
+
* other selection would settle debits the buyer did not pick.
|
|
16
|
+
* - `order` — exactly one debit linked to an order; the payment credits that
|
|
17
|
+
* order and settles its debit.
|
|
18
|
+
*
|
|
19
|
+
* The amount is always the server's: the remaining balance of the selection,
|
|
20
|
+
* whole. No partial payment of a debit, no free amount, pesos only.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ Not offered, ever: a refund-in-transit debit (`RIT#…`), and a debit whose
|
|
23
|
+
* order carries a factura de crédito electrónica MiPyME (FCE, `CbteTipo`
|
|
24
|
+
* 201–213 that ARCA did not reject) — collected outside this flow. An orderless
|
|
25
|
+
* debit cannot be tied to a voucher, so it is offered whatever was invoiced.
|
|
26
|
+
*
|
|
27
|
+
* The document the buyer gets is a non-fiscal «Comprobante de pago»
|
|
28
|
+
* numbered `CPG-{n}` per store (`receiptNo`), never a «Recibo».
|
|
29
|
+
*/
|
|
30
|
+
declare global {
|
|
31
|
+
/** One of {@link BALANCE_ATTEMPT_MODES}. */
|
|
32
|
+
type BalanceAttemptMode = (typeof BALANCE_ATTEMPT_MODES)[number];
|
|
33
|
+
/**
|
|
34
|
+
* One of {@link BALANCE_ATTEMPT_STATES}.
|
|
35
|
+
*
|
|
36
|
+
* - `created` — the checkout exists; nothing paid yet.
|
|
37
|
+
* - `pending` — a payment was made and Mercado Pago has not decided it.
|
|
38
|
+
* - `rejected` — the last payment was rejected. NOT terminal: Checkout Pro
|
|
39
|
+
* lets the buyer retry inside the same checkout until `expiresAt`.
|
|
40
|
+
* - `approved` — the payment was approved and credited to the ledger;
|
|
41
|
+
* `receiptNo` and `paidAt` are set.
|
|
42
|
+
* - `expired` — `expiresAt` passed with nothing approved. Nothing else
|
|
43
|
+
* changes: no order is cancelled and no ledger row is written.
|
|
44
|
+
* - `resolution` — money landed that was not credited on its own (an amount
|
|
45
|
+
* other than the one frozen at the start, a payment after the checkout
|
|
46
|
+
* expired). The store reviews it; show it as under review.
|
|
47
|
+
* - `refunded` — the approved payment was refunded in Mercado Pago. The
|
|
48
|
+
* credit stays on the ledger until the store reverses it.
|
|
49
|
+
* - `charged_back` — the approved payment was charged back. Same as
|
|
50
|
+
* `refunded` for the ledger.
|
|
51
|
+
*/
|
|
52
|
+
type BalanceAttemptState = (typeof BALANCE_ATTEMPT_STATES)[number];
|
|
53
|
+
/** One of {@link BALANCE_PAYMENT_ERROR_CODES}. */
|
|
54
|
+
type BalancePaymentErrorCode = (typeof BALANCE_PAYMENT_ERROR_CODES)[number];
|
|
55
|
+
/**
|
|
56
|
+
* Web `GET /account?mode=open-debits` — every other query key is ignored.
|
|
57
|
+
* The caller's own ledger (the token's customer), allocated by the shared
|
|
58
|
+
* allocator (`allocateAccountLedger`).
|
|
59
|
+
*/
|
|
60
|
+
interface WebAccountOpenDebitsQuery {
|
|
61
|
+
mode: 'open-debits';
|
|
62
|
+
}
|
|
63
|
+
/** One open debit the buyer may pay online. Amounts are decimal units of `ledgerCurrency`. */
|
|
64
|
+
interface OpenAccountDebit {
|
|
65
|
+
/** The ACCOUNT row's id (`ACC#{orderId}` for an order's debit, a UUID for a manual one) — what a start sends. */
|
|
66
|
+
accountId: string;
|
|
67
|
+
/** Absent on an orderless debit, which only a `prefix` start can pay. */
|
|
68
|
+
orderId?: string;
|
|
69
|
+
/** `YYYYMMDD` ledger day of the debit. */
|
|
70
|
+
dated: number;
|
|
71
|
+
/** `YYYYMMDD` due day stamped on the row; absent means unspecified. */
|
|
72
|
+
dueDate?: number;
|
|
73
|
+
/** The row's own text, verbatim. */
|
|
74
|
+
details?: string;
|
|
75
|
+
/** The debit as written. */
|
|
76
|
+
original: number;
|
|
77
|
+
/** What is still owed on it — the amount a start charges for it. Always above zero. */
|
|
78
|
+
remaining: number;
|
|
79
|
+
}
|
|
80
|
+
/** `data` of web `GET /account?mode=open-debits`. */
|
|
81
|
+
interface OpenAccountDebitsResponse {
|
|
82
|
+
/**
|
|
83
|
+
* The payable open debits, OLDEST FIRST in allocation order (when each was
|
|
84
|
+
* written, `createdAt` — not `dated`, which a backdated row bends). A
|
|
85
|
+
* `prefix` start names the first N of them.
|
|
86
|
+
*/
|
|
87
|
+
debits: OpenAccountDebit[];
|
|
88
|
+
/**
|
|
89
|
+
* How many leading entries of `debits` a `prefix` start may cover: the run
|
|
90
|
+
* before the first open debit that cannot be paid online. Every entry after
|
|
91
|
+
* it can only be paid on its own, as `mode: 'order'`, and an orderless one
|
|
92
|
+
* after it not at all. Equals `debits.length` when nothing blocks.
|
|
93
|
+
*/
|
|
94
|
+
prefixLength: number;
|
|
95
|
+
/** The ledger's catalog id (`ars`). Every amount here is in it. */
|
|
96
|
+
ledgerCurrency: string;
|
|
97
|
+
/**
|
|
98
|
+
* The whole ledger's balance, sign as `Customer.balance`: positive is owed
|
|
99
|
+
* by the customer, negative is credit the store holds for them.
|
|
100
|
+
*/
|
|
101
|
+
balance: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Web `POST /payments/balance-attempts` body. Any other key — an amount
|
|
105
|
+
* included — is dropped by the parse: the server prices the selection.
|
|
106
|
+
*/
|
|
107
|
+
interface StartBalanceAttemptRequest {
|
|
108
|
+
/** 1–{@link BALANCE_ATTEMPT_MAX_DEBITS} distinct `OpenAccountDebit.accountId`s; exactly one for `order`. */
|
|
109
|
+
accountIds: string[];
|
|
110
|
+
mode: BalanceAttemptMode;
|
|
111
|
+
}
|
|
112
|
+
/** `data` of web `POST /payments/balance-attempts`. */
|
|
113
|
+
interface StartBalanceAttemptResponse {
|
|
114
|
+
/** `BAT-{customerId}-{seq}`. */
|
|
115
|
+
attemptId: string;
|
|
116
|
+
/** The Mercado Pago checkout URL to send the buyer to. */
|
|
117
|
+
redirectUrl: string;
|
|
118
|
+
/** ISO 8601. After it the checkout no longer takes a payment. */
|
|
119
|
+
expiresAt: string;
|
|
120
|
+
/** Decimal pesos — what the checkout charges, computed by the server. */
|
|
121
|
+
amount: number;
|
|
122
|
+
}
|
|
123
|
+
/** `data` of `409 BALANCE_SELECTION_STALE`: the fresh payable list, as `GET /account?mode=open-debits` answers it. */
|
|
124
|
+
interface BalanceSelectionStaleData {
|
|
125
|
+
debits: OpenAccountDebit[];
|
|
126
|
+
prefixLength: number;
|
|
127
|
+
}
|
|
128
|
+
/** `data` of web `GET /payments/balance-attempts/{attemptId}` — the caller's own attempt only. */
|
|
129
|
+
interface BalanceAttemptView {
|
|
130
|
+
state: BalanceAttemptState;
|
|
131
|
+
/** Decimal pesos, frozen at the start. */
|
|
132
|
+
amount: number;
|
|
133
|
+
/** Unix ms the payment was approved. Set with `approved`. */
|
|
134
|
+
paidAt?: number;
|
|
135
|
+
/** The «Comprobante de pago» number, `CPG-{n}`. Set with `approved`. */
|
|
136
|
+
receiptNo?: string;
|
|
137
|
+
/** The debits the start priced, as sent. */
|
|
138
|
+
accountIds: string[];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* `data` of the `balancePaymentAttempt` socket frame — sent to the attempt's
|
|
142
|
+
* OWN customer (`wsPostCustomer`) once per committed state move. Ids and the
|
|
143
|
+
* state only: re-read `GET /payments/balance-attempts/{attemptId}` for the
|
|
144
|
+
* rest. An approval also sends the existing `account` frame (the customer row
|
|
145
|
+
* with its new balance).
|
|
146
|
+
*/
|
|
147
|
+
interface BalancePaymentAttemptFrameData {
|
|
148
|
+
attemptId: string;
|
|
149
|
+
state: BalanceAttemptState;
|
|
150
|
+
/** The «Comprobante de pago» number, `CPG-{n}`. Set from `approved` on. */
|
|
151
|
+
receiptNo?: string;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Every `mode` of {@link StartBalanceAttemptRequest}. */
|
|
155
|
+
export declare const BALANCE_ATTEMPT_MODES: readonly ["prefix", "order"];
|
|
156
|
+
/** Every {@link BalanceAttemptState}. */
|
|
157
|
+
export declare const BALANCE_ATTEMPT_STATES: readonly ["created", "pending", "rejected", "approved", "expired", "resolution", "refunded", "charged_back"];
|
|
158
|
+
/** The most debits one start may name. */
|
|
159
|
+
export declare const BALANCE_ATTEMPT_MAX_DEBITS = 50;
|
|
160
|
+
/**
|
|
161
|
+
* The refusals of the balance-payment routes, beside the shared ones they reuse
|
|
162
|
+
* (`PAYMENT_PROVIDER_NOT_CONNECTED` 412, `PAYMENT_PROVIDER_TOKEN_EXPIRED` 412,
|
|
163
|
+
* `MP_PREFERENCE_CREATE_FAILED` 502, `PLATFORM_INTEGRATION_DISABLED` 503,
|
|
164
|
+
* `CUSTOMER_LEDGER_TRUNCATED` 503, `VALIDATION_FAILED` 400):
|
|
165
|
+
*
|
|
166
|
+
* - `BALANCE_PAYMENT_DISABLED` · 403 — the store does not take online balance
|
|
167
|
+
* payments: the switch is off or the `customerAccounts` module is. On
|
|
168
|
+
* `GET /account?mode=open-debits` also when Mercado Pago is not linked or the
|
|
169
|
+
* ledger is not in pesos (the start answers those 412 / 422).
|
|
170
|
+
* - `BALANCE_CURRENCY_UNSUPPORTED` · 422 — the ledger is not in pesos.
|
|
171
|
+
* - `BALANCE_SELECTION_STALE` · 409 — a selected debit is not among the payable
|
|
172
|
+
* open debits any more (paid meanwhile, or never offered); `data` is
|
|
173
|
+
* {@link BalanceSelectionStaleData}.
|
|
174
|
+
* - `BALANCE_SELECTION_NOT_PREFIX` · 409 — every debit is payable, but not in
|
|
175
|
+
* this shape: `prefix` — not the first N of the list, or past `prefixLength`;
|
|
176
|
+
* `order` — an orderless debit, or not the oldest open debit of its order.
|
|
177
|
+
* - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
|
|
178
|
+
* - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
|
|
179
|
+
*/
|
|
180
|
+
export declare const BALANCE_PAYMENT_ERROR_CODES: readonly ["BALANCE_PAYMENT_DISABLED", "BALANCE_CURRENCY_UNSUPPORTED", "BALANCE_SELECTION_STALE", "BALANCE_SELECTION_NOT_PREFIX", "BALANCE_NOTHING_OWED", "BALANCE_ATTEMPT_NOT_FOUND"];
|
|
181
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Online cuenta-corriente payment — a signed-in storefront buyer pays open
|
|
3
|
+
* debits of their own ledger through the store's Mercado Pago Checkout Pro.
|
|
4
|
+
*
|
|
5
|
+
* Available while `Ecommerce.config.onlineBalancePayment` reads `true` on the
|
|
6
|
+
* public store frame: that key carries the VERDICT there (the stored switch AND
|
|
7
|
+
* the `customerAccounts` module on AND Mercado Pago linked AND a peso ledger),
|
|
8
|
+
* never the stored value alone.
|
|
9
|
+
*
|
|
10
|
+
* Which debits can be paid, and in what shape:
|
|
11
|
+
*
|
|
12
|
+
* - `prefix` — the OLDEST open debits, in the order {@link OpenAccountDebitsResponse}
|
|
13
|
+
* lists them, from the first one on, with no gap. The payment credits the
|
|
14
|
+
* customer, and an unstamped credit settles debits oldest-first, so any
|
|
15
|
+
* other selection would settle debits the buyer did not pick.
|
|
16
|
+
* - `order` — exactly one debit linked to an order; the payment credits that
|
|
17
|
+
* order and settles its debit.
|
|
18
|
+
*
|
|
19
|
+
* The amount is always the server's: the remaining balance of the selection,
|
|
20
|
+
* whole. No partial payment of a debit, no free amount, pesos only.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ Not offered, ever: a refund-in-transit debit (`RIT#…`), and a debit whose
|
|
23
|
+
* order carries a factura de crédito electrónica MiPyME (FCE, `CbteTipo`
|
|
24
|
+
* 201–213 that ARCA did not reject) — collected outside this flow. An orderless
|
|
25
|
+
* debit cannot be tied to a voucher, so it is offered whatever was invoiced.
|
|
26
|
+
*
|
|
27
|
+
* The document the buyer gets is a non-fiscal «Comprobante de pago»
|
|
28
|
+
* numbered `CPG-{n}` per store (`receiptNo`), never a «Recibo».
|
|
29
|
+
*/
|
|
30
|
+
/** Every `mode` of {@link StartBalanceAttemptRequest}. */
|
|
31
|
+
export const BALANCE_ATTEMPT_MODES = ['prefix', 'order'];
|
|
32
|
+
/** Every {@link BalanceAttemptState}. */
|
|
33
|
+
export const BALANCE_ATTEMPT_STATES = [
|
|
34
|
+
'created',
|
|
35
|
+
'pending',
|
|
36
|
+
'rejected',
|
|
37
|
+
'approved',
|
|
38
|
+
'expired',
|
|
39
|
+
'resolution',
|
|
40
|
+
'refunded',
|
|
41
|
+
'charged_back',
|
|
42
|
+
];
|
|
43
|
+
/** The most debits one start may name. */
|
|
44
|
+
export const BALANCE_ATTEMPT_MAX_DEBITS = 50;
|
|
45
|
+
/**
|
|
46
|
+
* The refusals of the balance-payment routes, beside the shared ones they reuse
|
|
47
|
+
* (`PAYMENT_PROVIDER_NOT_CONNECTED` 412, `PAYMENT_PROVIDER_TOKEN_EXPIRED` 412,
|
|
48
|
+
* `MP_PREFERENCE_CREATE_FAILED` 502, `PLATFORM_INTEGRATION_DISABLED` 503,
|
|
49
|
+
* `CUSTOMER_LEDGER_TRUNCATED` 503, `VALIDATION_FAILED` 400):
|
|
50
|
+
*
|
|
51
|
+
* - `BALANCE_PAYMENT_DISABLED` · 403 — the store does not take online balance
|
|
52
|
+
* payments: the switch is off or the `customerAccounts` module is. On
|
|
53
|
+
* `GET /account?mode=open-debits` also when Mercado Pago is not linked or the
|
|
54
|
+
* ledger is not in pesos (the start answers those 412 / 422).
|
|
55
|
+
* - `BALANCE_CURRENCY_UNSUPPORTED` · 422 — the ledger is not in pesos.
|
|
56
|
+
* - `BALANCE_SELECTION_STALE` · 409 — a selected debit is not among the payable
|
|
57
|
+
* open debits any more (paid meanwhile, or never offered); `data` is
|
|
58
|
+
* {@link BalanceSelectionStaleData}.
|
|
59
|
+
* - `BALANCE_SELECTION_NOT_PREFIX` · 409 — every debit is payable, but not in
|
|
60
|
+
* this shape: `prefix` — not the first N of the list, or past `prefixLength`;
|
|
61
|
+
* `order` — an orderless debit, or not the oldest open debit of its order.
|
|
62
|
+
* - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
|
|
63
|
+
* - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
|
|
64
|
+
*/
|
|
65
|
+
export const BALANCE_PAYMENT_ERROR_CODES = [
|
|
66
|
+
'BALANCE_PAYMENT_DISABLED',
|
|
67
|
+
'BALANCE_CURRENCY_UNSUPPORTED',
|
|
68
|
+
'BALANCE_SELECTION_STALE',
|
|
69
|
+
'BALANCE_SELECTION_NOT_PREFIX',
|
|
70
|
+
'BALANCE_NOTHING_OWED',
|
|
71
|
+
'BALANCE_ATTEMPT_NOT_FOUND',
|
|
72
|
+
];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Online cuenta-corriente payment — a signed-in storefront buyer pays open
|
|
4
|
+
* debits of their own ledger through the store's Mercado Pago Checkout Pro.
|
|
5
|
+
*
|
|
6
|
+
* Available while `Ecommerce.config.onlineBalancePayment` reads `true` on the
|
|
7
|
+
* public store frame: that key carries the VERDICT there (the stored switch AND
|
|
8
|
+
* the `customerAccounts` module on AND Mercado Pago linked AND a peso ledger),
|
|
9
|
+
* never the stored value alone.
|
|
10
|
+
*
|
|
11
|
+
* Which debits can be paid, and in what shape:
|
|
12
|
+
*
|
|
13
|
+
* - `prefix` — the OLDEST open debits, in the order {@link OpenAccountDebitsResponse}
|
|
14
|
+
* lists them, from the first one on, with no gap. The payment credits the
|
|
15
|
+
* customer, and an unstamped credit settles debits oldest-first, so any
|
|
16
|
+
* other selection would settle debits the buyer did not pick.
|
|
17
|
+
* - `order` — exactly one debit linked to an order; the payment credits that
|
|
18
|
+
* order and settles its debit.
|
|
19
|
+
*
|
|
20
|
+
* The amount is always the server's: the remaining balance of the selection,
|
|
21
|
+
* whole. No partial payment of a debit, no free amount, pesos only.
|
|
22
|
+
*
|
|
23
|
+
* ⚠️ Not offered, ever: a refund-in-transit debit (`RIT#…`), and a debit whose
|
|
24
|
+
* order carries a factura de crédito electrónica MiPyME (FCE, `CbteTipo`
|
|
25
|
+
* 201–213 that ARCA did not reject) — collected outside this flow. An orderless
|
|
26
|
+
* debit cannot be tied to a voucher, so it is offered whatever was invoiced.
|
|
27
|
+
*
|
|
28
|
+
* The document the buyer gets is a non-fiscal «Comprobante de pago»
|
|
29
|
+
* numbered `CPG-{n}` per store (`receiptNo`), never a «Recibo».
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.BALANCE_PAYMENT_ERROR_CODES = exports.BALANCE_ATTEMPT_MAX_DEBITS = exports.BALANCE_ATTEMPT_STATES = exports.BALANCE_ATTEMPT_MODES = void 0;
|
|
33
|
+
/** Every `mode` of {@link StartBalanceAttemptRequest}. */
|
|
34
|
+
exports.BALANCE_ATTEMPT_MODES = ['prefix', 'order'];
|
|
35
|
+
/** Every {@link BalanceAttemptState}. */
|
|
36
|
+
exports.BALANCE_ATTEMPT_STATES = [
|
|
37
|
+
'created',
|
|
38
|
+
'pending',
|
|
39
|
+
'rejected',
|
|
40
|
+
'approved',
|
|
41
|
+
'expired',
|
|
42
|
+
'resolution',
|
|
43
|
+
'refunded',
|
|
44
|
+
'charged_back',
|
|
45
|
+
];
|
|
46
|
+
/** The most debits one start may name. */
|
|
47
|
+
exports.BALANCE_ATTEMPT_MAX_DEBITS = 50;
|
|
48
|
+
/**
|
|
49
|
+
* The refusals of the balance-payment routes, beside the shared ones they reuse
|
|
50
|
+
* (`PAYMENT_PROVIDER_NOT_CONNECTED` 412, `PAYMENT_PROVIDER_TOKEN_EXPIRED` 412,
|
|
51
|
+
* `MP_PREFERENCE_CREATE_FAILED` 502, `PLATFORM_INTEGRATION_DISABLED` 503,
|
|
52
|
+
* `CUSTOMER_LEDGER_TRUNCATED` 503, `VALIDATION_FAILED` 400):
|
|
53
|
+
*
|
|
54
|
+
* - `BALANCE_PAYMENT_DISABLED` · 403 — the store does not take online balance
|
|
55
|
+
* payments: the switch is off or the `customerAccounts` module is. On
|
|
56
|
+
* `GET /account?mode=open-debits` also when Mercado Pago is not linked or the
|
|
57
|
+
* ledger is not in pesos (the start answers those 412 / 422).
|
|
58
|
+
* - `BALANCE_CURRENCY_UNSUPPORTED` · 422 — the ledger is not in pesos.
|
|
59
|
+
* - `BALANCE_SELECTION_STALE` · 409 — a selected debit is not among the payable
|
|
60
|
+
* open debits any more (paid meanwhile, or never offered); `data` is
|
|
61
|
+
* {@link BalanceSelectionStaleData}.
|
|
62
|
+
* - `BALANCE_SELECTION_NOT_PREFIX` · 409 — every debit is payable, but not in
|
|
63
|
+
* this shape: `prefix` — not the first N of the list, or past `prefixLength`;
|
|
64
|
+
* `order` — an orderless debit, or not the oldest open debit of its order.
|
|
65
|
+
* - `BALANCE_NOTHING_OWED` · 409 — the selection owes nothing.
|
|
66
|
+
* - `BALANCE_ATTEMPT_NOT_FOUND` · 404 — no such attempt of the caller's.
|
|
67
|
+
*/
|
|
68
|
+
exports.BALANCE_PAYMENT_ERROR_CODES = [
|
|
69
|
+
'BALANCE_PAYMENT_DISABLED',
|
|
70
|
+
'BALANCE_CURRENCY_UNSUPPORTED',
|
|
71
|
+
'BALANCE_SELECTION_STALE',
|
|
72
|
+
'BALANCE_SELECTION_NOT_PREFIX',
|
|
73
|
+
'BALANCE_NOTHING_OWED',
|
|
74
|
+
'BALANCE_ATTEMPT_NOT_FOUND',
|
|
75
|
+
];
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __exportStar(require("./audit.js"), exports);
|
|
|
32
32
|
__exportStar(require("./auditEnvelope.js"), exports);
|
|
33
33
|
__exportStar(require("./attendance.js"), exports);
|
|
34
34
|
__exportStar(require("./auth.js"), exports);
|
|
35
|
+
__exportStar(require("./balancePayment.js"), exports);
|
|
35
36
|
__exportStar(require("./basket.js"), exports);
|
|
36
37
|
__exportStar(require("./attributes.js"), exports);
|
|
37
38
|
__exportStar(require("./brands.js"), exports);
|
package/dist/cjs/notification.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.WEB_NOTIFICATIONS_MAX_LIMIT = exports.CUSTOMER_NOTIFICATION_TYPES = expo
|
|
|
6
6
|
// legacy opt-ins and explicit channel maps remain source data on USER rows.
|
|
7
7
|
// Addressed ERROR / ML_FACTURADOR_COLLISION / ML_SELLER_SWITCHED /
|
|
8
8
|
// ML_CONNECTION_BROKEN / MENTION / CUSTOMER_PENDING_APPROVAL /
|
|
9
|
-
// PAYMENT_ATTEMPT_RESOLUTION / CUSTOMER_WHOLESALE_REQUEST / STOREFRONT_QUOTE_REQUEST /
|
|
9
|
+
// PAYMENT_ATTEMPT_RESOLUTION / BALANCE_PAID_ONLINE / CUSTOMER_WHOLESALE_REQUEST / STOREFRONT_QUOTE_REQUEST /
|
|
10
10
|
// SERVICE_QUOTE_DECIDED /
|
|
11
11
|
// REFUND_OBLIGATION_OVERDUE / MESSAGE_CREDITS_LOW / MESSAGE_SKIPPED_NO_CREDITS do not select a
|
|
12
12
|
// producer subscriber audience;
|
|
@@ -202,6 +202,18 @@ var NotificationTypeEnum;
|
|
|
202
202
|
* re-opens rings again.
|
|
203
203
|
*/
|
|
204
204
|
NotificationTypeEnum["PAYMENT_ATTEMPT_RESOLUTION"] = "PAYMENT_ATTEMPT_RESOLUTION";
|
|
205
|
+
/**
|
|
206
|
+
* A signed-in buyer paid open cuenta-corriente debits online through Mercado
|
|
207
|
+
* Pago, and the credit landed on their ledger with its «Comprobante de pago»
|
|
208
|
+
* number. Carries {@link NotificationInterface.customerRef} and
|
|
209
|
+
* {@link NotificationInterface.balanceAttemptId} — pointers, never the buyer's
|
|
210
|
+
* name or contact.
|
|
211
|
+
*
|
|
212
|
+
* ⚠️ ADMIN-ONLY, as `PAYMENT_ATTEMPT_RESOLUTION`: one bell per non-disabled
|
|
213
|
+
* ADMIN of the store (`listActiveAdmins`), after the credit committed,
|
|
214
|
+
* best-effort. Its own preference key, default-on when absent; seeded nowhere.
|
|
215
|
+
*/
|
|
216
|
+
NotificationTypeEnum["BALANCE_PAID_ONLINE"] = "BALANCE_PAID_ONLINE";
|
|
205
217
|
/**
|
|
206
218
|
* A signed-in storefront buyer asked for a wholesale account
|
|
207
219
|
* (`POST /user { mode: 'wholesale-request' }`) and the request waits in the
|
package/dist/cjs/socket.js
CHANGED
|
@@ -519,6 +519,15 @@ exports.SOCKET_ACTIONS = [
|
|
|
519
519
|
* customer broadcast. Sent once per committed state move of the attempt.
|
|
520
520
|
*/
|
|
521
521
|
'orderPaymentAttempt',
|
|
522
|
+
/**
|
|
523
|
+
* A signed-in buyer's online cuenta-corriente payment attempt changed state.
|
|
524
|
+
* `data` is `BalancePaymentAttemptFrameData` (`balancePayment.ts`) — the
|
|
525
|
+
* attempt id, its state and, once approved, its receipt number.
|
|
526
|
+
*
|
|
527
|
+
* ⚠️ To the attempt's OWN customer only (`wsPostCustomer`), never a
|
|
528
|
+
* store-wide customer broadcast. Sent once per committed state move.
|
|
529
|
+
*/
|
|
530
|
+
'balancePaymentAttempt',
|
|
522
531
|
/**
|
|
523
532
|
* A storefront order's delivery was created or moved. `data` is
|
|
524
533
|
* `OrderDeliveryFrameData` (`delivery.ts`) — the order id and the minimised
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './audit.ts';
|
|
|
8
8
|
export * from './auditEnvelope.ts';
|
|
9
9
|
export * from './attendance.ts';
|
|
10
10
|
export * from './auth.ts';
|
|
11
|
+
export * from './balancePayment.ts';
|
|
11
12
|
export * from './basket.ts';
|
|
12
13
|
export * from './attributes.ts';
|
|
13
14
|
export * from './brands.ts';
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from "./audit.js";
|
|
|
16
16
|
export * from "./auditEnvelope.js";
|
|
17
17
|
export * from "./attendance.js";
|
|
18
18
|
export * from "./auth.js";
|
|
19
|
+
export * from "./balancePayment.js";
|
|
19
20
|
export * from "./basket.js";
|
|
20
21
|
export * from "./attributes.js";
|
|
21
22
|
export * from "./brands.js";
|
package/dist/notification.d.ts
CHANGED
|
@@ -178,6 +178,18 @@ export declare enum NotificationTypeEnum {
|
|
|
178
178
|
* re-opens rings again.
|
|
179
179
|
*/
|
|
180
180
|
PAYMENT_ATTEMPT_RESOLUTION = "PAYMENT_ATTEMPT_RESOLUTION",
|
|
181
|
+
/**
|
|
182
|
+
* A signed-in buyer paid open cuenta-corriente debits online through Mercado
|
|
183
|
+
* Pago, and the credit landed on their ledger with its «Comprobante de pago»
|
|
184
|
+
* number. Carries {@link NotificationInterface.customerRef} and
|
|
185
|
+
* {@link NotificationInterface.balanceAttemptId} — pointers, never the buyer's
|
|
186
|
+
* name or contact.
|
|
187
|
+
*
|
|
188
|
+
* ⚠️ ADMIN-ONLY, as `PAYMENT_ATTEMPT_RESOLUTION`: one bell per non-disabled
|
|
189
|
+
* ADMIN of the store (`listActiveAdmins`), after the credit committed,
|
|
190
|
+
* best-effort. Its own preference key, default-on when absent; seeded nowhere.
|
|
191
|
+
*/
|
|
192
|
+
BALANCE_PAID_ONLINE = "BALANCE_PAID_ONLINE",
|
|
181
193
|
/**
|
|
182
194
|
* A signed-in storefront buyer asked for a wholesale account
|
|
183
195
|
* (`POST /user { mode: 'wholesale-request' }`) and the request waits in the
|
|
@@ -344,6 +356,14 @@ declare global {
|
|
|
344
356
|
/** The row's `emailVerified` at registration — `false` when the address is still unproven. */
|
|
345
357
|
emailVerified: boolean;
|
|
346
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Which customer a `BALANCE_PAID_ONLINE` bell is about. A POINTER, never an
|
|
361
|
+
* audience — the top-level `customerId` would deliver the bell to the buyer.
|
|
362
|
+
* Operator surfaces only.
|
|
363
|
+
*/
|
|
364
|
+
interface BalancePaidCustomerRef {
|
|
365
|
+
customerId: string;
|
|
366
|
+
}
|
|
347
367
|
interface NotificationInterface {
|
|
348
368
|
storeId: string;
|
|
349
369
|
notificationId: string;
|
|
@@ -406,6 +426,16 @@ declare global {
|
|
|
406
426
|
* an audience — see {@link ServiceOrderRef}. Operator surfaces only.
|
|
407
427
|
*/
|
|
408
428
|
serviceOrderRef?: ServiceOrderRef;
|
|
429
|
+
/**
|
|
430
|
+
* `BALANCE_PAID_ONLINE` only: which customer paid. A POINTER, not an
|
|
431
|
+
* audience — see {@link BalancePaidCustomerRef}. Operator surfaces only.
|
|
432
|
+
*/
|
|
433
|
+
customerRef?: BalancePaidCustomerRef;
|
|
434
|
+
/**
|
|
435
|
+
* `BALANCE_PAID_ONLINE` only: the online balance-payment attempt
|
|
436
|
+
* (`BAT-{customerId}-{seq}`). Operator surfaces only.
|
|
437
|
+
*/
|
|
438
|
+
balanceAttemptId?: string;
|
|
409
439
|
/** `MENTION` only: the colleague who wrote the mention (a snapshot). */
|
|
410
440
|
actor?: NotificationActor;
|
|
411
441
|
userId?: string;
|
package/dist/notification.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// legacy opt-ins and explicit channel maps remain source data on USER rows.
|
|
4
4
|
// Addressed ERROR / ML_FACTURADOR_COLLISION / ML_SELLER_SWITCHED /
|
|
5
5
|
// ML_CONNECTION_BROKEN / MENTION / CUSTOMER_PENDING_APPROVAL /
|
|
6
|
-
// PAYMENT_ATTEMPT_RESOLUTION / CUSTOMER_WHOLESALE_REQUEST / STOREFRONT_QUOTE_REQUEST /
|
|
6
|
+
// PAYMENT_ATTEMPT_RESOLUTION / BALANCE_PAID_ONLINE / CUSTOMER_WHOLESALE_REQUEST / STOREFRONT_QUOTE_REQUEST /
|
|
7
7
|
// SERVICE_QUOTE_DECIDED /
|
|
8
8
|
// REFUND_OBLIGATION_OVERDUE / MESSAGE_CREDITS_LOW / MESSAGE_SKIPPED_NO_CREDITS do not select a
|
|
9
9
|
// producer subscriber audience;
|
|
@@ -199,6 +199,18 @@ export var NotificationTypeEnum;
|
|
|
199
199
|
* re-opens rings again.
|
|
200
200
|
*/
|
|
201
201
|
NotificationTypeEnum["PAYMENT_ATTEMPT_RESOLUTION"] = "PAYMENT_ATTEMPT_RESOLUTION";
|
|
202
|
+
/**
|
|
203
|
+
* A signed-in buyer paid open cuenta-corriente debits online through Mercado
|
|
204
|
+
* Pago, and the credit landed on their ledger with its «Comprobante de pago»
|
|
205
|
+
* number. Carries {@link NotificationInterface.customerRef} and
|
|
206
|
+
* {@link NotificationInterface.balanceAttemptId} — pointers, never the buyer's
|
|
207
|
+
* name or contact.
|
|
208
|
+
*
|
|
209
|
+
* ⚠️ ADMIN-ONLY, as `PAYMENT_ATTEMPT_RESOLUTION`: one bell per non-disabled
|
|
210
|
+
* ADMIN of the store (`listActiveAdmins`), after the credit committed,
|
|
211
|
+
* best-effort. Its own preference key, default-on when absent; seeded nowhere.
|
|
212
|
+
*/
|
|
213
|
+
NotificationTypeEnum["BALANCE_PAID_ONLINE"] = "BALANCE_PAID_ONLINE";
|
|
202
214
|
/**
|
|
203
215
|
* A signed-in storefront buyer asked for a wholesale account
|
|
204
216
|
* (`POST /user { mode: 'wholesale-request' }`) and the request waits in the
|
package/dist/payment.d.ts
CHANGED
|
@@ -136,6 +136,13 @@ declare global {
|
|
|
136
136
|
externalReference?: string;
|
|
137
137
|
reconciled?: boolean;
|
|
138
138
|
reconcileReason?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The non-fiscal «Comprobante de pago» number, `CPG-{n}`, sequential per
|
|
141
|
+
* store — set only on a payment a buyer made online against their cuenta
|
|
142
|
+
* corriente (`POST /payments/balance-attempts`), stamped with the ledger
|
|
143
|
+
* credit. Never a fiscal «Recibo». Absent on every other payment.
|
|
144
|
+
*/
|
|
145
|
+
receiptNo?: string;
|
|
139
146
|
/**
|
|
140
147
|
* MercadoPago's own money breakdown, in major units of `currency`: `gross` is
|
|
141
148
|
* `transaction_amount`, `net` is `transaction_details.net_received_amount`
|
package/dist/socket.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* A client must ignore actions it does not own rather than assume it
|
|
27
27
|
* receives all of them.
|
|
28
28
|
*/
|
|
29
|
-
export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "payment_received", "mp_payment_status_changed", "payment_linked", "payment_unlinked", "mercadopago", "mercadopago_dynamic_qr_created", "mercadopago_static_qr_created", "mp_hook_log_appended", "mp_ipn_log_appended", "orderPaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "orderReturnRequest", "purchaseWithdrawalChanged", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print-service-order", "print_job_failed", "request_printers", "printers_changed", "agent_status_changed", "print_rules_changed", "printers_active", "agent_command", "maintenance", "currency_auto_updated", "drain_progress", "integration_event_appended", "userActivityRecorded", "mercadolibre_settlement_period", "customDomain", "purchaseOrders", "cycleCounts", "stockTransfers", "workItems", "wholesaleRequests"];
|
|
29
|
+
export declare const SOCKET_ACTIONS: readonly ["account", "appointments", "appointmentWaitlist", "attendance", "attributes", "automation-rules", "baskets", "cart", "brands", "cash", "catalogOperation", "categories", "campaigns", "customers", "customerNote", "customerAddress", "customerContact", "deliveries", "globals", "inventory", "invoices", "literals", "loyalty", "orders", "presupuestos", "products", "promotions", "segments", "returns", "rma", "templates", "services", "service-templates", "shifts", "stores", "suppliers", "supplier-invoice", "support", "surveys", "users", "warehouses", "zones", "favorites", "webhooks", "account-delete", "baskets-delete", "cart-delete", "log-delete", "notifications", "support-message", "payment_received", "mp_payment_status_changed", "payment_linked", "payment_unlinked", "mercadopago", "mercadopago_dynamic_qr_created", "mercadopago_static_qr_created", "mp_hook_log_appended", "mp_ipn_log_appended", "orderPaymentAttempt", "balancePaymentAttempt", "orderDelivery", "paymentAttemptChanged", "orderPurchaseWithdrawal", "orderReturnRequest", "purchaseWithdrawalChanged", "stripe", "subscription", "caea", "print", "print-order", "print-invoice", "print-product", "print-tag", "print-service-order", "print_job_failed", "request_printers", "printers_changed", "agent_status_changed", "print_rules_changed", "printers_active", "agent_command", "maintenance", "currency_auto_updated", "drain_progress", "integration_event_appended", "userActivityRecorded", "mercadolibre_settlement_period", "customDomain", "purchaseOrders", "cycleCounts", "stockTransfers", "workItems", "wholesaleRequests"];
|
|
30
30
|
/** Union of every server→client data-frame action. */
|
|
31
31
|
export type SocketAction = (typeof SOCKET_ACTIONS)[number];
|
|
32
32
|
/**
|
package/dist/socket.js
CHANGED
|
@@ -516,6 +516,15 @@ export const SOCKET_ACTIONS = [
|
|
|
516
516
|
* customer broadcast. Sent once per committed state move of the attempt.
|
|
517
517
|
*/
|
|
518
518
|
'orderPaymentAttempt',
|
|
519
|
+
/**
|
|
520
|
+
* A signed-in buyer's online cuenta-corriente payment attempt changed state.
|
|
521
|
+
* `data` is `BalancePaymentAttemptFrameData` (`balancePayment.ts`) — the
|
|
522
|
+
* attempt id, its state and, once approved, its receipt number.
|
|
523
|
+
*
|
|
524
|
+
* ⚠️ To the attempt's OWN customer only (`wsPostCustomer`), never a
|
|
525
|
+
* store-wide customer broadcast. Sent once per committed state move.
|
|
526
|
+
*/
|
|
527
|
+
'balancePaymentAttempt',
|
|
519
528
|
/**
|
|
520
529
|
* A storefront order's delivery was created or moved. `data` is
|
|
521
530
|
* `OrderDeliveryFrameData` (`delivery.ts`) — the order id and the minimised
|
package/dist/store.d.ts
CHANGED
|
@@ -227,6 +227,21 @@ declare global {
|
|
|
227
227
|
* they see the attempt's `expiresAt` instead.
|
|
228
228
|
*/
|
|
229
229
|
paymentHoldMinutes?: number;
|
|
230
|
+
/**
|
|
231
|
+
* Whether a signed-in storefront buyer may pay open cuenta-corriente
|
|
232
|
+
* debits online through the store's Mercado Pago (Checkout Pro). Absent
|
|
233
|
+
* or `false` = off. Written by `PATCH /store` (ADMIN) and
|
|
234
|
+
* `PUT /platform/stores/{storeId}` (MANAGER) as a plain boolean; storing
|
|
235
|
+
* `true` is never refused.
|
|
236
|
+
*
|
|
237
|
+
* ⚠️ SENT TO SHOPPERS AS THE VERDICT, under this same key (web `GET /store`
|
|
238
|
+
* and the customer `stores` frame): `true` only while the stored value is
|
|
239
|
+
* `true` AND `config.modules.customerAccounts` is not `false` AND Mercado
|
|
240
|
+
* Pago is linked AND the ledger (`config.displayCurrency`) is the peso.
|
|
241
|
+
* Web `GET /account?mode=open-debits` and `POST /payments/balance-attempts`
|
|
242
|
+
* judge the same verdict server-side (`BalancePaymentErrorCode`).
|
|
243
|
+
*/
|
|
244
|
+
onlineBalancePayment?: boolean;
|
|
230
245
|
showStocks?: boolean;
|
|
231
246
|
};
|
|
232
247
|
sidebar?: {
|
|
@@ -273,7 +288,7 @@ declare global {
|
|
|
273
288
|
* (Responsable Inscripto) refuses 409 NET_PLUS_IVA_REQUIRES_RI; nothing written.
|
|
274
289
|
*/
|
|
275
290
|
interface EcommercePatchInput {
|
|
276
|
-
config?: Pick<NonNullable<Ecommerce['config']>, 'showDefaultPriceList' | 'newCustomerPriceList' | 'registrationMode' | 'wholesaleRequests' | 'serviceTracking' | 'paymentHoldMinutes'> & StorefrontLiveSettingsPatch;
|
|
291
|
+
config?: Pick<NonNullable<Ecommerce['config']>, 'showDefaultPriceList' | 'newCustomerPriceList' | 'registrationMode' | 'wholesaleRequests' | 'serviceTracking' | 'paymentHoldMinutes' | 'onlineBalancePayment'> & StorefrontLiveSettingsPatch;
|
|
277
292
|
sidebar?: Ecommerce['sidebar'];
|
|
278
293
|
home?: Omit<NonNullable<Ecommerce['home']>, 'displayOrders' | 'displayProfile'>;
|
|
279
294
|
themeColors?: Ecommerce['themeColors'];
|