SIGN IN SIGN UP

refactor(checkpoints): Reuse CustomVariableValue for checkpoint custom variables (#3960)

### Description

`CheckpointParams` now takes `Map<String, CustomVariableValue>` instead
of `Map<String, Any?>`, so the compiler enforces the value types that
were previously checked (and dropped) at runtime.

Android equivalent of RevenueCat/purchases-ios#7400. 

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking change to `@InternalRevenueCatAPI` checkpoint APIs affects
how custom variables reach audience matching and paywalls; behavior for
invalid keys is unchanged but callers must migrate from raw primitives.
> 
> **Overview**
> **Checkpoint custom variables are now typed as `CustomVariableValue`
instead of `Map<String, Any?>`.** Call sites must wrap values in
`CustomVariableValue.String`, `.Number`, and `.Boolean`, so invalid
types are caught at compile time instead of dropped at runtime.
> 
> `CheckpointParams` validates keys once via
`CustomVariableKeyValidator` and exposes the same map for **targeting
rules** (`custom.<key>`) and **paywall rendering**. The UI layer maps
each value to `RulesDimensionValue` when calling
`Purchases.resolveCheckpoint`; the purchases module no longer converts
from loose `Any` values (`customVariableDimensions` removed).
> 
> `RulesDimensionValue` is extracted to a public
`@InternalRevenueCatAPI` type in `:purchases`, and `CustomVariableValue`
gains an internal `map` / `asRulesDimensionValue` bridge. Examples,
api-tester, and tests are updated accordingly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
14de80708eaa7f2646aa1e9e4cd809c6145f3eb7. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
T
Toni Rico committed
e68683718412f15d31a03ed9ed7ebc5f0ee1c94d
Parent: 1473a35
Committed by GitHub <noreply@github.com> on 8/14/2026, 10:39:53 AM