platform-types 1.10.795 → 1.10.796
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/cjs/paymentAttempt.js +15 -1
- package/dist/order.d.ts +18 -0
- package/dist/paymentAttempt.d.ts +32 -0
- package/dist/paymentAttempt.js +14 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* no operator write can carry it back onto the order.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.PAYMENT_HOLD_MINUTES_DEFAULT = exports.PAYMENT_HOLD_MINUTES_MAX = exports.PAYMENT_HOLD_MINUTES_MIN = exports.PAYMENT_ATTEMPT_RESOLUTION_CAUSES = exports.ORDER_NOT_PAYABLE_REASONS = exports.PAYMENT_ATTEMPT_RESOLUTION_REASON_MAX = exports.PAYMENT_ATTEMPT_RESOLUTION_OUTCOMES = exports.PAYMENT_ATTEMPT_ERROR_CODES = exports.PAYMENT_ATTEMPT_STATES = void 0;
|
|
22
|
+
exports.PAYMENT_HOLD_MINUTES_DEFAULT = exports.PAYMENT_HOLD_MINUTES_MAX = exports.PAYMENT_HOLD_MINUTES_MIN = exports.PAYMENT_ATTEMPT_RESOLUTION_CAUSES = exports.ORDER_NOT_PAYABLE_REASONS = exports.PAYMENT_ATTEMPT_RESOLUTION_REASON_MAX = exports.PAYMENT_ATTEMPT_RESOLUTION_OUTCOMES = exports.GUEST_PAYMENT_ERROR_CODES = exports.PAYMENT_ATTEMPT_ERROR_CODES = exports.PAYMENT_ATTEMPT_STATES = void 0;
|
|
23
23
|
/** Every {@link PaymentAttemptState}, in lifecycle order. */
|
|
24
24
|
exports.PAYMENT_ATTEMPT_STATES = [
|
|
25
25
|
'created',
|
|
@@ -71,6 +71,20 @@ exports.PAYMENT_ATTEMPT_ERROR_CODES = [
|
|
|
71
71
|
'PAYMENT_ATTEMPT_NOT_IN_RESOLUTION',
|
|
72
72
|
'PAYMENT_ATTEMPT_CHANGED',
|
|
73
73
|
];
|
|
74
|
+
/**
|
|
75
|
+
* The refusal the guest payment start (`POST /payments/attempts/guest`) answers
|
|
76
|
+
* itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
|
|
77
|
+
* the signed-in start.
|
|
78
|
+
*
|
|
79
|
+
* - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
|
|
80
|
+
* honoured: missing, tampered, another version (a guest STATUS token
|
|
81
|
+
* included), expired (7 days after it was issued), minted for another order
|
|
82
|
+
* or another store, presented on another store's host, or naming an order
|
|
83
|
+
* that is not — or is no longer — an unattached guest order (attached to an
|
|
84
|
+
* account, its buyer then pays signed in). One identical body, so the grant is
|
|
85
|
+
* never an oracle.
|
|
86
|
+
*/
|
|
87
|
+
exports.GUEST_PAYMENT_ERROR_CODES = ['GUEST_PAYMENT_GRANT_INVALID'];
|
|
74
88
|
/**
|
|
75
89
|
* Every `outcome` of {@link ResolvePaymentAttemptRequest}:
|
|
76
90
|
*
|
package/dist/order.d.ts
CHANGED
|
@@ -2494,6 +2494,24 @@ declare global {
|
|
|
2494
2494
|
expectedCartId: string;
|
|
2495
2495
|
expectedCartVersion: number;
|
|
2496
2496
|
}
|
|
2497
|
+
/**
|
|
2498
|
+
* `data` of a successful Web `POST /orders/guest`: the placed order, as the
|
|
2499
|
+
* signed-in checkout answers it (the storefront reads `orderId`), plus the
|
|
2500
|
+
* guest's payment grant.
|
|
2501
|
+
*/
|
|
2502
|
+
interface StorefrontGuestOrderCreateResponse extends Partial<Order> {
|
|
2503
|
+
orderId: string;
|
|
2504
|
+
/**
|
|
2505
|
+
* The guest payment grant (`gp1.…`) for THIS order, valid 7 days: the
|
|
2506
|
+
* credential `POST /payments/attempts/guest` takes
|
|
2507
|
+
* ({@link StartGuestPaymentAttemptRequest}). Present only when the order
|
|
2508
|
+
* can be paid online when the answer is built (its payment method row
|
|
2509
|
+
* declares `storefront: 'mp-checkout-pro'`, pesos, something to charge) and
|
|
2510
|
+
* the grant could be minted; absent otherwise. A replay of the checkout
|
|
2511
|
+
* answers a freshly minted one. Keep it in memory or the URL fragment only.
|
|
2512
|
+
*/
|
|
2513
|
+
paymentGrant?: string;
|
|
2514
|
+
}
|
|
2497
2515
|
interface ZebraTag {
|
|
2498
2516
|
orderId: string;
|
|
2499
2517
|
fullName: string;
|
package/dist/paymentAttempt.d.ts
CHANGED
|
@@ -57,6 +57,8 @@ declare global {
|
|
|
57
57
|
type PaymentAttemptState = (typeof PAYMENT_ATTEMPT_STATES)[number];
|
|
58
58
|
/** One of {@link PAYMENT_ATTEMPT_ERROR_CODES}. */
|
|
59
59
|
type PaymentAttemptErrorCode = (typeof PAYMENT_ATTEMPT_ERROR_CODES)[number];
|
|
60
|
+
/** One of {@link GUEST_PAYMENT_ERROR_CODES}. */
|
|
61
|
+
type GuestPaymentErrorCode = (typeof GUEST_PAYMENT_ERROR_CODES)[number];
|
|
60
62
|
/** One of {@link ORDER_NOT_PAYABLE_REASONS}. */
|
|
61
63
|
type OrderNotPayableReason = (typeof ORDER_NOT_PAYABLE_REASONS)[number];
|
|
62
64
|
/** One of {@link PAYMENT_ATTEMPT_RESOLUTION_CAUSES}. */
|
|
@@ -71,6 +73,22 @@ declare global {
|
|
|
71
73
|
interface StartPaymentAttemptRequest {
|
|
72
74
|
orderId: string;
|
|
73
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Web `POST /payments/attempts/guest` body: a buyer with NO account starts
|
|
78
|
+
* (or gets back the live) payment attempt of one guest order. Answers
|
|
79
|
+
* {@link StartPaymentAttemptResponse}, with every {@link PAYMENT_ATTEMPT_ERROR_CODES}
|
|
80
|
+
* refusal the signed-in start answers, plus {@link GUEST_PAYMENT_ERROR_CODES}.
|
|
81
|
+
*/
|
|
82
|
+
interface StartGuestPaymentAttemptRequest {
|
|
83
|
+
orderId: string;
|
|
84
|
+
/**
|
|
85
|
+
* The guest payment grant (`gp1.…`) the guest checkout answered
|
|
86
|
+
* (`StorefrontGuestOrderCreateResponse.paymentGrant`) or the order email's
|
|
87
|
+
* "Pagar" link carried in its `#pagar=` fragment. A bearer credential:
|
|
88
|
+
* never put it in a URL a server or Mercado Pago sees, nor in `back_urls`.
|
|
89
|
+
*/
|
|
90
|
+
paymentGrant: string;
|
|
91
|
+
}
|
|
74
92
|
/** `data` of a successful start. A repeat start while the attempt is live answers the same `attemptId`. */
|
|
75
93
|
interface StartPaymentAttemptResponse {
|
|
76
94
|
attemptId: string;
|
|
@@ -237,6 +255,20 @@ export declare const PAYMENT_ATTEMPT_STATES: readonly ["created", "pending", "ap
|
|
|
237
255
|
* written; `data` is {@link PaymentAttemptChangedData}.
|
|
238
256
|
*/
|
|
239
257
|
export declare const PAYMENT_ATTEMPT_ERROR_CODES: readonly ["PAYMENT_PROVIDER_NOT_CONNECTED", "PAYMENT_PROVIDER_TOKEN_EXPIRED", "ORDER_NOT_PAYABLE", "PAYMENT_ATTEMPT_EXPIRED", "PAYMENT_METHOD_UNAVAILABLE", "MP_PREFERENCE_CREATE_FAILED", "PAYMENT_ATTEMPT_NOT_FOUND", "PAYMENT_ATTEMPT_NOT_IN_RESOLUTION", "PAYMENT_ATTEMPT_CHANGED"];
|
|
258
|
+
/**
|
|
259
|
+
* The refusal the guest payment start (`POST /payments/attempts/guest`) answers
|
|
260
|
+
* itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
|
|
261
|
+
* the signed-in start.
|
|
262
|
+
*
|
|
263
|
+
* - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
|
|
264
|
+
* honoured: missing, tampered, another version (a guest STATUS token
|
|
265
|
+
* included), expired (7 days after it was issued), minted for another order
|
|
266
|
+
* or another store, presented on another store's host, or naming an order
|
|
267
|
+
* that is not — or is no longer — an unattached guest order (attached to an
|
|
268
|
+
* account, its buyer then pays signed in). One identical body, so the grant is
|
|
269
|
+
* never an oracle.
|
|
270
|
+
*/
|
|
271
|
+
export declare const GUEST_PAYMENT_ERROR_CODES: readonly ["GUEST_PAYMENT_GRANT_INVALID"];
|
|
240
272
|
/**
|
|
241
273
|
* Every `outcome` of {@link ResolvePaymentAttemptRequest}:
|
|
242
274
|
*
|
package/dist/paymentAttempt.js
CHANGED
|
@@ -68,6 +68,20 @@ export const PAYMENT_ATTEMPT_ERROR_CODES = [
|
|
|
68
68
|
'PAYMENT_ATTEMPT_NOT_IN_RESOLUTION',
|
|
69
69
|
'PAYMENT_ATTEMPT_CHANGED',
|
|
70
70
|
];
|
|
71
|
+
/**
|
|
72
|
+
* The refusal the guest payment start (`POST /payments/attempts/guest`) answers
|
|
73
|
+
* itself, beside every {@link PAYMENT_ATTEMPT_ERROR_CODES} entry it shares with
|
|
74
|
+
* the signed-in start.
|
|
75
|
+
*
|
|
76
|
+
* - `GUEST_PAYMENT_GRANT_INVALID` · 401 — every reason the grant cannot be
|
|
77
|
+
* honoured: missing, tampered, another version (a guest STATUS token
|
|
78
|
+
* included), expired (7 days after it was issued), minted for another order
|
|
79
|
+
* or another store, presented on another store's host, or naming an order
|
|
80
|
+
* that is not — or is no longer — an unattached guest order (attached to an
|
|
81
|
+
* account, its buyer then pays signed in). One identical body, so the grant is
|
|
82
|
+
* never an oracle.
|
|
83
|
+
*/
|
|
84
|
+
export const GUEST_PAYMENT_ERROR_CODES = ['GUEST_PAYMENT_GRANT_INVALID'];
|
|
71
85
|
/**
|
|
72
86
|
* Every `outcome` of {@link ResolvePaymentAttemptRequest}:
|
|
73
87
|
*
|