Repository navigation
feat(google): loyalty balance and account name on store cards - #82
Merged
Merged
Conversation
alexpate
marked this pull request as ready for review
October 8, 2026 15:56
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.
What
Adds
google.loyaltyto store cards so Google Wallet loyalty objects can show a native balance and the holder's name:points/secondaryPoints:{ label, balance }becomeloyaltyPoints/secondaryLoyaltyPoints. A string balance is sent asbalance.string(so "6 / 10" works as-is), an int32 asbalance.int, any other finite number asbalance.double.accountName: the holder's name.nullleaves it off the object.GoogleLoyalty,GoogleLoyaltyPoints. README section and a minor changeset included.Why
Store cards always put the pass description in
accountName, which Google defines as the holder's name (for example "John Smith"). Stamp cards therefore showed "Stamp card for ..." there and had no native balance.Testing
accountNameset andnull, class output unchanged.accountName; other styles still stripgoogle.Compatibility
Opt-in. Without
google.loyaltythe output is byte-for-byte what 0.6.0 renders, andaccountNamestill defaults to the description (pinned by a full-payload test whose expected output was captured from the 0.6.0 release). Both fields are object-level, so a balance change never re-submits the class for review. Other styles ignore the key (it's stripped, as unknown keys always were). A malformedgooglevalue on a store card is now a schema error (it used to be stripped silently).