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

Pagarme Sdk Laravel Package

quantumtecnology/pagarme-sdk

A lightweight Laravel/PHP SDK for the Pagar.me payment gateway, offering a simple integration layer for transactions, customers, cards, plans, subscriptions, and webhooks. Add Brazilian payment processing to your app quickly with a fluent API and Laravel service provider support.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin, community-built PHP SDK that wraps Pagar.me's REST API — the Brazilian payment gateway. Typical of this genre, it likely ships a Laravel service provider and facade (Pagarme::class) that registers config, credentials, and a Guzzle-based HTTP client. For a Laravel codebase already on Composer, this is a natural-shaped dependency: one line to install, a published config file for the public/secret keys, and facades or injected services for charges, customers, transactions, and possibly recipients/splits. It fits the "payment integration" slot cleanly, provided we accept it is a client library and not a business-logic layer. The SDK does not own reconciliation, ledgering, or idempotency semantics for us — those stay in our domain.

Integration feasibility. Feasibility is high in the narrow sense and low in the confidence sense. High: it is a standard Composer package with an MIT license, so procurement and legal are trivial; no native extensions, no daemons, no infra. Low: with 0 stars and 0 dependents there is essentially no community signal that the package matches the current Pagar.me API surface (v4 vs. v5 has been a meaningful breaking change in the ecosystem), no evidence of test coverage, and no visible CI. The decisive feasibility question is not "does it install" but "does it map to the API version our Pagar.me account is provisioned on."

Technical risk. Ranked by severity:

  1. Bus factor and abandonment. A single-author, zero-adoption repository can go stale without notice. Payment SDKs are particularly brittle to abandonment because the upstream API evolves and webhook/PCI expectations tighten.
  2. API drift. No published compatibility matrix means we discover breakage in production, not in CI. Pagar.me's v5 migration, PIX support, and split rules are the likely fault lines.
  3. Hidden coupling. Many community SDKs bake in assumptions — a specific Guzzle version, a hardcoded endpoint, a facade that is hard to mock. That complicates testing and makes swapping providers expensive.
  4. Security posture. API keys, webhook signature validation, and TLS/HTTP client configuration must be audited line by line before any card data or PII flows through it. There is no third-party audit to lean on.
  5. Licensing and provenance. MIT is clean, but with no releases or changelog, we cannot track what changed between pins.

Key questions for the spike.

  • Which Pagar.me API version does this target, and which version is our merchant account on?
  • Does it cover the payment methods we need — credit card, boleto, PIX, subscriptions, split/recipients — or only a subset?
  • Is webhook handling included, and how are signatures verified?
  • PHP and Laravel version constraints — does it support our runtime, or will it force a framework bump?
  • Is the HTTP client abstracted and mockable, or is it a hardwired Guzzle call?
  • Are there tests, and what do they mock — the wire or the SDK?
  • Who maintains it, and what is the commit cadence over the last 12 months?

Integration Approach

Stack fit. Works as a drop-in for a Laravel application on a supported PHP version. The integration seams are predictable: composer require, publish config, set PAGARME_SECRET_KEY in the environment, and inject the client where needed. The SDK should live behind an internal port — a PaymentGateway interface with methods our domain cares about (authorize, capture, refund, createSubscription, handleWebhook) — with the SDK as the concrete adapter. That adapter boundary is the single highest-leverage decision here; it caps the blast radius if we later swap to Pagar.me's official SDK, another community package, or direct REST.

Migration path. Two paths, depending on outcome of the spike:

  • Adopt wrapped. Install the SDK, wrap it in the internal port, keep all business types (money in minor units, status enums, idempotency keys) in our own namespace so nothing leaks the SDK's classes into controllers or domain services.
  • Fork and vendor. If the SDK is directionally correct but stale, fork it to an internal namespace, pin the version, add the missing endpoints and a test suite, and own it. Given zero dependents, this is a realistic and not unreasonable outcome.

