laulamanapps/wallet-symfony

Platform-agnostic wallet pass generation for your Symfony application

Maintainers

Package info

github.com/LauLamanApps/wallet-symfony

pkg:composer/laulamanapps/wallet-symfony

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

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:54 UTC


README

Platform-agnostic wallet pass generation for your Symfony application.

This bundle integrates laulamanapps/wallet into Symfony. It wires the LauLamanApps\Wallet\Wallet service, collects every PassGenerator in your container, and can optionally enable the built-in Apple and Google bridges.

Installation

composer require laulamanapps/wallet-symfony

Register the bundle (skip when using Symfony Flex):

// config/bundles.php
return [
    // ...
    LauLamanApps\WalletBundle\WalletBundle::class => ['all' => true],
];

Configuration

# config/packages/laulamanapps_wallet.yaml
laulamanapps_wallet:
    apple:
        enabled: true
    google:
        enabled: true
        issuer_id: '%env(GOOGLE_WALLET_ISSUER_ID)%'
        class_suffix: ~ # optional, defaults to the pass type

Both bridges are disabled by default. When google.enabled is true, issuer_id is required.

How the bridges resolve their engine services

The bridges are thin adapters around the platform SDKs and expect their engine services to be present in the container:

  • Applelaulamanapps_wallet.bridge.apple receives the LauLamanApps\ApplePassbook\Build\Compiler service. Install laulamanapps/apple-passbook-bundle, which registers that service (including certificate/signing configuration), or define a Compiler service yourself.
  • Googlelaulamanapps_wallet.bridge.google receives the LauLamanApps\GoogleWallet\SaveUrlFactory service. Install laulamanapps/google-wallet-symfony, which registers that service from your service account credentials, or define a SaveUrlFactory service yourself:
# config/services.yaml
services:
    LauLamanApps\GoogleWallet\ServiceAccount:
        factory: ['LauLamanApps\GoogleWallet\ServiceAccount', 'fromJsonFile']
        arguments: ['%env(GOOGLE_WALLET_SERVICE_ACCOUNT)%']

    LauLamanApps\GoogleWallet\SaveUrlFactory:
        arguments: ['@LauLamanApps\GoogleWallet\ServiceAccount']

Adding a custom PassGenerator

Any service implementing LauLamanApps\Wallet\PassGenerator is picked up automatically through autoconfiguration — it is tagged laulamanapps_wallet.pass_generator and registered on the Wallet:

use LauLamanApps\Wallet\GeneratedPass;
use LauLamanApps\Wallet\Pass;
use LauLamanApps\Wallet\PassGenerator;

final class MyPassGenerator implements PassGenerator
{
    public function getPlatform(): string
    {
        return 'my-platform';
    }

    public function generate(Pass $pass): GeneratedPass
    {
        return GeneratedPass::url('my-platform', 'https://example.com/pass/' . $pass->getId());
    }
}

No tagging or configuration needed as long as autoconfigure: true is on (the Symfony default).

Generating a pass

Inject the Wallet and generate for the platform you need:

use LauLamanApps\Wallet\Pass;
use LauLamanApps\Wallet\PassType;
use LauLamanApps\Wallet\Wallet;

final class TicketController
{
    public function __construct(private readonly Wallet $wallet)
    {
    }

    public function __invoke(): Response
    {
        $pass = new Pass('ticket-4664', PassType::EventTicket, 'LauLaman Apps', 'Awesome Conference');

        $generated = $this->wallet->generate('google', $pass); // or 'apple', 'my-platform', ...

        return new RedirectResponse($generated->getUrl());
    }
}

Use $wallet->generateForAllPlatforms($pass) to build the pass for every registered platform at once.

Credits

License

The MIT License (MIT). Please see License File for more information.