From 590b3218977ce282f2b9b55822cc7e9884a87644 Mon Sep 17 00:00:00 2001 From: Hyo Date: Sat, 13 Dec 2025 04:15:44 +0900 Subject: [PATCH 1/4] refactor: move sku into platform-specific verification options - Remove sku from VerifyPurchaseProps root level - Add sku to VerifyPurchaseAppleOptions (replaces jws) - Add sku to VerifyPurchaseGoogleOptions - Update Kotlin code to use googleOptions.sku - Update tests for new schema structure - Update release notes for v1.3.4/v1.3.14/v1.3.2 --- packages/apple/Sources/Models/Types.swift | 23 ++++++------ .../docs/src/pages/docs/updates/notes.tsx | 36 +++++++++---------- .../src/main/java/dev/hyo/openiap/Types.kt | 27 +++++++------- .../utils/PurchaseVerificationValidator.kt | 3 +- .../PurchaseVerificationValidatorTest.kt | 23 ++++++------ packages/gql/src/generated/Types.kt | 27 +++++++------- packages/gql/src/generated/Types.swift | 23 ++++++------ packages/gql/src/generated/types.dart | 34 +++++++----------- packages/gql/src/generated/types.ts | 13 +++---- packages/gql/src/type-android.graphql | 4 +++ packages/gql/src/type-ios.graphql | 7 ++-- packages/gql/src/type.graphql | 4 --- 12 files changed, 99 insertions(+), 125 deletions(-) diff --git a/packages/apple/Sources/Models/Types.swift b/packages/apple/Sources/Models/Types.swift index 42365f34..a56f0602 100644 --- a/packages/apple/Sources/Models/Types.swift +++ b/packages/apple/Sources/Models/Types.swift @@ -1337,17 +1337,14 @@ public struct SubscriptionProductReplacementParamsAndroid: Codable { /// Apple App Store verification parameters. /// Used for server-side receipt validation via App Store Server API. -/// -/// ⚠️ SECURITY: Contains sensitive token (jws). Do not log or persist this data. public struct VerifyPurchaseAppleOptions: Codable { - /// The JWS (JSON Web Signature) representation of the transaction. - /// ⚠️ Sensitive: Do not log this value. - public var jws: String + /// Product SKU to validate + public var sku: String public init( - jws: String + sku: String ) { - self.jws = jws + self.sku = sku } } @@ -1366,17 +1363,21 @@ public struct VerifyPurchaseGoogleOptions: Codable { /// Purchase token from the purchase response. /// ⚠️ Sensitive: Do not log this value. public var purchaseToken: String + /// Product SKU to validate + public var sku: String public init( accessToken: String, isSub: Bool? = nil, packageName: String, - purchaseToken: String + purchaseToken: String, + sku: String ) { self.accessToken = accessToken self.isSub = isSub self.packageName = packageName self.purchaseToken = purchaseToken + self.sku = sku } } @@ -1417,19 +1418,15 @@ public struct VerifyPurchaseProps: Codable { public var google: VerifyPurchaseGoogleOptions? /// Meta Horizon (Quest) verification parameters. public var horizon: VerifyPurchaseHorizonOptions? - /// Product SKU to validate - public var sku: String public init( apple: VerifyPurchaseAppleOptions? = nil, google: VerifyPurchaseGoogleOptions? = nil, - horizon: VerifyPurchaseHorizonOptions? = nil, - sku: String + horizon: VerifyPurchaseHorizonOptions? = nil ) { self.apple = apple self.google = google self.horizon = horizon - self.sku = sku } } diff --git a/packages/docs/src/pages/docs/updates/notes.tsx b/packages/docs/src/pages/docs/updates/notes.tsx index fa7c0f9e..d5eb384f 100644 --- a/packages/docs/src/pages/docs/updates/notes.tsx +++ b/packages/docs/src/pages/docs/updates/notes.tsx @@ -29,29 +29,31 @@ function Notes() { }} >

- 📅 openiap-gql v1.3.3 / openiap-google v1.3.13 / openiap-apple v1.3.1 + 📅 openiap-gql v1.3.4 / openiap-google v1.3.14 / openiap-apple v1.3.2 - Platform-Specific Verification Options

- verifyPurchase API Refactored: + verifyPurchase API Refactored (Breaking Change):

- The verifyPurchase API now supports platform-specific - options for Apple, Google, and Meta Horizon stores. + The verifyPurchase API now requires platform-specific + options for Apple, Google, and Meta Horizon stores. The{' '} + sku field has been moved inside each platform-specific + options object.