Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 21790e3

Browse files
committed
fix(hot): convertToOpenIapPurchase type
1 parent 7d4427f commit 21790e3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

openiap/src/main/java/dev/hyo/openiap/OpenIapModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ class OpenIapModule(private val context: Context) : OpenIapProtocol, PurchasesUp
686686
productType: String
687687
): OpenIapPurchase {
688688
return OpenIapPurchase(
689-
id = purchase.purchaseToken,
689+
id = purchase.orderId ?: purchase.purchaseToken,
690690
productId = purchase.products.firstOrNull() ?: "",
691691
ids = purchase.products,
692692
transactionId = purchase.orderId,
@@ -697,7 +697,6 @@ class OpenIapModule(private val context: Context) : OpenIapProtocol, PurchasesUp
697697
quantity = purchase.quantity,
698698
purchaseState = OpenIapPurchase.PurchaseState.fromBillingClientState(purchase.purchaseState),
699699
isAutoRenewing = purchase.isAutoRenewing,
700-
purchaseTokenAndroid = purchase.purchaseToken,
701700
dataAndroid = purchase.originalJson,
702701
signatureAndroid = purchase.signature,
703702
autoRenewingAndroid = purchase.isAutoRenewing,

openiap/src/main/java/dev/hyo/openiap/models/OpenIapPurchase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data class OpenIapPurchase(
99
val id: String,
1010
val productId: String,
1111
val ids: List<String>? = null,
12-
val transactionId: String? = null, // deprecated - use id instead
12+
val transactionId: String? = null,
1313
val transactionDate: Long,
1414
val transactionReceipt: String,
1515
val purchaseToken: String? = null, // unified purchase token

0 commit comments

Comments
 (0)