laulamanapps/google-wallet-symfony

Google Wallet integration for your Symfony application

Maintainers

Package info

github.com/LauLamanApps/google-wallet-symfony

pkg:composer/laulamanapps/google-wallet-symfony

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 1

Stars: 0

Open Issues: 0

v1.0.0 2026-07-08 08:00 UTC

This package is auto-updated.

Last update: 2026-07-08 08:04:32 UTC


README

This package provides Symfony integration for the LauLamanApps Google Wallet Package.

Requirements

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

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

Head over to the Google Wallet Console and create a service account with access to the Google Wallet API. Download the JSON key file for that service account.

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

Key Required Default Description
service_account yes Path to the Google service-account JSON key file
origins no [] Allowed origins for the Save to Google Wallet button

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 for details on building pass objects and classes.

Credits

This package has been developed by LauLaman.