|
1 | 1 | # OpenIAP Project Context |
2 | 2 |
|
3 | 3 | > **Auto-generated for Claude Code** |
4 | | -> Last updated: 2026-01-20T01:17:35.950Z |
| 4 | +> Last updated: 2026-01-20T21:43:18.692Z |
5 | 5 | > |
6 | 6 | > Usage: `claude --context knowledge/_claude-context/context.md` |
7 | 7 |
|
@@ -114,20 +114,21 @@ input RequestPurchaseAndroidProps { |
114 | 114 | | Cross-platform type reference | YES | `developerBillingOption: DeveloperBillingOptionParamsAndroid` | |
115 | 115 | | Internal implementation | NO (not API) | `val offerToken` in Kotlin data class | |
116 | 116 |
|
117 | | -### Internal vs API Fields |
| 117 | +### Type vs Field Suffix |
118 | 118 |
|
119 | | -- **API fields** (GraphQL schema): ALWAYS use platform suffix |
120 | | -- **Internal fields** (Kotlin/Swift data classes not exposed): No suffix needed |
| 119 | +- **Type names**: Cross-platform types ALWAYS use platform suffix (`DeveloperBillingOptionParamsAndroid`) |
| 120 | +- **Fields in platform-specific inputs**: NO suffix needed (parent type indicates platform) |
| 121 | +- **Fields in cross-platform types**: Use suffix for platform-specific fields |
121 | 122 |
|
122 | 123 | ```kotlin |
123 | | -// Internal helper data class - no suffix needed |
124 | | -internal data class AndroidPurchaseArgs( |
125 | | - val offerToken: String?, // Internal, no suffix OK |
126 | | - val isOfferPersonalized: Boolean? // Internal, no suffix OK |
127 | | -) |
128 | | - |
129 | | -// But when reading from API props, use the suffixed names: |
130 | | -val offerToken = params.offerTokenAndroid // ✓ API uses suffix |
| 124 | +// Cross-platform SDK usage |
| 125 | +requestPurchase { |
| 126 | + google { |
| 127 | + skus = listOf("product_id") |
| 128 | + offerToken = "discount_offer_token" // ✓ Clean - no redundant suffix |
| 129 | + isOfferPersonalized = false |
| 130 | + } |
| 131 | +} |
131 | 132 | ``` |
132 | 133 |
|
133 | 134 | ### Cross-Platform Functions |
|
0 commit comments