forExternalPurchaseController

Creates a merged CustomerInfo from device, web, and external purchase controller sources.

When using an external purchase controller, the subscriptionStatus is the source of truth for active entitlements. This method:

  1. Merges device and web transactions (subscriptions and nonSubscriptions)

  2. Takes only inactive device entitlements (for history)

  3. Takes active Play Store entitlements from subscriptionStatus (source of truth)

  4. Keeps all web entitlements

  5. Merges using priority rules

This ensures the external purchase controller's entitlements are preserved even when device receipts don't have that information (e.g., RevenueCat granted entitlements from cross-platform purchases).

Return

A new CustomerInfo with all sources merged

Parameters

storage

Storage to read device and web CustomerInfo from

subscriptionStatus

The subscription status containing entitlements from external controller