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

Appstore Iap Laravel Package

imdhemy/appstore-iap

Verify Apple App Store receipts and handle in-app purchases with imdhemy/appstore-iap. It validates receipts, parses App Store server notifications, and integrates with Laravel, letting you confirm purchases and subscriptions server-side without writing Apple's verification logic yourself.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • imdhemy/appstore-iap is a Composer-installable, framework-agnostic PHP library that models Apple In-App Purchase domain objects (receipts, transactions, server notifications) and abstracts calls to Apple's verification endpoints. That is a clean fit for a Laravel codebase: it can be consumed inside a service class or job without dictating application structure.
  • The natural seam is an anti-corruption layer. We should not let the package's DTOs leak into controllers, entitlement models, or billing domain logic. Wrap it behind a ReceiptValidator / NotificationHandler interface so the vendor is swappable.
  • Laravel already provides everything the package needs to be operated well — HTTP client (Guzzle), queue workers, scheduler, config/env, logging, and database transactions for idempotency. The package is the protocol adapter; Laravel supplies the reliability envelope.

Integration feasibility

  • Low-to-moderate. composer require plus a thin service provider binding the client into the container is a day or two of work. Verify whether a first-party Laravel service provider/config publish exists; if not, we write ~50 lines of glue.
  • The real effort is not the package — it is Apple's purchase lifecycle: originalTransactionId as the stable subscription identity, renewals, grace periods, billing retry, refunds/revocations, family sharing, and sandbox-vs-production environment handling (Apple returns status 21007 when a sandbox receipt hits the production endpoint).
  • Config surface to own: bundle ID, App Store Connect shared secret and/or App Store Server API credentials (issuer ID, key ID, .p8 private key), sandbox toggle, and HTTP timeouts/retries. Secrets belong in the secret manager, never in .env committed or logs.

Technical risk

  • Vendor viability: 56 stars, single-maintainer pattern, MIT with no warranty or support SLA. Bus factor of roughly one. Treat it as a dependency of convenience, not a strategic platform.
  • API currency (highest risk): Apple has been steering integrators from the legacy verifyReceipt endpoint to the App Store Server API and Server Notifications V2 (JWS-signed payloads requiring certificate-chain verification). Confirm exactly which surfaces this version covers — legacy receipt validation only, or also Server API and V2 notifications. If it lags Apple, we either contribute upstream or maintain a fork, which changes the cost model materially.
  • Security surface: receipt validation is on the trust boundary for revenue. Signed-payload verification, constant-time comparisons, and replay protection must be correct. We should review the crypto/signature path ourselves rather than assume.
  • Data quality signal: the recorded "last release" date is in the future, which suggests metadata noise in the source catalog. Do not use it as evidence of active maintenance; check the actual tag history, open issues, and commit cadence.

Key questions

  1. Does this version support App Store Server API and Server Notifications V2, or only legacy verifyReceipt?
  2. Are JWS signature verification and Apple root certificate handling implemented, and are certificates updatable without a package release?
  3. What is the maintainer's responsiveness on security issues, and is there a fork/contribution path we are willing to fund?
  4. Does it handle 21007/21008 environment fallback, or must our adapter orchestrate it?
  5. Test coverage and fixtures: are there sandbox-tested receipt and notification samples we can build contract tests against?

Integration Approach

Stack fit

  • Laravel (PHP 8.x) + Composer + Guzzle aligns natively. If the host application is on an older PHP minor than the package requires, that constraint may force an upgrade earlier than planned — check composer.json platform requirements first.
  • Deploy as a normal Composer dependency. No sidecar, no new runtime, no infrastructure change. That is the main argument for it over building a billing microservice.

Migration path

  • If we already validate receipts inline (or not at all), introduce the package behind our own interface and migrate call sites to the interface. Existing bespoke code becomes one implementation; the package becomes another. This makes the eventual swap-out cheap.
  • Prefer the notification-driven model (Apple pushes lifecycle events; we reconcile) over client-supplied receipt validation as the primary source of truth. Client-side validation stays as a fast-path UX check only.

Compatibility

  • Confirm support for our PHP version, guzzlehttp/guzzle major, and illuminate/support version range. Guzzle major conflicts are the most common blocker in mature Laravel apps.
  • Confirm behavior differences between sandbox and production receipts and whether the library exposes the environment field for routing decisions.

Sequencing

  1. Spike (1 week): throwaway Laravel command that validates a sandbox receipt and accepts a sample V2 notification. Validates API currency and crypto correctness.
  2. Adapter (1–2 weeks): interface, service provider, config, secret management, DTO mapping to internal Entitlement/Subscription models.
  3. Notification pipeline: webhook route → signature verification → persist raw payload → dispatch queued job → idempotent state transition. Never process synchronously in the request.
  4. Sandbox + TestFlight validation: renewals, cancellations, refunds, grace period, billing retry.
  5. Production canary with dual-write reconciliation for one billing cycle before making it authoritative.

Operational Impact

Maintenance

  • Low day-to-day, but non-zero governance: pin the version, review changelogs against Apple's announcements quarterly, and track Apple's deprecation calendar. Budget a small recurring allowance for patching or upstream contribution rather than assuming passive safety.
  • Own the fork decision up front. If we cannot tolerate the maintainer going quiet, budget ~5 engineer-days/year to keep a vendored fork current.

Support

  • No commercial support. Internal ownership must be explicit — likely the payments/subscriptions squad. Document the Apple-side prerequisites (App Store Connect keys, shared secret rotation) in the runbook, because losing access to those credentials is a silent outage.

Scaling

  • The library is stateless and cheap; scaling is an HTTP-and-queue concern, not a package concern. Apple's verification endpoints are rate-limited and occasionally slow — apply timeouts (2–5s), bounded retries with exponential backoff, and circuit breaking. Notification ingress should be a thin, fast endpoint that enqueues; workers do the state work.

Failure modes

  • Apple 5xx / timeout: retry with backoff; never grant entitlement on an unverified receipt.
  • Status 21007/21008: environment mismatch — route to the correct endpoint, do not treat as invalid.
  • Duplicate or out-of-order notifications: dedupe on notification/transaction identifiers; use Apple's signed timestamp, not arrival order, to resolve state.
  • Expired shared secret or revoked API key: surfaces as auth errors; alert on error-rate spikes, not just exceptions.
  • Signature verification failure: fail closed, log the payload hash (never the full signed blob with PII), alert.
  • Refunds/revocations and billing retry: these silently erode revenue if unhandled — these are the failure modes most likely to cost money rather than uptime.

Ramp-up

  • A mid-level Laravel engineer can be productive with the package in 2–3 days. The learning curve is Apple's domain model, not the PHP: renewal states, originalTransactionId vs transactionId, environment semantics, and notification types. Pair the integration with a written entitlement state machine so behavior is reviewable without reading library internals.
  • Overall: reasonable, low-blast-radius dependency for a high-value capability. Adopt behind an abstraction, validate API currency in the spike, and treat ongoing Apple-API tracking as a named operational cost rather than an afterthought.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource