transbank/transbank-sdk
Official PHP SDK for integrating Transbank payment services, including Webpay Plus, Oneclick Mall, Patpass, and full transaction flows. Provides REST/SOAP clients, configuration helpers, and ready-to-use classes for Laravel and PHP apps, simplifying payment initiation, confirmation, refunds, and sta...
Architecture fit. transbank/transbank-sdk is a thin, stateless HTTP client library that wraps Transbank's REST payment APIs (Webpay Plus, Webpay Oneclick/Mall, Transacción Completa, Patpass Comercio). It has no service provider, no facade, and no framework coupling, so it slots into a Laravel app as a low-level transport rather than an opinionated package. That is a feature for us: it does not fight the container, and it avoids the anti-pattern of a vendor SDK owning application flow. It is a poor fit only if we expect the package to give us checkout UI, persistence, reconciliation, or webhook handling — it gives us none of that, and we would be building that layer ourselves regardless of package choice.
Release 5.1.0 is additive and confirms that shape: it adds a single class, MallBinInfo, exposing queryBin to retrieve card information for a card already registered under Oneclick Mall. No existing methods change, no configuration surface changes, no new dependency. It stays a transport primitive — the method returns card metadata that we must decide what to do with, which is exactly the boundary we wanted.
Integration feasibility. High. Composer-installable, BSD-3-Clause (permissive, no copyleft exposure, compatible with commercial redistribution), actively released (5.1.0 is a minor bump on the current major line, following the June 2025 release), and requires only Guzzle plus standard PHP JSON/cURL extensions. The main integration work is wrapping its static/global configuration (Options, commerce code, API key, environment) into container-bound singletons so sandbox and production credentials are not process-global. This is a familiar half-day pattern, not a design problem, but it must be done deliberately — static configuration is the single most common source of "wrong-environment charge" incidents in this ecosystem.
5.1.0 does not change this. Adopting it is a constraint bump within the existing major (^5.0 → ^5.1 if we want MallBinInfo), not a re-integration. It is strictly opt-in: if we do not use Oneclick Mall, the new class is dead weight we can ignore without pinning below it.
Technical risk. Low-to-moderate, and concentrated in the domain rather than the code:
MallBinInfo::queryBin returns information about a card already enrolled in Oneclick. That is not PAN data, but it is cardholder-adjacent metadata, and it only works against stored Oneclick credentials. Risk is low provided we treat the response as transient display/routing data, do not persist it beyond what a stated purpose requires, and do not let it leak into logs or analytics. If we cache it, the cache inherits a data-retention obligation.queryBin is a read-only lookup and does not interact with that state machine at all, which limits its blast radius.Key questions.
MallBinInfo is Oneclick Mall-only.Stack fit. Clean fit for Laravel 10/11/12 on PHP 8.1+. Bind Options and a TransbankClient service as container singletons driven by config/services.php and .env (TRANSBANK_ENV, TRANSBANK_COMMERCE_CODE, TRANSBANK_API_KEY). Wrap each product (WebpayPlus, Oneclick, TransaccionCompleta) in an application-level gateway class that returns our own DTOs — never let Transbank\...\Response objects leak into controllers, jobs, or views. Keep the SDK strictly at the infrastructure boundary. If we adopt 5.1.0, MallBinInfo belongs behind the same Oneclick gateway as a lookupBin(string $username, string $token)-style method returning our own DTO, not called directly from a controller.
Version decision. Treat 5.1.0 as an in-place minor upgrade with no migration step. If the BIN capability is not in scope for this release, there is no urgency to bump — but there is also no reason to hold back, since nothing existing changes. If it is in scope, bump the constraint to ^5.1 and add it to the Oneclick workstream rather than as a standalone task.
Migration path. Two realistic starting points. If greenfield, go straight to the current SDK major and the REST endpoints; do not adopt any SOAP-era wrapper. If we are replacing the legacy kcc/transbank-sdk or a hand-rolled SOAP integration, the migration is not a drop-in: endpoint, credential, and response-shape changes mean we should stand up the new gateway in parallel behind a feature flag, route a small percentage of traffic, and dual-write transaction records so we can diff outcomes before cutover. Budget for a shadow-mode period covering at least one full settlement cycle.
Compatibility. PHP 8.x and Guzzle 7 are the practical constraints; verify against our pinned Guzzle version, because Laravel's HTTP client and the SDK's own Guzzle usage can coexist but we should not mix them for the same call. Confirm the SDK major supports every product we need — product coverage has lagged across versions, and 5.1.0's addition is evidence that the Oneclick Mall surface is still being filled in, so check the changelog rather than assuming a full API surface. Check that our queue worker, webhook receiver, and HTTP timeout settings align with Transbank's response-time characteristics.
Sequencing.
queryBin wrapper path behind the Oneclick gateway, with an explicit decision on caching, retention, and logging redaction before any code is written.Maintenance. Low code churn, but the package is a dependency on an external regulated counterparty, so maintenance is really vendor-relationship maintenance: tracking Transbank's API changes, certificate and credential rotation, and major-version upgrades. Assign explicit ownership. Pin the version, run an automated dependency update check, and treat any major bump as a scheduled project rather than a routine merge. Minors like 5.1.0 can flow through normal review — the diff is a new class with no behavioural change to existing paths — but the reviewer should still confirm the "no changes to existing methods" claim against the diff rather than the release note.
Support. First-line support is ours; Transbank provides merchant support for transaction disputes and certification. Establish early who we call for a stuck settlement versus a failed API call, and add a separate line for "BIN lookup returns an error or unexpected metadata" if we ship that feature, since it is a distinct endpoint with its own enablement state. Document the escalation path and keep the merchant commerce code and integration engineer contact in the runbook.
Scaling. The SDK is stateless and network-bound; scaling is about outbound HTTP behaviour, not the library. Set conservative connect/read timeouts, use connection reuse, and cap concurrency to whatever our Transbank agreement tolerates. Payment calls should not sit in the request/response cycle where avoidable — initiate, persist, and let the return URL or a queued job finalize state. Add circuit breaking so a Transbank outage degrades to a clear "payment unavailable" path instead of exhausting PHP-FPM workers. queryBin is a read-only, low-volume lookup; it should not be on the checkout critical path, and it must not be allowed to fail a payment flow if it times out.
Failure modes. The dangerous cases are ambiguous, not clean: a timeout after Transbank processed a commit, a duplicated commit from a user retry, a return-URL that never arrives because the user closed the tab, and refunds issued against a transaction we recorded as failed. Mitigations are architectural — idempotency keys on initiation, never blindly retrying a commit, treating the return URL as an optimization rather than the source of truth, and reconciling against settlement reports daily. Also plan for sandbox/production credential crossover, which is the highest-frequency self-inflicted incident in this integration class. The 5.1.0 surface adds no new financial failure mode, but it does add a data-handling one: logging a raw BIN response is easy, silent, and hard to unwind.
Ramp-up. Engineering ramp-up is roughly one to two days for a developer familiar with Laravel HTTP clients; the SDK's API surface is small, and 5.1.0 adds one class. The real ramp-up is payments literacy — the transaction lifecycle, capture versus commit, reversals, and reconciliation — which is a one-to-two-week curve for the team and should be paired with a written runbook. Allocate a senior reviewer with payments experience for the commit/refund paths specifically, since that is where correctness failures translate directly into financial loss and chargeback exposure. The BIN lookup is a low-complexity add-on and does not extend that curve.
How can I help you explore Laravel packages today?