plan-changes
Installation
SKILL.md
Plan Changes: Upgrades, Downgrades, and Plan Switches
Plan changes on Google Play Billing Library (PBL) 9.x always mint a new purchase token. You pick a replacement mode that controls two things: when the user gets access to the new plan, and how Google handles the money between the old and new agreement. This skill walks you through selecting the correct mode and wiring it into BillingFlowParams.
Phase 1: Scope the Change
Before touching code, answer four questions about the requested switch:
- Direction: is this an upgrade (new plan costs more), a downgrade (new plan costs less), or a lateral switch (same price, different cadence)?
- Billing period: are you moving between plans with the same billing period (monthly to monthly) or across periods (monthly to annual, recurring to prepaid)?
- Promotional state: is the user currently inside a free trial or introductory price window that should survive the switch?
- Additivity: is the new SKU replacing the old subscription, or should it sit alongside the old one as an add on?
Write those four answers down. Every decision in Phase 2 follows directly from them.
You also need two inputs from the client at runtime:
oldPurchaseToken: the purchase token for the subscription the user is leaving.ProductDetailsand offer token for the new plan, fetched throughqueryProductDetailsAsync.