From 66f3e81f574b4dee20f5d49758d826332a6d41fa Mon Sep 17 00:00:00 2001 From: Hyo Date: Tue, 4 Aug 2026 03:49:56 +0900 Subject: [PATCH] fix(google): fall back to token for blank horizon order ids The Horizon billing-compatibility Purchase.orderId is a non-null String and arrives blank on device, so the converter's null-only `orderId ?: token` fallback never fired and produced purchases with an empty id and transactionId. The strict cross-SDK purchase decoders introduced in #276 correctly reject an empty id, which failed the whole available-purchases batch on a Quest 3 with two real store purchases: getAvailablePurchases result: purchaseCount=2 NitroPurchase has invalid required field: id PurchaseError: billing-response-json-parse-error Blank-aware fallbacks now cover toPurchase (id, transactionId) and toActiveSubscription (transactionId), pinned by regression tests that build the Meta Purchase with a blank and a present orderId, and the payload-parity audit's pinned source expression for the Horizon transactionId is updated to the new canonical form. Verified on the same Quest 3: the batch decodes as 4 available purchases and 2 active subscriptions with no decode errors. Also enable the commented-out HORIZON_APP_ID meta-data in the React Native example manifest. Without it the Horizon platform SDK cannot initialize, so initConnection failed before any store call and the example was not runnable on the device at all. The meta-data is inert on Play and FireOS builds. Co-Authored-By: Claude Opus 5 --- .../android/app/src/main/AndroidManifest.xml | 4 +- .../hyo/openiap/utils/BillingConverters.kt | 12 ++-- .../hyo/openiap/HorizonBlankOrderIdTest.kt | 62 +++++++++++++++++++ scripts/audit-purchase-payload-parity.mjs | 3 +- 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 packages/google/openiap/src/testHorizon/java/dev/hyo/openiap/HorizonBlankOrderIdTest.kt diff --git a/libraries/react-native-iap/example/android/app/src/main/AndroidManifest.xml b/libraries/react-native-iap/example/android/app/src/main/AndroidManifest.xml index 28994e41b..f4e6565f2 100644 --- a/libraries/react-native-iap/example/android/app/src/main/AndroidManifest.xml +++ b/libraries/react-native-iap/example/android/app/src/main/AndroidManifest.xml @@ -12,9 +12,9 @@ android:supportsRtl="true"> - + android:value="31705015229097839" />