Skip to content

feat(commerce): add Play Kilo Pass presentation flag - #5581

Open
iscekic wants to merge 2 commits into
mainfrom
android-iap-e895
Open

feat(commerce): add Play Kilo Pass presentation flag#5581
iscekic wants to merge 2 commits into
mainfrom
android-iap-e895

Conversation

@iscekic

@iscekic iscekic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

No new behavior — this change only prepares the Google Play purchase path for Kilo Pass on Android; a later change turns it on. Every user keeps the purchase options they see today.


The ResolvePurchasePresentationInput contract gains an optional supportsNativePlayKiloPass field. A caller that sends true for an Android Play Kilo Pass now receives native_iap, and isNativeIapMutationAllowed returns true for the same combination. Old Android callers omit the field or send false and keep the current unavailable or Stripe web-management result, so no stored input breaks.

Files
  • packages/app-shared/src/commerce/purchase-presentation.ts — adds supportsNativePlayKiloPass to ResolvePurchasePresentationInput; adds a native_iap branch for Android Play Kilo Pass when the flag is true; extends isNativeIapMutationAllowed to admit Android Play Kilo Pass.

The web PurchasePresentationInput gains the same optional field, and buildPurchasePresentation forwards it to the shared resolver. A future Android client that calls the web path can signal native Play IAP support without changing the web return shape. Current web callers are unchanged because the field is optional and unset.

Files
  • apps/web/src/lib/kilo-pass/purchase-presentation.ts — adds supportsNativePlayKiloPass to PurchasePresentationInput and passes it through in buildPurchasePresentation.

Tests: 2 test files updated.
Generated: none.


Verification

E2E: bot-e2e — runtime verification runs once on the tip PR (level 6) after all levels land. This level is reviewed on its own diff.

Visual Changes

Visual Changes: N/A

Reviewer Notes

Level 1 changes no runtime behavior on its own; the flag is inert until level 6 wires the Android client to send true.

Stacked PRs — merge bottom to top. Each level shows only its own diff.

Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.

  1. android-iap-e895feat(commerce): add Play Kilo Pass presentation flag #5581 ← this PR
  2. android-iap-e895-s2feat(kilo-pass): add Google Play publisher SDK #5582
  3. android-iap-e895-s3feat(kilo-pass): add Google Play purchase verifier #5586
  4. android-iap-e895-s4feat(kilo-pass): handle Play real-time notifications #5598
  5. android-iap-e895-s5feat(kilo-pass): add completePlayPurchase mutation #5608
  6. android-iap-e895-s6feat(mobile): offer Google Play Kilo Pass purchase #5618 (tip)

@iscekic iscekic self-assigned this Aug 27, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • apps/web/src/lib/kilo-pass/purchase-presentation.test.ts
  • apps/web/src/lib/kilo-pass/purchase-presentation.ts
  • apps/web/src/routers/kilo-pass-router.ts
  • packages/app-shared/src/commerce/purchase-presentation.test.ts
  • packages/app-shared/src/commerce/purchase-presentation.ts
Previous Review Summary (commit fe6bb56)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit fe6bb56)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
packages/app-shared/src/commerce/purchase-presentation.ts 208 Android Play is now admitted by isNativeIapMutationAllowed, which immediately opens completeAppStorePurchase
Files Reviewed (4 files)
  • packages/app-shared/src/commerce/purchase-presentation.ts - 1 issue
  • packages/app-shared/src/commerce/purchase-presentation.test.ts
  • apps/web/src/lib/kilo-pass/purchase-presentation.ts
  • apps/web/src/lib/kilo-pass/purchase-presentation.test.ts

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 164.3K · Output: 7.7K · Cached: 86.5K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 27, 2026
storefront: PurchaseStorefront | null | undefined;
product: PurchaseProduct;
program?: string | null;
supportsNativePlayKiloPass?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bot: The new capability flag cannot reach the existing tRPC purchase flows.

Suggested fix: Add supportsNativePlayKiloPass: z.boolean().optional() to the request schema(s) intended to support Android native IAP—at least GetPurchasePresentationInputSchema, and PreflightPurchaseInputSchema if that is the client purchase gate—then forward input.supportsNativePlayKiloPass when constructing each PurchasePresentationInput. Add router tests showing true produces the enabled Android presentation/preflight behavior and omission remains legacy behavior. As written, both schemas strip/reject the field and the router reconstructs inputs without it, so RPC callers always resolve Android Play Kilo Pass as unavailable or Stripe web management.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants