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.
Architecture fit
GuzzleHttp\Client.App\Payments\Conekta\ConektaGateway bound to the container, with SDK Api\* classes injected, not resolved ad hoc in controllers or jobs.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.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.Integration feasibility
"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.composer.json constraints before the spike, not during it.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)
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.Configuration objects.Key questions
*@dev against a moving branch?Stack fit
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.Configuration factory (per environment, per merchant account) as a scoped/singleton service, bind API classes as factories, and bind the gateway to the interface.config/services.php reading from env/secret manager. Never in Configuration::getDefaultConfiguration() mutated at runtime.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
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.Sequencing
Maintenance
Support
Http client if the SDK becomes a liability. The domain interface makes this a contained change.Scaling
Failure modes
Configuration — highest severity, mitigate with instance-scoped config.ApiException or unparsed error bodies — mitigate with exhaustive mapping to domain errors and a default-deny branch.Ramp-up
*@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.How can I help you explore Laravel packages today?