Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive Samsung Wallet support to wallet-kit, extending the library's multi-platform abstraction to cover Apple, Google, and Samsung Wallet. Samsung Wallet uses a unified JSON envelope model (unlike Google's Class+Object split), with 8 card
types that map to the existing 7 cross-platform verticals plus 2 Samsung-only types.
Motivation
wallet-kit already abstracts Apple Wallet and Google Wallet with a fluent builder API and typed PHP models. Adding Samsung Wallet completes coverage of the three major mobile wallet platforms, allowing developers to build passes for all three from a single
source.
Changes
Models (
src/Pass/Samsung/Model/)Card,CardData,Localization— unified JSON structure with single card type per envelopeSamsungImage(dark/light variants),SamsungBarcode(serialType-based),Location(lat/lng)CardTypeEnum,CardSubTypeEnum(14 subtypes),SerialTypeEnumNormalizers (
src/Pass/Samsung/Normalizer/)"Y"/"N"instead oftrue/false)Builder Integration
SamsungWalletContext: refId, language, app link fields (required by Samsung)SamsungBarcodeMapper— Apple → Samsung barcode format conversionSamsungBoardingPassSubTypeMapper— Transit type → Samsung subtype mappingWalletPlatformContextrefactored to fluent builder pattern:::both(),::all(), etc.)withApple(),withGoogle(),withSamsung()CardoutputCommonWalletBuilderTraitextended:mutateSamsung(),createSamsungCard(),primarySamsungBarcode(),resolvedSamsungHexColor()Spec Verification (
tools/spec/)samsung-wallet-keyset.php— extracts@phpstan-typekeys from Samsung models (mirrors Apple approach)samsung-wallet-keyset.json— baseline for CI spec-check validationcastor.php— addedspec:check:samsungandspec:baseline:samsungtasksTests & Documentation
Key Architectural Decisions
WalletPassfactory methodsVerification
Notes for Reviewers
"Y"/"N"strings per Samsung specappLinkLogo,appLinkName,appLinkData) are required on all Samsung card typesWalletPlatformContextAPI change is breaking: users upgrade fromWalletPlatformContext::both(...)to(new WalletPlatformContext())->withApple(...)->withGoogle(...)