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

Conekta Php Laravel Package

conekta/conekta-php

Official PHP SDK for Conekta payments (requires PHP 8.1+). Install via Composer, authenticate with a bearer token, and call generated API clients for charges, customers, orders, and antifraud rules.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package is an OpenAPI-generated HTTP client, not a Laravel package. There is no service provider, facade, config file, or publishable assets. It is a thin, stateless binding over Conekta's REST API using GuzzleHttp\Client.
  • Fit is therefore "library in the domain layer," not "framework citizen." In a Laravel app it belongs behind an adapter: App\Payments\Conekta\ConektaGateway bound to the container, with SDK Api\* classes injected, not resolved ad hoc in controllers or jobs.
  • The SDK's Configuration::getDefaultConfiguration() singleton with setAccessToken() is a global mutable-state design. This is the single largest architectural hazard: any code path that mutates the default configuration (multi-tenant credentials, per-environment overrides, queued jobs in long-lived workers) can silently charge the wrong merchant account. Construct and inject an explicit Configuration instance per tenant/connection instead.
  • Custom ClientInterface injection is supported on every API class, which is the hook that makes this testable and observable. Treat that as a design requirement, not a nice-to-have.
  • The package is server-side only. Card data capture still happens client-side (Conekta.js tokens), which keeps PCI scope at SAQ-A-ish, but confirm the token flow is documented and that no raw PAN ever transits this SDK.

Integration feasibility

  • Low technical difficulty, low package maturity. PHP 8.1+ requirement is compatible with current Laravel 10/11/12 baselines but excludes any application still on PHP 8.0 — verify the fleet before committing.
  • The installation instructions are a red flag for production use. The README recommends a Composer VCS repository entry with "conekta/conekta-php": "*@dev". A wildcard dev constraint on a payments SDK means unpinned, unreviewed code changes flowing into production on any composer update. Do not adopt as written; pin a tagged release and use a committed lockfile. If no suitable tag exists, fork and tag internally.
  • Guzzle version coupling is a real constraint: Laravel's HTTP client, existing SDKs, and Guzzle 7 vs 8 support must be resolved in one dependency graph. Check composer.json constraints before the spike, not during it.
  • Error handling is generated-style: ApiException carrying status/response body. Mapping Conekta's error taxonomy (declined card, insufficient funds, invalid request, auth failure, rate limit) into internal domain exceptions is work you must budget, and it's the difference between a clean retry/refund policy and string-matching hell.

Technical risk (initial rating: medium-high, driven by blast radius rather than code quality)

  • Money-path blast radius. Any defect here is a customer-facing charge, refund, or reconciliation break. The package's own quality is secondary to the control envelope you build around it.
  • Vendor concentration. 91 stars and 0 dependents indicates minimal community scrutiny — no third-party battle-testing, and issues may go unanswered. Mitigant: it's generated from a public OpenAPI spec, so worst-case fork/regenerate cost is bounded and MIT licensing permits it.
  • Generated-code churn. The 2026-07-14 release date combined with auto-generated provenance suggests a high-frequency regeneration cadence. Regeneration can rename models, change constructor signatures, or alter nullable fields in ways that are technically semver-compliant but break call sites. Pin, review diffs on upgrade, and never auto-merge bot releases.
  • Idempotency is unverified. Payment creation without an idempotency key plus a network timeout equals duplicate charges. Confirm whether the SDK surfaces an idempotency header on charge/order creation; if not, this is a blocking gap for any retry logic.
  • Credential exposure surface. Bearer tokens passed to a singleton config can leak into logs, exception traces, or debug dumps of Configuration objects.

Key questions

  1. Does the SDK expose idempotency keys on order/charge creation, and is retry behavior safe by default?
  2. Is there a tagged, semver-stable release we can pin, or is the intended path *@dev against a moving branch?
  3. Which Conekta API version does the package target, and what's the vendor's deprecation policy for older SDK majors?
  4. Does the generated client support per-instance configuration cleanly enough for multi-tenant or multi-currency-account use?
  5. Does webhook signature verification ship in the SDK, or must we implement it?
  6. Are timeouts, connection pooling, and retry middleware configurable, or do we inherit Guzzle defaults (no timeout, no retries)?
  7. What payment methods must be in scope — cards, SPEI, OXXO/cash, MSI installments — and are all modeled in this binding?
  8. What is the vendor's support channel and SLA, and is there a commercial relationship available?

Integration Approach

Stack fit

  • Treat as a driven adapter in a hexagonal boundary: PaymentGateway interface in the domain, ConektaPaymentGateway implementation wrapping SDK Api\* classes and model DTOs. Domain code must never import Conekta\Model\* or Conekta\Api\*. This single decision contains SDK churn, makes vendor swap (Mercado Pago, Stripe MX) a one-class exercise, and makes unit tests trivial.
  • Register in a dedicated service provider: bind a Configuration factory (per environment, per merchant account) as a scoped/singleton service, bind API classes as factories, and bind the gateway to the interface.
  • Credentials in config/services.php reading from env/secret manager. Never in Configuration::getDefaultConfiguration() mutated at runtime.
  • Inject a configured GuzzleHttp\Client with explicit timeout, connect_timeout, and middleware for request/response logging (redacting auth headers and any token fields), correlation IDs, and metrics.

