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

Dx Php Laravel Package

mercadopago/dx-php

Official Mercado Pago SDK for PHP, making it easy to add payments to Laravel or any PHP app. Create checkout preferences, process payments, manage subscriptions, and handle webhooks and notifications through a clean, object-oriented API.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

mercadopago/dx-php is a framework-agnostic vendor SDK, not a Laravel package. Per the metadata provided it ships no ServiceProvider, no facade, no publishable config, and no Laravel-idiomatic contracts. That is a known and manageable gap, but it dictates the architecture: treat the SDK as an anti-corruption layer boundary, not as a library to sprinkle through controllers and jobs.

The specific fit problem is configuration and state. The SDK's access token is configured through a static/global entry point, and its resource objects are dynamic-property models ($payment->status on loosely-typed objects). In a standard single-tenant Laravel app this works. In a multi-tenant, marketplace, or OAuth-split-payment deployment — or under Laravel Octane / long-running workers where statics persist across requests — it is a correctness hazard. Any adoption plan must wrap the SDK in a single resolved service with per-tenant token resolution at call time, and must not rely on the static configurator surviving a request boundary.

Integration feasibility

Feasible at low-to-moderate effort. composer require mercadopago/dx-php, an adapter class, a webhook route excluded from CSRF, a queue job for reconciliation, and environment-scoped credentials gets a Checkout Pro flow running in days. Cost scales with product surface, not with the SDK itself:

Scope Relative effort Notes
Checkout Pro (redirect) Low Single preference create + webhook
Payment Bricks (embedded) Medium Client-side tokenization, PCI scope changes
Webhooks + signature validation Medium Must be built around the SDK, not by it
Subscriptions / preapproval Medium-High Lifecycle state machine is yours
Marketplace / split payments High OAuth token storage, refresh, per-seller config

Technical risk

  • Global mutable state — the dominant risk; conflicts with DI, Octane, queue workers, and parallel test execution.
  • Untyped models — no static analysis safety; field drift after an API change surfaces at runtime, in production, on a money path.
  • Version pinning — vendor SDKs commonly track the live API rather than semver guarantees. Pin exact versions and treat upgrades as change-managed events, not composer update noise.
  • Provenance gap — "Repository: unknown" alongside 430 stars is a supply-chain signal worth clearing before adoption. Confirm the Packagist vendor is the first-party publisher, verify the source repo and release signing, and mirror the dependency if the answer is unclear. For a payments dependency this is not optional diligence.
  • Low opportunity score (2.19) — read this as: the SDK is commodity plumbing with no differentiation value. Adopt it rather than build it, but do not let it leak into domain code, because you will want to swap or bypass it (direct HTTP against the documented API) at some point.

Key questions

  1. Which Mercado Pago products are in scope, and in which countries/currencies? LatAm coverage varies by product.
  2. Is this single-tenant (one merchant account) or marketplace (per-seller OAuth)? This changes the architecture, not just the config.
  3. Does the team accept redirect-based Checkout Pro (SAQ-A) or does the product require embedded Brick fields (larger PCI scope)?
  4. Who owns the direct-HTTP fallback if the SDK lags an API change on a critical path?
  5. What is the reconciliation source of truth — webhook only, or webhook plus a scheduled poll of the payments/search endpoint?
  6. Are we on Octane or queue workers with persistent state today?

Integration Approach

Stack fit

Compatible with a modern Laravel stack (PHP 8.x, Laravel 10/11/12) via Composer. Watch for a Guzzle version constraint conflict if the app already pins Guzzle explicitly; otherwise the dependency graph is shallow. It brings no frontend opinion, which is a plus — Checkout Bricks is a separate JS concern and should be treated as its own integration with its own version pin.

