@ar-agents/mercadopago 0.5.0 → 0.7.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/AGENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- # @ar-agents/mercadopago — agent guide (v0.5)
1
+ # @ar-agents/mercadopago — agent guide (v0.7)
2
2
 
3
3
  This file is for AI agents using or recommending this package. Humans should start with [README.md](./README.md). Format follows the [agents.md convention](https://agents.md/).
4
4
 
@@ -36,6 +36,15 @@ This file is for AI agents using or recommending this package. Humans should sta
36
36
  | **"Cobrar a través de un seller third-party con fee de marketplace"** (v0.5) | `create_order` con `marketplace_fee` + `collector_id` (o `create_payment_preference` con los mismos campos) |
37
37
  | **"Autorizar ahora, capturar después"** (ride-share, hotel, marketplace) (v0.5) | `create_order` con `capture_mode: "manual"` → cuando completás el servicio, `capture_order(order_id)` |
38
38
  | **"Cancelar una orden no capturada"** (v0.5) | `cancel_order` (libera el auth-hold). Si ya capturó, usá `refund_payment`. |
39
+ | **"Buscame todas las suscripciones del cliente X"** (v0.7) | `search_subscriptions({ payer_email: "..." })` |
40
+ | **"Cambiale la tarjeta a esta suscripción"** (v0.7) | `update_subscription({ subscription_id, card_token_id })` |
41
+ | **"Actualizá el email/dirección del cliente"** (v0.7) | `update_customer` |
42
+ | **"Mostrame los merchant_orders de esta preference"** (v0.7) | `search_merchant_orders({ preference_id })` |
43
+ | **"Listame mis dispositivos Point/Smart"** (v0.7) | `list_point_devices` |
44
+ | **"Cobrá $1000 en el Point que está en la caja"** (v0.7) | `create_point_payment_intent({ device_id, amount_centavos: 100000 })` (¡amount en CENTAVOS!) |
45
+ | **"A qué CBU me deposita MP"** (v0.7) | `list_bank_accounts` (el `is_default: true` es el activo) |
46
+ | **"Calculá el fee del marketplace para este monto"** (v0.7) | `compute_marketplace_fee({ amount_ars, percent, minArs, maxArs })` (PURE — no network) |
47
+ | **"Por qué falló este pago / qué hago ahora"** (v0.7) | `explain_payment_status({ payment_id })` (devuelve `{ summary, recommendedAction, retryable }` en español) |
39
48
 
40
49
  ## The two main "take a payment" patterns
41
50
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - MP v0.7: completeness máxima — el agente de MP más completo posible. **+25 tools (81 total)**.
8
+
9
+ **Cierre de gaps obvios (8 tools)**:
10
+ - `get_customer`, `update_customer`, `create_customer_card`, `get_customer_card`
11
+ - `get_subscription_plan`, `update_subscription`, `search_subscriptions`
12
+ - `get_refund`, `update_payment_preference`
13
+
14
+ **Merchant Orders (3 tools — categoría completa nueva)**:
15
+ - `get_merchant_order`, `search_merchant_orders`, `update_merchant_order`
16
+ - MerchantOrder agrupa Payments asociados a una Preference — clave para reconciliar webhooks con `topic='merchant_order'`.
17
+
18
+ **Stores + POS CRUD completion (6 tools)**:
19
+ - `get_store`, `update_store`, `delete_store`
20
+ - `get_pos`, `update_pos`, `delete_pos`
21
+
22
+ **Bank Accounts (2 tools)**:
23
+ - `list_bank_accounts`, `register_bank_account`
24
+
25
+ **Point Devices físicos (5 tools — categoría nueva)**:
26
+ - `list_point_devices` (terminales físicas: Smart, Tap to Pay)
27
+ - `update_point_device_mode` (PDV vs STANDALONE)
28
+ - `create_point_payment_intent` (push payment al device — amount en CENTAVOS)
29
+ - `get_point_payment_intent`, `cancel_point_payment_intent`
30
+
31
+ **Pure helpers (2 tools, high-leverage)**:
32
+ - `compute_marketplace_fee` — given amount + (% o flat ARS, con min/max), returns exact `marketplace_fee`
33
+ - `explain_payment_status` — dado un Payment, traduce los 30+ status_detail codes a `{ summary, recommendedAction, final, paid, retryable }` en español
34
+
35
+ Type exports: `MerchantOrder`, `BankAccount`, `PointDevice`, `PointPaymentIntent`, `PointPaymentIntentState`, `CreatePointPaymentIntentParams`, `MarketplaceFeeRule`, `PaymentStatusExplanation`.
36
+
37
+ Helpers exportados: `computeMarketplaceFee`, `explainPaymentStatus`.
38
+
39
+ Cliente extendido: `request<T>` ahora soporta PATCH (necesario para Point devices).
40
+
41
+ **169 tests pass** (was 132; +37 v0.7 tests). publint clean. attw 🟢. 31.4 KB brotli'd.
42
+
43
+ **Cubre el 100% de lo que MP expone como API pública remota.** Operaciones dashboard-only (verificación de identidad, transferencias account-to-account, configuración de notificaciones por email, fraud rules) NO están — tampoco lo están en ningún SDK oficial de MP.
44
+
45
+ ## 0.6.0
46
+
47
+ ### Minor Changes
48
+
49
+ - MP v0.6: account/balance + settlements + 3DS analyzer + test cards. **+6 tools (56 total)**.
50
+
51
+ **Account / Balance / Settlements (4 tools)**:
52
+
53
+ - `get_account_balance` — current MP wallet `{ available, unavailable, total, currency_id }`. Per-seller in marketplace setups.
54
+ - `list_account_movements({ from?, to?, limit?, offset? })` — wallet movement log (incoming payments, refunds, holdings, transfers).
55
+ - `list_settlements({ from?, to?, status? })` — `release_money` transfers from MP wallet → registered CBU.
56
+ - `get_settlement(id)` — single settlement detail with bank_account info.
57
+
58
+ **3DS analyzer (1 tool + 1 helper)**:
59
+
60
+ - `analyze_payment_3ds(payment_id)` — fetches the Payment, derives `{ status: 'not_required'|'frictionless'|'challenge_required'|'rejected'|'unknown', mode, challengeUrl, description }`. When `challengeUrl !== null`, MUST redirect the buyer to complete authentication.
61
+ - `analyze3DS(payment)` exported as a pure helper for callers who already have a Payment object.
62
+
63
+ **Test cards (1 tool + helpers)**:
64
+
65
+ - `get_test_cards` — returns the official AR (MLA) sandbox cards: VISA/Mastercard/Amex credit + debit. Each has the "magic" holder names that route to specific status_detail (APRO, OTHE, CONT, FUND, CALL, SECU, EXPI, FORM).
66
+ - `TEST_CARDS_AR`, `TEST_PAYERS_AR`, `buildTestCardScenario(card, scenario, amount)` exported for direct use in test files.
67
+
68
+ **132 tests pass** (was 117; +15 v0.6 tests). publint clean. attw 🟢. 24.3 KB brotli'd (within 32 KB budget).
69
+
3
70
  ## 0.5.0
4
71
 
5
72
  ### Minor Changes
package/README.md CHANGED
@@ -18,7 +18,7 @@ Compatible with any caller that uses `tool()`.
18
18
 
19
19
  | What | Value |
20
20
  | --- | --- |
21
- | Tools shipped | **50 tools** — Subscriptions, Payments, Refunds, Checkout Pro, Customers, Saved Cards, Cuotas, QR in-store, Subscription Plans, Stores+POS, Disputes, Lookups, Webhooks management, **handle_webhook combo**, **OAuth Marketplace flow**, **Order Management API** |
21
+ | Tools shipped | **81 tools** — covers the full agent-relevant MP API surface. Subscriptions, Payments, Refunds, Checkout Pro, Order Management, Customers, Saved Cards, Cuotas, QR in-store, Subscription Plans, Stores+POS, **Point Devices físicos**, **Merchant Orders**, **Bank Accounts**, Disputes, Lookups, Webhooks management, **handle_webhook combo**, **OAuth Marketplace flow**, **Account/Balance/Settlements**, **3DS analyzer**, **Test cards**, plus pure helpers `compute_marketplace_fee` + `explain_payment_status`. |
22
22
  | External dependencies | Mercado Pago access token (TEST or APP_USR), state adapter (Upstash, Redis, Postgres, in-memory, etc.) |
23
23
  | Latency | 200–600ms per MP call; <1ms for state ops |
24
24
  | Cost | $0 — MP API is free; merchant pays per-transaction fees on auto-charges |