genealabs/laravel-cashier-braintree
Laravel Cashier Braintree brings Braintree payment handling to Laravel's Cashier API, offering subscriptions, one-off charges, and customer management through a familiar fluent interface.
Architecture fit. The package occupies a well-defined slot: it implements Laravel Cashier's billing contract — the Billable trait, subscriptions/subscription_items schema, a webhook controller, and fluent newSubscription() / swap() / charge() / refund() builders — on top of the Braintree PHP SDK. That is the right architectural shape for a single-database Laravel monolith that has already committed to Braintree. For a TPM, the value is mostly in the shape, not the artifact: it converts "design a subscription state machine" into "configure a documented integration," which is where most schedule risk in a first paid tier actually lives. It is explicitly not a payment abstraction layer — it does not decouple you from Braintree — and it does not cover tax-compliant invoicing, revenue recognition, metered/usage-based rating, dunning tooling, or a billing operations console. Write the epic against that boundary.
A TPM's most defensible use of this repo is as a reference implementation. The 4.0.0 README carries the full Cashier documentation, so the team can spec trials, proration, swaps, cancel-at-period-end, cancelNow, resume, charge, and refund against a concrete, readable contract before writing a line of production code. That is a scope-and-estimate artifact with real value even if the dependency is ultimately rejected.
Integration feasibility — mechanically high, strategically low. Install is ordinary Composer work: require the package, publish config and migrations, add fields (braintree_id, paypal_email, card_brand, card_last_four, trial_ends_at), attach the trait to the billable model, set BRAINTREE_ENVIRONMENT/MERCHANT_ID/PUBLIC_KEY/PRIVATE_KEY, and exclude braintree/* from CSRF. Nothing novel. The real feasibility question is not "can we install it" but "should we depend on it," and on that question the evidence is poor.
Technical risk: high, dominated by project health rather than code quality. 5 stars, 0 dependents, last release 2019-10-09, repository archived read-only. Concretely:
Key questions to force answers before commitment:
composer.json, not inferred from the README?braintree/braintree_php, or is the 4.x pin itself a blocker?Stack fit. Viable only where (a) Braintree is already the gateway, (b) the Laravel/PHP combination is contemporaneous with a 2019 release, and (c) pricing is standard subscription with no metering, tax-inclusive invoicing, or multi-entity revenue reporting. On a modern Laravel app, expect dependency-resolution conflicts before any runtime bug — and treat that resolver failure as the cheapest possible go/no-go signal. Run it in a throwaway branch in week one.
Migration path. Do not add a floating ^4.0 requirement. The only defensible path is a vendored fork pinned to a commit SHA, owned in an internal namespace, with adoption gated on a compatibility spike. Sequence with explicit gates so the decision is reversible at each one:
composer.json, run the package suite, capture failures. Cheap, time-boxed, and decisive.cancelNow, resume, charge, refund, and a signed webhook. This produces the real estimate.Compatibility. There is no published support matrix. Treat the README as a frozen 2019 snapshot of upstream Cashier docs rather than a statement of what this package supports. Compatibility must be established empirically and re-verified on every Laravel, PHP, or Braintree SDK bump — that recurring verification is part of the estimate, not a one-time spike.
Sequencing note for the roadmap. Billing becomes load-bearing the moment the first real charge lands, and after that the exit options get expensive. Fix the exit plan before launch, not after.
Maintenance. Adoption books a recurring cost line that no upstream will fund: dependency patching, framework and PHP compatibility, security response, and SDK bumps. Assign a named owner with allocated capacity and a documented upgrade calendar; without that, "fork and own" degrades into "fork and neglect." A fork with a bus factor of one is a schedule risk on every future framework upgrade. Budget the 24-month number explicitly and put it in the business case next to the time-to-market savings, or the comparison is dishonest.
Support. There is no SLA, no maintainer, and no support contact. Recurring billing is high blast radius — a dropped webhook means wrong entitlements or wrong charges — so a dedicated on-call path, webhook replay tooling, and reconciliation reports must be budgeted alongside the feature, not retrofitted after the first incident. Write the runbook for failed payments, dunning, disputed charges, and webhook replay before launch, and rehearse it once. Include a tested rollback path and a documented procedure for reconciling our subscription state against Braintree's as the source of truth.
Scaling. At moderate subscription volume the package itself is unlikely to be the bottleneck; queue workers and webhook throughput are ordinary Laravel capacity planning. The real scaling constraint is organizational: a single fork owner cannot absorb an urgent security patch during a Laravel major upgrade. Plan for at least two engineers able to touch the fork.
Failure modes to track in the risk register.
Each needs an owner, a detection mechanism, and a mitigation — not just a line in a document.
Ramp-up. The copied documentation is genuinely useful for onboarding engineers to the Cashier contract and for writing the first-party spec; it is misleading if read as a statement of current support. Plan for a sandbox spike plus pairing so the team learns where correctness actually lives — signature verification, idempotency, retries, reconciliation — rather than learning the happy path and discovering the failure path in production. The Drop-in UI keeps card data out of our systems, a durable PCI-surface reduction that holds regardless of how the package-health question resolves, and it is worth stating plainly in the compliance narrative.
How can I help you explore Laravel packages today?