Compatibility and migration path

  • If greenfield: straightforward — no legacy surface to reconcile.
  • If migrating from a legacy Conekta SDK (the older static Conekta::setApiKey() style), expect this to be a rewrite, not an upgrade: static global config becomes instance config, method names and payload shapes differ, response objects become typed models. Budget per-call-site migration work and a parallel-run period.
  • PHP 8.1 floor must be validated against every service that will call the gateway, including queue workers and scheduled jobs — not just the web tier.
  • Pin exact versions. Add a Dependabot/Renovate rule that opens PRs for this package but requires manual approval and a changelog review; block auto-merge.

Sequencing

  1. Spike (bounded, ~1 week): sandbox credentials, one card charge end-to-end, custom Guzzle client with logging, confirm idempotency and error taxonomy. Exit criteria: written findings on the eight open questions above.
  2. Adapter + contract tests: build the gateway interface and a fake implementation first so feature work isn't blocked; add recorded-response contract tests against the sandbox.
  3. First production flow, narrowly scoped: single one-time card payment in one market with an internal allowlist. Include refunds and idempotent retry from day one — retrofitting idempotency after an incident is far more expensive.
  4. Webhooks: verification, replay protection, idempotent processing, dead-letter queue. Payment webhooks are the most common source of production incidents in this integration class.
  5. Broaden: additional payment methods (SPEI, OXXO, MSI), then recurring/subscription flows if required.
  6. Operational hardening: dashboards, alerting, runbooks, reconciliation job against Conekta's settlement reports.

Operational Impact

Maintenance

  • Two maintenance streams: (a) upstream generated-code churn, (b) your adapter layer. Keep the adapter small so (a) is cheap.
  • Because the package is generated, read the upstream changelog before every bump and diff the OpenAPI spec, not just the code. Model renames are the most likely breakage.
  • Establish an internal fork-and-tag policy up front. If upstream stalls, the fallback is regenerating from the public spec — feasible, but only if you've kept the adapter boundary clean.
  • Zero dependents means you are effectively the first serious adopter. Expect to file the first issues and to receive no community answers.

Support

  • Upstream support is vendor-dependent and unproven at this adoption level. Assume self-support and staff accordingly: a named owner for the payments integration, not a shared-responsibility void.
  • Establish a commercial relationship with Conekta if transaction volume justifies it — support quality on the API side matters more than on the SDK side.
  • Keep a documented fallback: the raw REST API is callable via Laravel's Http client if the SDK becomes a liability. The domain interface makes this a contained change.

Scaling

  • SDK-side scaling is non-issue: stateless HTTP client. Throughput is bounded by Conekta's rate limits and your connection pooling, not this package.
  • Configure Guzzle connection reuse and explicit timeouts. Default Guzzle has no timeout — an unresponsive upstream will hang PHP-FPM workers and exhaust the pool. This is the most likely scalability failure and it's a one-line fix if caught in design.
  • Long-lived queue workers make the configuration singleton a genuine concurrency hazard. Use scoped bindings and never mutate shared configuration inside a job.
  • Add circuit-breaking around the gateway so Conekta degradation doesn't cascade into checkout-wide outages.

Failure modes

  • Duplicate charge from retry without idempotency — highest severity, mitigate at the adapter layer.
  • Wrong merchant account charged from shared mutable Configuration — highest severity, mitigate with instance-scoped config.
  • Silent failure from unhandled ApiException or unparsed error bodies — mitigate with exhaustive mapping to domain errors and a default-deny branch.
  • Webhook replay or forgery — signature verification, event-ID deduplication, idempotent handlers.
  • Timeout without state reconciliation — always query order state before retrying or refunding; never infer outcome from a transport error.
  • Credential leakage in logs or exception traces — redaction middleware, and audit exception reporting config.
  • Reconciliation drift — scheduled job comparing internal ledger to Conekta settlement data; without it, small discrepancies compound invisibly.

Ramp-up

  • Engineering effort is modest for the SDK and substantial for the control envelope: adapter, error taxonomy, idempotency, webhooks, observability, reconciliation. Budget accordingly — the package is a weekend; the integration is a quarter-week to a few sprints depending on payment methods.
  • No learning curve on the library itself; the real ramp is on Conekta's domain — Mexican payment methods, SPEI/OXXO asynchronous settlement semantics, MSI installment rules, MXN minor-unit handling, and CFDI/ invoicing requirements if applicable.
  • Require a documented integration runbook and an on-call playbook before the first production transaction. Payments integrations without a runbook turn every incident into an improvisation.
  • Recommendation: proceed, conditioned on (1) pinning a tagged release instead of *@dev, (2) confirming idempotency support, (3) committing to the adapter boundary, and (4) accepting self-support risk. The low score and near-zero adoption are a governance concern, not a disqualifier, because the code is generated from a public spec and MIT-licensed — forkability caps the downside.
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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
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