Avoid the anti-pattern of calling the facade directly from controllers. Payment integrations that skip the port become the hardest thing in the codebase to change.

Compatibility. Verify three axes before committing: Pagar.me API version alignment, PHP/Laravel constraint compatibility with our lockfile, and Guzzle/PSR-7 version agreement with packages already in the graph. Run composer why-not against our current dependencies during the spike.

Sequencing.

  1. Spike (2–3 days). Sandbox account, one charge end-to-end, one webhook, one refund. Read the source. Produce a written gap list.
  2. Port design. Define the PaymentGateway interface against our domain, not the SDK's.
  3. Adapter build. Implement the port over the SDK; add contract tests that mock the HTTP layer, not the SDK.
  4. Webhook handling. Build independently of the SDK if signature verification is absent — that is a security-critical surface.
  5. Sandbox soak. Full flows including failure cases: declined card, timeout, duplicate submission, webhook replay.
  6. Production canary. Single-digit traffic behind a feature flag, with reconciliation job comparing our ledger to Pagar.me's.
  7. Full rollout with a documented rollback to direct REST.

Operational Impact

Maintenance. Treat this as a vendored dependency with a maintenance tax, not a utility. Budget for: monitoring the upstream repo for commits, a quarterly audit against Pagar.me's changelog, and a standing decision to fork if upstream goes quiet for two consecutive quarters. The MIT license makes the fork option legally trivial — the cost is engineering, not legal. Assign an explicit owner (one engineer, named) so this doesn't drift.

Support. No commercial SLA, no vendor relationship. Support is GitHub issues on a zero-star repo, which in practice means self-support. Escalation for SDK bugs is "we fix it," and that needs to be priced into the roadmap. Pagar.me's own support will not cover third-party SDKs.

Scaling. Most of the scaling surface belongs to Pagar.me's API, not the SDK: rate limits, idempotency keys, and connection pooling. The SDK's contribution is whether the HTTP client is configurable enough to set timeouts, retries with backoff, and a shared connection pool. Audit for a hardcoded timeout — community SDKs frequently ship with none or with a 60-second default that stalls request workers under load. Also confirm the SDK does not hold state across requests that would break under Octane or horizontal scaling.

Failure modes to plan for.

  • Silent upstream drift. Pagar.me changes a response shape; the SDK returns nulls; charges appear successful but aren't. Mitigation: schema assertions on critical responses, plus daily reconciliation.
  • Timeout without idempotency. Retry storms creating duplicate charges. Mitigation: idempotency keys generated by us, not the SDK.
  • Webhook signature bypass. If the SDK's verification is weak or absent, forged webhooks mark orders paid. Mitigation: verify independently, in our code.
  • Credential leakage through debug logs or exception traces carrying API keys. Mitigation: scrubber in the logging pipeline; never log the raw request.
  • Abandonment mid-incident. Upstream goes dark while we have an open bug. Mitigation: fork-on-shelf policy pre-approved, with an internal mirror.

Ramp-up. Low-to-moderate. Any Laravel engineer can call the facade in an afternoon. The real ramp is domain knowledge: Pagar.me's model (transactions vs. charges, capture semantics, split rules, PIX lifecycle, settlement timing) and the SDK's abstraction leaks — the places where it doesn't cleanly expose what the API offers. Plan for one engineer to own the payment domain and write the runbook, with a second engineer able to operate the canary and rollback. Two to three weeks of one person's time gets a competent integration; the operational maturity (reconciliation, alerting on failure rates, dispute handling) is a longer, ongoing commitment.

TPM recommendation. Do not adopt on the strength of the package alone — zero adoption means zero validation. Run the spike, wrap it in a port, and treat the fork as a live option from day one. If the spike shows API-version alignment and reasonable code quality, adopt with the wrapper; if not, consume Pagar.me's REST API directly or use their official SDK and skip this dependency entirely.

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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin