PHPackages                             laulamanapps/google-wallet-symfony - 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-symfony

ActiveLibrary[API Development](/categories/api)

laulamanapps/google-wallet-symfony
==================================

Google Wallet integration for your Symfony application

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

Since Jul 8Pushed 1mo agoCompare

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

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

Google Wallet Symfony Bundle
============================

[](#google-wallet-symfony-bundle)

This package provides Symfony integration for the [LauLamanApps Google Wallet Package](https://github.com/LauLamanApps/google-wallet).

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

[](#requirements)

- PHP 8.1+
- Symfony 6.4, 7.x, or 8.x

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

[](#installation)

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

Register the bundle (skipped automatically when using Symfony Flex):

```
// config/bundles.php

return [
    // ...
    LauLamanApps\GoogleWalletBundle\GoogleWalletBundle::class => ['all' => true],
];
```

Get a Service Account
---------------------

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

Head over to the [Google Wallet Console](https://pay.google.com/business/console) and create a service account with access to the Google Wallet API. Download the JSON key file for that service account.

Configure Bundle
----------------

[](#configure-bundle)

```
# config/packages/laulamanapps_google_wallet.yaml

laulamanapps_google_wallet:
    service_account: '%env(GOOGLE_WALLET_SERVICE_ACCOUNT)%'
    origins:
        - 'https://example.com'
```

Add the ENV variable to the `.env` file:

```
###> laulamanapps/google-wallet-symfony ###
GOOGLE_WALLET_SERVICE_ACCOUNT=config/secrets/google-wallet-service-account.json
###< laulamanapps/google-wallet-symfony ###
```

> **Security note:** always reference the service-account key file path through `%env(...)%`as shown above. A literal value in the bundle configuration would be written into Symfony's compiled container in `var/cache`.

### Configuration reference

[](#configuration-reference)

KeyRequiredDefaultDescription`service_account`yes—Path to the Google service-account JSON key file`origins`no`[]`Allowed origins for the Save to Google Wallet button`callback.enabled`no`false`Enable the save/delete callback (webhook) endpoint`callback.issuer_id`when enabled`null`Your Google Wallet issuer id, used to verify callback signatures`callback.environment`no`'production'`Google root signing keys to verify against: `production` / `test`Usage
-----

[](#usage)

Inject the `SaveUrlFactory` to create "Save to Google Wallet" links:

```
namespace App\Controller;

use LauLamanApps\GoogleWallet\PassPayload;
use LauLamanApps\GoogleWallet\SaveUrlFactory;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;

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

    public function save(): Response
    {
        $payload = new PassPayload();
        // ... build your pass, see the laulamanapps/google-wallet README

        return new RedirectResponse($this->saveUrlFactory->create($payload));
    }
}
```

See the [laulamanapps/google-wallet README](https://github.com/LauLamanApps/google-wallet) for details on building pass objects and classes.

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

[](#savedelete-callbacks)

Google can notify your application whenever a user saves or deletes a pass. The bundle ships a ready-made webhook endpoint that verifies each callback (Google's `ECv2SigningOnly`signature scheme) and turns it into a Symfony event. Verification is enforced server-side: unverifiable requests are rejected with a `400` response and no event is dispatched, so your listeners only ever see messages that provably came from Google.

### 1. Enable the callback endpoint

[](#1-enable-the-callback-endpoint)

```
# config/packages/laulamanapps_google_wallet.yaml

laulamanapps_google_wallet:
    service_account: '%env(GOOGLE_WALLET_SERVICE_ACCOUNT)%'
    callback:
        enabled: true
        issuer_id: '3388000000012345678' # required when enabled
        environment: production          # or 'test' to verify against Google's test keys
```

### 2. Import the routes

[](#2-import-the-routes)

```
// config/routes/google_wallet.php

use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

return function (RoutingConfigurator $routes): void {
    $routes->import('@GoogleWalletBundle/Resources/config/callback_routes.php');
};
```

or in yaml:

```
# config/routes/google_wallet.yaml
googlewallet:
    resource: '@GoogleWalletBundle/Resources/config/callback_routes.php'
```

This exposes a single route, `googlewallet_callback`: `POST /google-wallet/callback`.

### 3. Register the callback url on your pass classes

[](#3-register-the-callback-url-on-your-pass-classes)

Google only sends callbacks for passes whose class declares a callback url. Set your public HTTPS URL (Google requires `https://`) on the pass classes you create:

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

### 4. Listen to the events

[](#4-listen-to-the-events)

The endpoint dispatches `LauLamanApps\GoogleWalletBundle\Event\PassSavedEvent` when a user saves a pass and `LauLamanApps\GoogleWalletBundle\Event\PassDeletedEvent` when a user deletes one:

```
namespace App\EventListener;

use LauLamanApps\GoogleWalletBundle\Event\PassDeletedEvent;
use LauLamanApps\GoogleWalletBundle\Event\PassSavedEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;

final class WalletPassListener
{
    #[AsEventListener]
    public function onPassSaved(PassSavedEvent $event): void
    {
        $event->getObjectId(); // '3388000000012345678.member-0001'
        $event->getClassId();  // '3388000000012345678.membership'
    }

    #[AsEventListener]
    public function onPassDeleted(PassDeletedEvent $event): void
    {
        // e.g. mark the pass as removed in your database
    }
}
```

Both events expose the verified message via `getCallbackEvent()`, which returns the core lib's `CallbackEvent` (event type, expiration and nonce). Callbacks are delivered at least once, so use `getCallbackEvent()->getNonce()` to deduplicate.

Credits
-------

[](#credits)

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

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

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

phpsymfonygooglewalletpasscouponevent ticketloyalty

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

12017.1k](/packages/rcsofttech-audit-trail-bundle)[ecotone/symfony-bundle

Ecotone for Symfony — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Symfony Messenger, via PHP attributes.

11258.2k1](/packages/ecotone-symfony-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1617.3k16](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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