Download the PHP package laulamanapps/google-wallet-laravel without Composer

On this page you can find all versions of the php package laulamanapps/google-wallet-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-wallet-laravel

Google Wallet Laravel

This package provides Laravel integration for the LauLamanApps Google Wallet Package: generate "Add to Google Wallet" save links (RS256-signed JWTs) from your Laravel application.

Requirements

Installation

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

Run Tests

Configuration

Publish the config file:

This creates config/google-wallet.php:

Key Default Description
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 route

Add the ENV variable to your .env file:

Get a service account

  1. Sign up for a Google Wallet issuer account in the Google Pay & Wallet 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

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

Render the url as an Add to Google Wallet button and you are done.

See the core package documentation 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

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

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://:

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:

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

Credits

This package has been developed by LauLaman.


All versions of google-wallet-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laulamanapps/google-wallet Version ^1.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laulamanapps/google-wallet-laravel contains the following files

Loading the files please wait ...