PHPackages                             laulamanapps/google-wallet-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. laulamanapps/google-wallet-laravel

ActiveLibrary[API Development](/categories/api)

laulamanapps/google-wallet-laravel
==================================

Google Wallet integration for your Laravel application

v1.0.0(1mo ago)032MITPHPPHP ^8.1CI passing

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/LauLamanApps/google-wallet-laravel)[ Packagist](https://packagist.org/packages/laulamanapps/google-wallet-laravel)[ RSS](/packages/laulamanapps-google-wallet-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Google Wallet Laravel
=====================

[](#google-wallet-laravel)

This package provides Laravel integration for the [LauLamanApps Google Wallet Package](https://github.com/LauLamanApps/google-wallet): generate "Add to Google Wallet" save links (RS256-signed JWTs) from your Laravel application.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 11.x, 12.x or 13.x

Installation
------------

[](#installation)

```
composer require laulamanapps/google-wallet-laravel
```

The service provider (`LauLamanApps\GoogleWalletLaravel\GoogleWalletServiceProvider`) is registered automatically via Laravel package auto-discovery.

Run Tests
---------

[](#run-tests)

```
composer install
./bin/phpunit
```

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=google-wallet-config
```

This creates `config/google-wallet.php`:

KeyDefaultDescription`service_account``env('GOOGLE_WALLET_SERVICE_ACCOUNT')`Path to the Google Cloud service account JSON key file used to sign the JWTs`origins``[]`Origins allowed to render the save urls; leave empty to allow opening from anywhere`callback.enabled``env('GOOGLE_WALLET_CALLBACK_ENABLED', false)`Expose the save/delete callback endpoint (see below)`callback.issuer_id``env('GOOGLE_WALLET_ISSUER_ID')`Your issuer id; required when callbacks are enabled (signatures are verified against it)`callback.environment``'production'``'production'` or `'test'`: which Google root signing keys to verify against`callback.route_prefix``'/google-wallet'`Prefix for the callback routeAdd the ENV variable to your `.env` file:

```
###> laulamanapps/google-wallet-laravel ###
GOOGLE_WALLET_SERVICE_ACCOUNT=storage/keys/google-wallet.json
###< laulamanapps/google-wallet-laravel ###
```

Get a service account
---------------------

[](#get-a-service-account)

1. Sign up for a Google Wallet issuer account in the [Google Pay &amp; Wallet Console](https://pay.google.com/business/console) and note your issuer id.
2. Create a Google Cloud service account with the Wallet Object Issuer role and download its JSON key file.
3. Link the service account to your issuer account in the console.

Creating a save link
--------------------

[](#creating-a-save-link)

The package registers `LauLamanApps\GoogleWallet\SaveUrlFactory` as a singleton, configured with your service account and origins. Inject it anywhere:

```
namespace App\Http\Controllers;

use LauLamanApps\GoogleWallet\Object\Barcode;
use LauLamanApps\GoogleWallet\Object\BarcodeType;
use LauLamanApps\GoogleWallet\Object\GenericClass;
use LauLamanApps\GoogleWallet\Object\GenericObject;
use LauLamanApps\GoogleWallet\PassPayload;
use LauLamanApps\GoogleWallet\SaveUrlFactory;

final class WalletPassController
{
    public function __construct(
        private readonly SaveUrlFactory $saveUrlFactory,
    ) {
    }

    public function save()
    {
        // Ids are '.'
        $object = new GenericObject('3388000000012345678.member-0001', '3388000000012345678.membership');
        $object->setCardTitle('ACME Membership');
        $object->setHeader('John Doe');
        $object->setBarcode(new Barcode(BarcodeType::QrCode, 'member-0001'));

        $payload = new PassPayload();
        $payload->addGenericClass(new GenericClass('3388000000012345678.membership'));
        $payload->addGenericObject($object);

        return redirect()->away($this->saveUrlFactory->create($payload));
    }
}
```

Render the url as an [Add to Google Wallet button](https://developers.google.com/wallet/generic/resources/brand-guidelines) and you are done.

See the [core package documentation](https://github.com/LauLamanApps/google-wallet) for all pass types (generic, event ticket, offer, loyalty, transit), fields, images and colors. The service provider also registers `LauLamanApps\GoogleWallet\ServiceAccount` and `LauLamanApps\GoogleWallet\JwtSigner` as singletons in case you want to sign a JWT yourself.

Save/delete callbacks
---------------------

[](#savedelete-callbacks)

Google can notify your application whenever a user saves or deletes a pass. Enable the callback endpoint in your `.env` file:

```
###> laulamanapps/google-wallet-laravel ###
GOOGLE_WALLET_CALLBACK_ENABLED=true
GOOGLE_WALLET_ISSUER_ID=3388000000012345678
###< laulamanapps/google-wallet-laravel ###
```

When enabled, the package exposes `POST /google-wallet/callback` (route name `google-wallet.callback`; change the prefix with the `callback.route_prefix` config key). Point Google at it by setting the callback url on your pass classes — it is available on all five class types and must be `https://`:

```
$class = new GenericClass('3388000000012345678.membership');
$class->setCallbackUrl('https://example.com/google-wallet/callback');
// or: $class->setCallbackUrl(route('google-wallet.callback'));
```

Every incoming callback is verified before anything is dispatched: the endpoint is public and anyone can POST to it, so the controller runs the raw request body through the core package's `CallbackVerifier` (Google's `ECv2SigningOnly` signature scheme, checked against your issuer id and Google's root signing keys). Requests that do not verify are logged at warning level and rejected with a `400` — no event is dispatched for them. Set the `callback.environment` config key to `'test'` to verify against Google's test root signing keys during integration testing.

Verified callbacks dispatch a Laravel event: `LauLamanApps\GoogleWalletLaravel\Events\PassSavedEvent` when a user saves a pass and `LauLamanApps\GoogleWalletLaravel\Events\PassDeletedEvent` when a user deletes one. Listen to them like any other event:

```
namespace App\Listeners;

use LauLamanApps\GoogleWalletLaravel\Events\PassSavedEvent;

final class MarkPassAsSaved
{
    public function handle(PassSavedEvent $event): void
    {
        $event->getObjectId();      // '3388000000012345678.member-0001'
        $event->getClassId();       // '3388000000012345678.membership'
        $event->getCallbackEvent(); // the verified LauLamanApps\GoogleWallet\Callback\CallbackEvent
    }
}
```

Callbacks are delivered at least once and may arrive more than once: use `$event->getCallbackEvent()->getNonce()` to deduplicate.

Credits
-------

[](#credits)

This package has been developed by [LauLaman](https://github.com/LauLaman).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/930ca3b1756d00a63c8ff3363e81f16f961cf3ef79ff0c9d362670c36d97e456?d=identicon)[LauLaman](/maintainers/LauLaman)

---

Top Contributors

[![LauLaman](https://avatars.githubusercontent.com/u/8283992?v=4)](https://github.com/LauLaman "LauLaman (5 commits)")

---

Tags

phplaravelgoogleandroidwallettransitpasscouponevent ticketloyalty

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laulamanapps-google-wallet-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/laulamanapps-google-wallet-laravel/health.svg)](https://phpackages.com/packages/laulamanapps-google-wallet-laravel)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
