ptuchik/braintree
Laravel integration for the Braintree payment gateway, wrapping the official Braintree PHP SDK with a service provider, facade, and publishable configuration for accepting payments and managing customers in your PHP application.
What the package is: A Composer-installable gateway driver that adapts Braintree to the Omnipay payment abstraction (league/omnipay request/response objects). Despite the framing, it is not a Laravel package — it is a framework-agnostic PHP library that a Laravel app can consume. It is a personal-namespace fork of the League's omnipay/braintree driver, published under ptuchik/.
Architecture fit: Good in principle, narrow in practice. If the platform already standardizes on Omnipay to abstract multiple gateways, a Braintree driver slots in cleanly: Gateway → purchase / authorize / capture / refund / createCard / deleteCard, uniform response objects, swappable backends. The friction is that Omnipay's uniform interface deliberately hides gateway-specific surface area. Braintree's value — vaulting and payment-method tokens, 3DS2/SCA challenge flows, PayPal/Venmo/Apple Pay channels, webhook-driven subscription lifecycle, partial refunds and voids — either sits outside Omnipay's model or leaks through as driver-specific parameters. Expect to drop to the native braintree/braintree_php SDK for anything beyond simple sale/refund.
Integration feasibility: Composer install is trivial. The effort is not wiring, it is verification. Zero stars and zero dependents means there is no installation evidence base: no public projects, no issue history to mine for edge cases, no downstream users who have already hit the failure modes. We would be the first production consumer, which means we own defect discovery on a payment path.
Technical risk, ranked:
omnipay/braintree. The delta could be a benign PHP 8 compatibility shim, or it could be behavioral. This must be diffed before any decision.Key questions for diligence:
braintree/braintree_php version does it pin, and are those versions still receiving fixes?Stack fit. Laravel + Composer + Omnipay works mechanically, but the fit is weaker than the label suggests. Ranked options:
| Option | Verdict |
|---|---|
braintree/braintree_php (official SDK) behind an internal adapter |
Recommended — most control, vendor-supported, best docs |
omnipay/braintree (League-maintained) |
Viable if the Omnipay abstraction is a genuine multi-gateway requirement |
| This fork | Only if it demonstrably closes a gap upstream does not — currently unproven |
| Laravel Cashier | Not a current path for Braintree; do not plan around it |
Migration path. Do not rip and replace. Introduce an internal PaymentGateway interface in the domain layer and bind whichever implementation we choose behind a feature flag. The driver — fork, official, or SDK — becomes a configuration detail, making any future swap a one-class change rather than a service rewrite. That hedge costs a day and buys back all the optionality this dependency's risk profile demands.
Compatibility checks. Confirm the PHP range against our runtime (8.2/8.3), the Laravel version, the Omnipay major, and the braintree/braintree_php constraint via composer why-not. Watch for replace/conflict collisions: installing both this fork and the official driver will fight over the same gateway class namespace.
Sequencing:
If step 1 returns "no active maintenance," stop there and go straight to the official SDK. That is the likely outcome.
Maintenance. Effectively ours. Budget for ongoing ownership: dependency bumps, Braintree API version pinning, SCA rule changes, PHP upgrades — plus the overhead of tracking an external repository we cannot influence. Against upstream, where the League absorbs all of that.
Support. No vendor, no SLA, no community at zero stars. Internal on-call must be able to read Omnipay and Braintree SDK source under pressure. The only escalation path is Braintree merchant support, which will not debug a third-party wrapper.
Scaling. Throughput is not the constraint — the driver is a thin HTTP wrapper, and load scales with Braintree's API rate limits and connection behavior. The real scaling concerns are architectural: idempotency-key propagation on timeout and retry (get this wrong and you double-charge), and webhook ingestion ordering for subscription state. Both require explicit design regardless of which driver we pick.
Failure modes and mitigations:
composer update → production payment outage. Mitigate: contract tests against the Braintree sandbox on every dependency change.Ramp-up. Low to call purchase(); high to operate safely. Realistic estimate: 1–2 days for a working integration, 2–3 weeks to production confidence including SCA, webhooks, refunds, and reconciliation. Add 1–2 weeks if we end up vendor-patching the fork ourselves. The team needs working knowledge of Omnipay request/response objects, Braintree vaulting, and the payment lifecycle — budget a half-day knowledge share and a written runbook.
Recommendation. Do not adopt this as a platform dependency. Zero stars, zero dependents, zero score is a diligence signal, not a rounding error — nobody has validated this code in production. Take the official Braintree SDK behind an internal adapter, keep the Omnipay abstraction only if a second gateway is genuinely on the roadmap, and revisit the fork solely if a specific, verified gap forces it — at which point it should be vendored in-house with explicit ownership rather than consumed from a personal repo.
How can I help you explore Laravel packages today?