Recommended shape:

  • config/mercadopago.php — env-scoped credentials, webhook secret, mode (sandbox/prod), timeouts.
  • MercadoPagoClient — a thin, injectable adapter with explicit methods (createPreference, getPayment, refund) that returns your own DTOs, never SDK objects.
  • Token resolution strategy interface — single-tenant today, per-seller tomorrow, without touching call sites.
  • WebhookEvent job + signature middleware, decoupled from the SDK's own parsing.
  • Contract tests against the sandbox, plus recorded fixtures so CI does not depend on Mercado Pago uptime.

Migration path

If the app currently talks to Mercado Pago over raw HTTP, or to another LatAm gateway, sequence it as a parallel-run cutover rather than a rewrite: stand up the adapter behind an interface, route a low-risk traffic slice or a single country/currency through it, reconcile both ledgers for a full settlement cycle, then retire the old path. Because the adapter returns your own DTOs, the swap later to direct HTTP — if the SDK disappoints — is an internal change with no blast radius on domain code.

Compatibility

Confirm PHP minor-version support and the exact PHPUnit/Pest compatibility of the SDK's own test suite if you intend to extend it. Do not depend on SDK internals for testing; wrap and mock at your interface. Multi-currency and locale formatting must be handled in your layer.

Sequencing

  1. Provenance and license clearance (MIT is permissive; attribution and notice retention only) — do this first.
  2. Config + client adapter + token resolution, merged behind a disabled flag.
  3. Checkout Pro happy path in sandbox, end to end, with contract tests.
  4. Webhook route, signature validation, idempotent event handling.
  5. Reconciliation job and ledger mapping — the step most often skipped and most often regretted.
  6. Refunds, chargebacks/disputes, subscription lifecycle if in scope.
  7. Production canary, then full traffic.

Operational Impact

Maintenance

Modest but non-zero. Budget for a quarterly review of SDK releases against the Mercado Pago changelog, and for a named owner of the payments integration — not a shared team responsibility. Because the SDK is untyped, every upgrade needs a sandbox smoke test across create/authorize/capture/refund/webhook, not just a green CI run. Keep the dependency pinned in composer.lock and upgrade deliberately.

Support

Vendor support quality is the weak link: 430 stars for an "official" SDK implies a thin community surface, so Stack Overflow and issue-tracker answers will be sparse relative to Stripe's ecosystem. Institutional knowledge must be built internally and documented — the adapter, the failure taxonomy, the reconciliation runbook, and the sandbox credential rotation procedure. Escalation goes through Mercado Pago's developer support, not through the repo.

Scaling

The SDK is not a throughput bottleneck; your outbound HTTP and Mercado Pago's rate limits are. Two real scaling concerns: (a) webhook ingestion bursts — terminate fast, verify, enqueue, return 200, never process inline; (b) reconciliation polling — paginate and rate-limit, and do not poll per-order. If you run Octane, the global-state risk is a scaling risk, not just a correctness one, because workers are reused.

Failure modes to design for

  • Duplicate and out-of-order webhooks — idempotency key on event ID plus a monotonic status guard; a pending event must never overwrite an approved one.
  • Silent webhook loss — scheduled reconciliation against the payments/search endpoint is mandatory, not defensive.
  • Timeouts and partial writes — an outbound create that times out may still have created a payment. Persist intent before the call, reconcile after.
  • Static token leakage across tenants or workers — the highest-severity failure; mitigated only by the adapter discipline above.
  • Card declines and 3DS challenges — these are business outcomes, not exceptions; model them as states.
  • OAuth token expiry (marketplace) — refresh proactively; a stale seller token produces confusing downstream errors.
  • Sandbox/production credential crossover — enforce mode in config and fail loudly at boot.

Ramp-up

One experienced backend engineer reaches productive velocity in roughly one to two weeks if the adapter and reconciliation patterns are established first; the SDK's surface is small and the Mercado Pago docs are adequate. The real ramp-up cost is on-call: whoever carries the pager needs the failure taxonomy and the reconciliation runbook, and that is a one-to-two-month maturity curve, not a sprint task. Plan for it explicitly, and gate the go-live on a tested refund and dispute path — those are the flows that arrive at the worst possible moment.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator