Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mercadopago Laravel Package

puntodev/mercadopago

A Laravel/PHP integration for MercadoPago that simplifies creating payment preferences, handling checkout flows, and processing webhooks, giving developers a convenient wrapper for adding MercadoPago payments to their applications.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin Laravel service provider plus a hand-rolled HTTP client against api.mercadopago.com — not a wrapper around the official MercadoPago PHP SDK, contrary to the package description. That distinction matters for procurement: you are not inheriting SDK coverage, you are inheriting a narrow, opinionated surface. The published interfaces (MercadoPago factory, MercadoPagoApi client) are clean and testable, the PaymentPreferenceBuilder/PaymentPreferenceItemBuilder pair removes the worst of Checkout Pro's array-shaped payloads, and withCredentials($id, $secret) + usingSandbox() make per-tenant and per-environment resolution tractable. That is a reasonable shape for a Checkout Pro integration and nothing more.

Scope is materially narrower than the marketing copy. The API contract is: createPaymentPreference, findMerchantOrders, findMerchantOrderById, findPayments, findPaymentById. There is no payment creation (no Checkout API / Bricks / transparent card processing), no refunds or cancellations, no preapproval/subscriptions, and no webhook implementation — "webhooks" means you pass a notification_url and build the receiver, signature validation, idempotency and reconciliation yourself. If the product roadmap includes subscriptions, refunds from the admin panel, or embedded card forms, this package covers roughly the first milestone and then stops.

Integration feasibility. High for a greenfield Checkout Pro flow, with two catches. First, the platform floor is aggressive: php ^8.5 and illuminate/support ^13.0. Most enterprises are on PHP 8.2–8.4 and Laravel 11/12, so this is a hard install blocker, not a soft preference. Second, the credential model is OAuth2 client_credentials (MERCADOPAGO_API_CLIENT_ID / MERCADOPAGO_API_CLIENT_SECRET) with a 1000-second cached bearer token keyed mercadopago-token-{clientId} — not the MERCADOPAGO_ACCESS_TOKEN most MercadoPago tutorials and internal runbooks assume. The supplied onboarding notes contradict the actual config file on this point; expect the first day of integration to be spent on auth, and document the real env keys before handoff.

Technical risk. Enumerated by severity:

  • Bus factor 1. Single maintainer, 2 stars, 0 dependents. Assume no upstream SLA and no security-response process. MIT license is the mitigation — fork is always available.
  • Platform floor drift. Pinning to PHP 8.5/Laravel 13 means the package tracks the bleeding edge, not the LTS. You cannot consume it on an LTS stack, and if you fork you inherit the constraint.
  • Baked-in regional assumptions. auto_return is fixed to all; pending/failure back URLs silently fall back to the success URL; default item currency is ARS. Fine for Argentina-first, wrong for a multi-country LATAM rollout unless every item overrides currency and you accept the back-URL collapse.
  • Error surface is raw. Every call uses ->throw(), so failures arrive as RequestException. Retry/backoff, circuit breaking and dead-letter handling are yours.
  • Test suite is not a quality gate. tests/MercadoPagoApiTest.php makes real HTTP calls and needs live credentials — you cannot run it in your CI, and it tells you nothing about the paths you care about.
  • Credibility gap. Description claims SDK access and full payment management; the code does neither. Treat all capability claims as unverified until read against src/.

Offsetting strengths. Because it uses Laravel's Http facade rather than an SDK's own transport, Http::fake() gives you full request/response control in feature tests. That is a genuine and underrated advantage over SDK-wrapper packages, where testing usually degrades to brittle integration tests against a sandbox.

Key questions for the maintainer / sponsor:

  1. Is the PHP 8.5 / Laravel 13 floor intentional, or will ^11|^12|^13 support be added? This single answer decides adopt vs. fork.
  2. Is webhook signature validation (x-signature / x-request-id manifest) on the roadmap, or is it permanently out of scope?
  3. What is the maintainer's commitment level — is this a product or an internal extraction published for convenience?
  4. Will payment creation, refunds and preapproval be exposed, or is Checkout Pro the permanent boundary?
  5. Why not wrap the official SDK? If the hand-rolled client diverges from MercadoPago API changes, who notices first?

Integration Approach

Stack fit. Fits only a Laravel 13 / PHP 8.5 application. If the target is Laravel 11 or 12, stop here and either fork-and-relax the constraint or consume the official MercadoPago SDK with a hand-written config layer — which, given the package is a handful of classes, is a day of work and buys you control of the version floor.

