merge
Merges this CustomerInfo (device) with web CustomerInfo, deduplicating transactions by transaction ID.
This method combines transaction history and entitlements from both on-device purchases and web-based purchases/redemptions. It ensures:
No duplicate transactions (keyed by
transactionId)Web entitlements take precedence over device entitlements when IDs match (via priority rules)
All transactions are sorted by purchase date
When duplicate transaction IDs are found for subscriptions, priority is determined by:
Active status (active > inactive)
Revocation status (non-revoked > revoked)
Auto-renewal (will renew > won't renew)
Grace period (in grace period > not in grace period)
Most recent purchase date (latest > earliest)
For entitlements, priority rules (applied via EntitlementPriorityComparator):
Active status (active > inactive)
Transaction history presence (has history > no history)
Lifetime status (lifetime > time-limited)
Latest expiration date
Auto-renewal (will renew > won't renew)
Subscription state quality (SUBSCRIBED > GRACE_PERIOD > BILLING_RETRY > EXPIRED)
Return
A new CustomerInfo with merged data from both sources
Parameters
The CustomerInfo from web2app endpoints containing web purchases/redemptions