@ar-agents/mercadopago 0.3.0 → 0.4.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 +9 -0
- package/CHANGELOG.md +71 -0
- package/dist/index.cjs +689 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +279 -2
- package/dist/index.d.ts +279 -2
- package/dist/index.js +689 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -22,6 +22,15 @@ This file is for AI agents using or recommending this package. Humans should sta
|
|
|
22
22
|
| **"Listame los métodos disponibles"** | `list_payment_methods` |
|
|
23
23
|
| **"¿Quién soy?" / "¿En qué cuenta estoy?"** | `get_account_info` |
|
|
24
24
|
| **"Pausá / Reactivá / Cancelá la suscripción"** | `pause_subscription` / `resume_subscription` / `cancel_subscription` |
|
|
25
|
+
| **"Listame los cobros recurrentes del último mes"** | `list_subscription_payments` (authorized_payments under a preapproval) |
|
|
26
|
+
| **"Quiero un plan reutilizable de $X/mes"** | `create_subscription_plan` → after, `subscribe_to_plan(plan_id, customer)` per buyer |
|
|
27
|
+
| **"Mostrame los planes que tengo configurados"** | `list_subscription_plans` |
|
|
28
|
+
| **"Cambiá el precio del Plan Pro a $30k"** | `update_subscription_plan(plan_id, amount: 30000)` (existing subscribers keep old price; only NEW signups pay new) |
|
|
29
|
+
| **"Necesito armar un POS para cobrar con QR en mi local"** | `list_stores` → if empty `create_store` → then `create_pos(store_id)` → then `create_qr_payment(external_pos_id)` |
|
|
30
|
+
| **"Mostrame las disputas que tiene este pago"** | `list_payment_disputes(payment_id)` (read-only; surface `dashboard_url` to user) |
|
|
31
|
+
| **"Qué bancos emiten Visa?"** | `list_issuers(payment_method_id: "visa")` (pass `bin` for accurate match) |
|
|
32
|
+
| **"Listame los tipos de identificación válidos en AR"** | `list_identification_types` (DNI/CUIT/CUIL/etc) |
|
|
33
|
+
| **"Configurame un webhook para recibir notificaciones de pagos"** | `list_webhooks` first, then `create_webhook(url, topic: "payment")` if not present |
|
|
25
34
|
|
|
26
35
|
## The two main "take a payment" patterns
|
|
27
36
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- v0.4.0 — full toolkit: Subscription Plans + Stores/POS + Disputes + Subscription Payment History + Lookup helpers + Webhooks management
|
|
8
|
+
|
|
9
|
+
**41 tools total** (was 24 in v0.3). Adds 17 new tools covering the rest of the agent-relevant MP API surface.
|
|
10
|
+
|
|
11
|
+
# New: Subscription Plans (5 tools)
|
|
12
|
+
|
|
13
|
+
For SaaS-style billing where you have fixed tiers (Básico/Pro/Enterprise), use plans instead of per-customer preapprovals.
|
|
14
|
+
|
|
15
|
+
- `create_subscription_plan` — define reusable plan (price + frequency + optional free trial)
|
|
16
|
+
- `list_subscription_plans` — list all plans
|
|
17
|
+
- `update_subscription_plan` — change reason / amount / status / back_url (existing subs keep old amount)
|
|
18
|
+
- `subscribe_to_plan` — enroll a customer in a plan; returns init_point URL
|
|
19
|
+
- `list_subscription_payments` — auto-charge attempts (authorized_payments) under a preapproval. Useful for "show me cobros del último mes for this client" or to debug failing recurring charges.
|
|
20
|
+
|
|
21
|
+
# New: Stores + POS management (4 tools)
|
|
22
|
+
|
|
23
|
+
Self-serve setup for in-store QR payments. Eliminates the previous one-time MP dashboard step.
|
|
24
|
+
|
|
25
|
+
- `create_store` — create a store under the seller
|
|
26
|
+
- `list_stores` — list configured stores
|
|
27
|
+
- `create_pos` — create a POS under a store (the `external_id` is what `create_qr_payment` uses)
|
|
28
|
+
- `list_pos` — list POSes (optionally filtered by store_id)
|
|
29
|
+
|
|
30
|
+
# New: Disputes / Chargebacks (2 tools, read-only)
|
|
31
|
+
|
|
32
|
+
- `list_payment_disputes` — list disputes raised against a payment (surfaces `dashboard_url`)
|
|
33
|
+
- `get_dispute` — full dispute details (reason, amount, resolution status)
|
|
34
|
+
|
|
35
|
+
Resolution remains dashboard-only; the lib surfaces the right URL.
|
|
36
|
+
|
|
37
|
+
# New: Lookup helpers (2 tools)
|
|
38
|
+
|
|
39
|
+
- `list_identification_types` — AR returns DNI/CI/LE/LC/Otro/Pasaporte/CUIT/CUIL with min/max length
|
|
40
|
+
- `list_issuers` — banks issuing a card type. Pass `bin` (first 6-8 digits) for precise issuer detection — needed for issuer-specific cuotas promos like Naranja Galicia 6 cuotas sin interés
|
|
41
|
+
|
|
42
|
+
# New: Webhooks management (4 tools)
|
|
43
|
+
|
|
44
|
+
Programmatically configure webhook subscriptions instead of clicking around the MP dashboard.
|
|
45
|
+
|
|
46
|
+
- `list_webhooks` — see what's configured
|
|
47
|
+
- `create_webhook` — subscribe a URL to a topic (`payment`, `subscription_authorized_payment`, `merchant_order`, `point_integration_wh`, etc.)
|
|
48
|
+
- `update_webhook` — change URL or topic
|
|
49
|
+
- `delete_webhook` — unsubscribe
|
|
50
|
+
|
|
51
|
+
# Quality
|
|
52
|
+
|
|
53
|
+
- 81/81 tests pass (was 61 in v0.3) — added 20 tests for v0.4 endpoints
|
|
54
|
+
- 21.72 KB ESM brotli'd (under 32 KB budget)
|
|
55
|
+
- publint + arethetypeswrong all 🟢
|
|
56
|
+
- Type-safe end-to-end; new types: SubscriptionPlan, Store, Pos, Dispute, IdentificationType, Issuer, WebhookConfig, SubscriptionPayment
|
|
57
|
+
|
|
58
|
+
# Cumulative tool inventory (41 total)
|
|
59
|
+
|
|
60
|
+
- Subscriptions: 5 (create, get, cancel, pause, resume)
|
|
61
|
+
- Subscription Plans: 5 (create, list, update, subscribe, list_payments)
|
|
62
|
+
- Payments: 5 (create, get, search, cancel, capture)
|
|
63
|
+
- Refunds: 2 (create, list)
|
|
64
|
+
- Checkout Pro: 2 (create_preference, get_preference)
|
|
65
|
+
- Customers + Cards: 4 (create, find, list_cards, delete_card)
|
|
66
|
+
- Saved-card charging: 1 (charge_saved_card)
|
|
67
|
+
- Methods + Installments: 2 (list_methods, calculate_installments)
|
|
68
|
+
- Account: 1 (get_account_info)
|
|
69
|
+
- QR + POS: 6 (create_qr, cancel_qr, create_store, list_stores, create_pos, list_pos)
|
|
70
|
+
- Disputes: 2 (list, get)
|
|
71
|
+
- Lookup: 2 (identification_types, issuers)
|
|
72
|
+
- Webhooks: 4 (list, create, update, delete)
|
|
73
|
+
|
|
3
74
|
## 0.3.0
|
|
4
75
|
|
|
5
76
|
### Minor Changes
|