Migration path. Treat the package as a reference implementation, not a dependency. The recommended path for anything beyond a pilot:

  1. Vendor src/ into a first-party app/Payments/MercadoPago namespace under your own ownership, or fork under an internal Packagist/GitHub mirror. Cost is low; it removes the bus-factor and version-floor risks simultaneously.
  2. If you do consume it as a dependency, pin ^7.0 behind a wrapper gateway (MercadoPagoGateway) that your domain code depends on, never the facade. That wrapper is the seam that makes a later fork or SDK swap a one-file change.
  3. Onboarding trap to script away: confirm the real env keys (*_CLIENT_ID / *_CLIENT_SECRET) and delete the MERCADOPAGO_ACCESS_TOKEN assumption from any internal runbook before the first developer touches it.

Compatibility. Beyond PHP/Laravel: the singleton registration plus a readonly client that captures the useSandbox flag at construction is an Octane/long-lived-worker hazard. Resolve the gateway per request and call withCredentials() explicitly for multi-tenant or marketplace flows rather than mutating config on a cached singleton. Cache keying on clientId is correct and prevents cross-tenant token bleed — verify it holds under your cache driver and TTL configuration.

Sequencing. Stage it so the irreversible decisions happen last:

  1. Spike (2–3 days): fork or vendor, run one preference through sandbox, confirm sandbox_init_point vs init_point behaviour and the OAuth2 token exchange. Do not build UI yet.
  2. Webhook receiver first, checkout second. The notification endpoint is the system of record; building it before the checkout page forces the right architecture instead of bolting fulfilment onto a redirect. Include signature validation, raw payload logging (redacted) and idempotent firstOrCreate on the MercadoPago payment ID.
  3. Amount/currency/external_reference re-verification against the authoritative findPaymentById response before any order state change — the client-supplied price is not trustworthy.
  4. Queue the fulfilment, ack the webhook fast; MercadoPago retries aggressively on slow responses.
  5. Checkout page + back_url pages last, rendering status only — never fulfilling from the redirect.
  6. Only then evaluate whether refunds/subscriptions are needed and budget for that being greenfield work outside this package.

Operational Impact

Maintenance. Own it. With 2 stars, 0 dependents and a single maintainer publishing maintenance-only releases (v7.0.5 is Dependabot plus internal test cleanup — no functional change), the realistic steady state is: you track upstream for API-shape changes in MercadoPago, not for features. Budget a low but non-zero recurring cost — a few days per year for dependency bumps and API drift, more if a MercadoPago API version breaks the preference payload. The Dependabot enablement and Pint-enforced style are positive hygiene signals, but they are evidence of care, not of capacity.

Support. No vendor, no SLA, no security contact, no issue-triage commitment. Escalation path is "read src/, read MercadoPago docs, fix it yourself." Acceptable for a Checkout Pro integration where the failure domain is well-understood; not acceptable if payments are a regulated or revenue-critical path with an audit requirement. For a revenue-critical path, the fork should carry an internal owner, a README stating the divergence, and a named escalation contact.

Scaling. API-client scaling is not the constraint — request volume is trivial relative to MercadoPago's limits and the OAuth2 token caching (1000s, keyed by client ID) keeps token chatter negligible. The real scaling concerns are transactional, not infrastructural: webhook concurrency and duplicate notifications (idempotency required), token-cache cold starts under horizontal scaling, and per-tenant credential resolution under Octane. For marketplace/multi-seller scenarios, withCredentials() gives you the hook, but the resolution layer is yours to build and must be request-scoped.

Failure modes to design against. Auth failures after a deploy because config:cache wasn't re-run after an env change; production init_point used with sandbox credentials or vice versa, producing "payment not found" confusion; amounts sent as integers when the API expects decimals (100× or 1/100× mischarges); unverified webhook payloads treated as truth; duplicate paid notifications double-fulfilling an order; a user closing the tab before the redirect and the order never fulfilling because fulfilment lived in the back_urls handler. Each of these is a support ticket you can pre-empt with a documented runbook and a fixture-based webhook test suite.

Ramp-up. Low for a Laravel developer — under a day to first preference, with the caveat that ~90% of day-to-day questions ("what does payment()->create() take?") are answered by MercadoPago's API docs, not by this package, because the package exposes only five endpoints. The genuine learning investment is on the payments side, not the package side: Checkout Pro vs. Checkout API mental model, init_point semantics, webhook signature verification, and reconciliation against the MercadoPago dashboard. Plan that as payments-domain onboarding, and assign it to whoever owns the webhook and reconciliation work — not to whoever draws the checkout button.

Bottom line. Conditional, scope-limited adoption. The package is a competent, small, well-shaped Checkout Pro helper with real testing advantages, on a platform floor and at a maturity level that make it unsuitable as a long-term external dependency for a critical path. Vendor or fork it, wrap it behind your own gateway interface, budget for webhooks and refunds as first-party work, and re-evaluate if the maintainer broadens Laravel/PHP support and publishes a support posture.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk