PHPackages                             jolicode/wallet-kit - 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. jolicode/wallet-kit

ActiveLibrary[API Development](/categories/api)

jolicode/wallet-kit
===================

Manage Apple &amp; Google wallets

v1.0.0(2mo ago)70[1 PRs](https://github.com/jolicode/wallet-kit/pulls)MITPHPPHP &gt;=8.3CI passing

Since Apr 7Pushed 5d agoCompare

[ Source](https://github.com/jolicode/wallet-kit)[ Packagist](https://packagist.org/packages/jolicode/wallet-kit)[ RSS](/packages/jolicode-wallet-kit/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

 [![wallet-kit](https://camo.githubusercontent.com/365ecea22d46db3a55fbf41549714c5df03284d3452893621053ef7db402c557/68747470733a2f2f6a6f6c69636f64652e636f6d2f6d656469612f6f726967696e616c2f6f73732f686561646572732f77616c6c65742d6b69742e706e67)](https://github.com/jolicode/wallet-kit)
 WalletKit
 *###### One fluent API to model Apple Wallet and Google Wallet payloads in typed PHP.*
================================================================================================================================================================================================================================================================================================================================================================================================

[](#------walletkit----one-fluent-api-to-model-apple-wallet-and-google-wallet-payloads-in-typed-php)

[![PHP Version Require](https://camo.githubusercontent.com/a2361eb1a835e397e98ebc3a203890259033d41ce85935658c305dac5ac2d36c/687474703a2f2f706f7365722e707567782e6f72672f6a6f6c69636f64652f77616c6c65742d6b69742f726571756972652f706870)](https://packagist.org/packages/jolicode/wallet-kit)[![Monthly Downloads](https://camo.githubusercontent.com/11dee4cfe4a10a5d7cd74e472d8fc977af840b994ab9ee0a48fb7b7c3a6d017f/687474703a2f2f706f7365722e707567782e6f72672f6a6f6c69636f64652f77616c6c65742d6b69742f642f6d6f6e74686c79)](https://packagist.org/packages/jolicode/wallet-kit)

Overview
--------

[](#overview)

Wallet Kit helps you build the **JSON payloads** wallet platforms expect. It focuses on **modeling and normalization** (via Symfony Serializer): it does **not** sign Apple passes, bundle `.pkpass` files, call Google Wallet APIs, or tokenize Samsung Wallet payloads.

- **PHP** 8.3+
- **symfony/serializer** ^7.4 || ^8.0

🛠️ Builder
----------

[](#️-builder)

The **`Jolicode\WalletKit\Builder`** namespace provides a fluent API centered on [`WalletPass`](src/Builder/WalletPass.php). Build a [`WalletPlatformContext`](src/Builder/WalletPlatformContext.php) with `->withApple(...)`, `->withGoogle(...)`, and/or `->withSamsung(...)`, then call `build()` to obtain a [`BuiltWalletPass`](src/Builder/BuiltWalletPass.php) (`apple()`, `google()`, `samsung()`). You can then normalize these models using Symfony Serializer along with this package's normalizers.

**Cookbook** (single-store `appleOnly` / `googleOnly`, every vertical, shared options, exceptions): [docs/builder-examples.md](docs/builder-examples.md).

### Example — all platforms

[](#example--all-platforms)

```
$context = (new WalletPlatformContext())
    ->withApple(
        teamIdentifier: 'ABCDE12345',
        passTypeIdentifier: 'pass.com.example.coupon',
        serialNumber: 'COUPON-001',
        organizationName: 'Example Shop',
        description: 'Spring sale coupon',
    )
    ->withGoogle(
        classId: '3388000000012345.example_offer_class',
        objectId: '3388000000012345.example_offer_object',
        defaultReviewStatus: ReviewStatusEnum::APPROVED,
        defaultGoogleObjectState: StateEnum::ACTIVE,
    )
    ->withSamsung(
        refId: 'coupon-samsung-001',
        appLinkLogo: 'https://example.com/logo.png',
        appLinkName: 'Example Shop',
        appLinkData: 'https://example.com',
    );

$built = WalletPass::offer(
    $context,
    title: '15% off',
    provider: 'Example Shop',
    redemptionChannel: RedemptionChannelEnum::BOTH,
)
    ->withBackgroundColorRgb('rgb(30, 60, 90)')
    ->addAppleBarcode(new Barcode(
        altText: 'Coupon',
        format: BarcodeFormatEnum::QR,
        message: 'SAVE15-2026',
        messageEncoding: 'utf-8',
    ))
    ->build();

// $built->apple()     → Pass (coupon)
// $built->google()    → OfferClass + OfferObject
// $built->samsung()   → Card (coupon)
// Then normalize with Symfony Serializer + this library's normalizers.
```

### 🍏 Apple Wallet

[](#-apple-wallet)

Apple's model maps to a **single** tree: either use the **builder** above or build a `Pass` manually (see `src/Pass/Apple/`) and normalize it to the structure that becomes **`pass.json`** inside a pass package. Images, manifest, and cryptographic signing are still your responsibility.

### 🤖 Google Wallet

[](#-google-wallet)

Google's API splits each pass type into **two** resources: a **class** (shared template) and an **object** (one per holder). The object references the class through **`classId`**. This library exposes both sides under `src/Pass/Android/` for: EventTicket, Flight, Generic, GiftCard, Loyalty, Offer, and Transit. The **builder** returns that pair from `BuiltWalletPass::google()`.

### 📱 Samsung Wallet

[](#-samsung-wallet)

Samsung Wallet uses a **single unified JSON** envelope: a `Card` containing `type`, `subType`, and a `data` array of card entries with `attributes` (type-specific fields). This library models 8 Samsung card types under `src/Pass/Samsung/`: BoardingPass, EventTicket, Coupon, GiftCard, Loyalty, Generic, DigitalId, and PayAsYouGo. The **builder** maps the 7 cross-platform verticals to their Samsung equivalents and returns a `Card` from `BuiltWalletPass::samsung()`. DigitalId and PayAsYouGo are Samsung-only types — build them directly via the model classes.

Install
-------

[](#install)

```
composer require jolicode/wallet-kit
```

Package layout
--------------

[](#package-layout)

- `Jolicode\WalletKit\Pass\Apple` — Apple Wallet `pass.json` payloads
- `Jolicode\WalletKit\Pass\Android` — Google Wallet class and object payloads
- `Jolicode\WalletKit\Pass\Samsung` — Samsung Wallet card payloads
- `Jolicode\WalletKit\Builder` — Fluent builders (`WalletPass`, …) for Apple, Google, Samsung, or all
- `Jolicode\WalletKit\Exception` — Builder context and `BuiltWalletPass` accessor exceptions

API spec checks (with Castor)
-----------------------------

[](#api-spec-checks-with-castor)

When [Castor](https://github.com/jolicode/castor) is available, you can verify that tracked baselines still match the **Google Wallet discovery document**, the **Apple `pass.json` phpstan shapes**, and the **Samsung Wallet model shapes** in this repo:

CommandPurpose`castor spec:check:google`Fetches the live Wallet Objects discovery and compares its `revision` to [`tools/spec/google-wallet-baseline.json`](tools/spec/google-wallet-baseline.json).`castor spec:baseline:google`After you update Android models for a new discovery revision, refreshes that JSON baseline.`castor spec:check:apple`Regenerates a key list from `src/Pass/Apple/Model` `@phpstan-type` array shapes and diffs it against [`tools/spec/apple-pass-keyset.json`](tools/spec/apple-pass-keyset.json).`castor spec:baseline:apple`Rewrites `apple-pass-keyset.json` from the current phpstan definitions (run after intentional model changes).`castor spec:check:samsung`Regenerates a key list from `src/Pass/Samsung/Model` `@phpstan-type` array shapes and diffs it against [`tools/spec/samsung-wallet-keyset.json`](tools/spec/samsung-wallet-keyset.json).`castor spec:baseline:samsung`Rewrites `samsung-wallet-keyset.json` from the current phpstan definitions (run after intentional model changes).Scripts live under [`tools/spec/`](tools/spec/) and are also invoked by CI (`spec-check` job).

Next steps
----------

[](#next-steps)

The library today stops at **typed payloads and normalization**. Planned extensions include:

- **Apple `.pkpass` packaging** — assemble the pass bundle (images, `pass.json`, manifest), handle **localized resources** (`*.lproj`, string tables), and optionally integrate **signing** so a complete `.pkpass` can be produced from the models you already build.
- **Google Wallet API client** — HTTP integration to **create, update, and patch** classes and objects (REST), including the **service-account JWT** flow Google expects, so you can go from `BuiltWalletPass::google()` to live passes without wiring the client yourself.
- **Push notifications &amp; in-wallet updates** — **APNs** integration to trigger **Apple Wallet** pass refreshes (silent/empty push so PassKit pulls a new `pass.json` from your web service), **Google Wallet** support for **API-driven updates** plus **user-visible messages / notification hooks** where the platform exposes them, and **Samsung Wallet** push updates via the **Partner API**, so pass changes actually reach holders' devices across all three platforms.
- **Samsung Wallet tokenization &amp; Partner API** — JWT token generation for card payloads, HTTP integration with the **Samsung Wallet Partner API** to **create, update, and expire** cards, and card-state lifecycle management, so you can go from `BuiltWalletPass::samsung()` to live cards without wiring the client yourself.

Other directions that often sit next to “wallet” libraries (for later consideration):

- **Apple PassKit Web Service** — register/update HTTP endpoints, authentication token handling, and glue between your backend and the **APNs** flow above.
- **Issuance UX helpers** — stable patterns for **Add to Apple Wallet** / **Save to Google Pay** / **Add to Samsung Wallet** links, deep links, and optional **JWT** flows where platforms require them.
- **Operational tooling** — fixtures for integration tests, optional **CLI or Castor tasks** that mirror production steps (e.g. dry-run Google calls, local `.pkpass` inspection).

Contributions or design discussion for any of the above are welcome.

License
-------

[](#license)

View the [LICENSE](LICENSE) file attached to this project.

[![JoliCode is sponsoring this project](https://camo.githubusercontent.com/5dd64f06b500f261fcaac4e3594ca2d4efa01177f217c45a88835dc62140aaa2/68747470733a2f2f6a6f6c69636f64652e636f6d2f6d656469612f6f726967696e616c2f6f73732f666f6f7465722d6769746875622e706e673f7633)](https://jolicode.com/)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance93

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

81d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/944409?v=4)[Baptiste Leduc](/maintainers/Korbeil)[@Korbeil](https://github.com/Korbeil)

---

Top Contributors

[![Korbeil](https://avatars.githubusercontent.com/u/944409?v=4)](https://github.com/Korbeil "Korbeil (31 commits)")

---

Tags

androidapplephpwallet

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jolicode-wallet-kit/health.svg)

```
[![Health](https://phpackages.com/badges/jolicode-wallet-kit/health.svg)](https://phpackages.com/packages/jolicode-wallet-kit)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67210.4M25](/packages/googleads-googleads-php-lib)[api-platform/symfony

Symfony API Platform integration

354.0M110](/packages/api-platform-symfony)[api-platform/validator

API Platform validator component

264.1M23](/packages/api-platform-validator)[api-platform/state

API Platform state interfaces

244.3M112](/packages/api-platform-state)[api-platform/serializer

API Platform core Serializer

244.3M71](/packages/api-platform-serializer)

PHPackages © 2026

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