laulamanapps/google-wallet-symfony 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laulamanapps/google-wallet-symfony

Composer 安装命令:

composer require laulamanapps/google-wallet-symfony

包简介

Google Wallet integration for your Symfony application

README 文档

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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固