---
title: "Purchases for Laravel — docs | Roundly"
description: "Developer docs for Purchases for Laravel: verify and record App Store, Google Play and Stripe purchases, subscriptions, refunds and webhooks."
url: https://roundly-consulting.com/open-source/docs/purchases-for-laravel
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

Open source

# Purchases for Laravel

Install

`composer require roundly-consulting/purchases-for-laravel`

Requires: PHP ^8.4 · Laravel ^12.0|^13.0

[GitHub](https://github.com/roundly-consulting/purchases-for-laravel) [Packagist](https://packagist.org/packages/roundly-consulting/purchases-for-laravel) [Donate (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Patreon](https://www.patreon.com/cw/roundly)

## Overview

A unified in-app purchase and payments toolkit for Laravel: one API for Apple App Store, Google Play and Stripe purchases and subscriptions. It verifies every store’s signed payload natively, decodes it into one provider-agnostic result, records it as Eloquent models and fires lifecycle events you can listen to — including refunds, chargebacks and grace periods. MIT-licensed and built only on Laravel’s HTTP client and Roundly’s own crypto, enums, money and package-toolkit packages — no stripe/stripe-php, no google/apiclient, no third-party SDKs.

### What you get

#### One API, three stores

Apple App Store, Google Play and Stripe behind a single Purchases facade — verify, decode and record in one call.

#### Native verification

ES256 JWS with pinned Apple certificates, Google’s OAuth2 JWT-bearer grant and Stripe HMAC webhooks — no SDKs.

#### Unified result contract

Every payload maps to one ProviderResult: type, status, price, dates, line items and the raw payload.

#### Models, scopes & events

Purchases, subscriptions and refunds as Eloquent models, with lifecycle events for grace periods and chargebacks.

#### Exact money

Prices as arbitrary-precision Money in minor units, converted with each store’s own rules.

#### Audit, queue & replay

Log every verified payload, persist on a queue, and replay stored notifications with one command.

#### Facade, DI or actions

One Purchases facade over an injectable PurchasesManager and public actions, plus a recording fake that still runs the real pipeline.

### Documentation

#### [Installation](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/installation.md)

Install via Composer, publish the publish-only migrations, and optionally publish the config and the webhook routes file.

#### [Configuration](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/configuration.md)

Every config key and env variable — models, providers, audit, queue, webhook routes and Apple, Google and Stripe credentials.

#### [The Purchases facade](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/purchases-facade.md)

Every Purchases facade method — result() and handle() for requests, sync() and replay() for held results, for($owner) and provider lookups.

#### [DI and actions](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/without-facade.md)

Inject PurchasesManager instead of calling the facade, or run the action behind handle(), sync() or replay() — the same code either way.

#### [Unified result contract](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/provider-results.md)

Every provider maps to one ProviderResult — type, status, ids, price, dates, line items and the raw store payload.

#### [Recording pipeline](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/recording.md)

How handle(), sync() and replay() turn a result into a Purchase, Subscription or PurchaseRefund — audited, idempotent, events only on change.

#### [Events](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/events.md)

Ten lifecycle events — purchases, subscriptions, grace periods, refunds and chargebacks — each carrying the model and the result.

#### [Models & the owner trait](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/models.md)

Six swappable Eloquent models, the HasPurchases owner trait, subscription scopes and helpers, and the database schema.

#### [Money & prices](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/money.md)

Prices as arbitrary-precision money-for-laravel Money, cast over two columns and converted exactly from each store’s format.

#### [Refunds & chargebacks](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/refunds.md)

Apple, Google and Stripe refunds and disputes decode into PurchaseRefund records linked to the purchase they reverse.

#### [Apple App Store](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/apple-app-store.md)

Verify signed App Store server notifications, look up transactions via the App Store Server API, and map Apple’s states.

#### [Google Play](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/google-play.md)

Verify one-time products and subscriptionsv2 purchases, auto-acknowledge them, and decode real-time developer notifications.

#### [Stripe](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/stripe.md)

Verify Stripe webhook signatures natively, map payment, subscription, invoice and dispute events, and read REST objects.

#### [Client callbacks](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/client-callbacks.md)

Verify what a client sends up — an Apple receipt, a Google token, a Stripe session id — and tell bad input from a store or credentials failure.

#### [Signature verification & trust](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/verification.md)

How each store’s signature is verified — crypto-for-laravel primitives, pinned Apple certificates and a validated clock-skew leeway.

#### [Webhook routes](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/webhooks.md)

An opt-in POST /purchases/webhooks/{provider} endpoint that verifies, records, fires events and answers 204.

#### [Queue, audit log & replay](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/queue-and-audit.md)

Persist verified notifications on a queue, keep a replayable audit log of every payload, and re-run it with purchases:replay.

#### [Custom providers](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/custom-providers.md)

Add a payment provider of your own by implementing the Provider contract and returning a GenericResult.

#### [Enums & exceptions](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/enums-exceptions.md)

The Status and ResultType enums with select-option and validation helpers, and the package’s exception types.

#### [Artisan commands](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/commands.md)

Install and configure providers, list their readiness, verify credentials against the live stores, and replay notifications.

#### [Testing](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/testing.md)

Test purchase flows without real payments or network calls — Purchases::fake() records handle(), sync() and replay(); FakeResult and PayloadFactory.

#### [Requirements](https://roundly-consulting.com/open-source/docs/purchases-for-laravel/requirements.md)

PHP 8.4+ with ext-bcmath, Laravel 12 or 13, and Roundly’s crypto, enums, money and package-toolkit packages — no third-party SDKs.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source.md)
