-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses a dictionary to build a Transaction, instead of the incorrect ty…
…pealias to RCStoreTransaction. (#113)
- Loading branch information
1 parent
0a38a61
commit 1b86be3
Showing
4 changed files
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
core/src/iosMain/kotlin/com/revenuecat/purchases/kmp/models/Transaction.ios.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
package com.revenuecat.purchases.kmp.models | ||
|
||
import cocoapods.PurchasesHybridCommon.RCStoreTransaction | ||
import com.revenuecat.purchases.kmp.ktx.toEpochMilliseconds | ||
import platform.Foundation.NSDate | ||
|
||
public actual typealias Transaction = RCStoreTransaction | ||
// FIXME This should be a typealias of RCNonSubscriptionTransaction so we don't need to use a map. | ||
public actual class Transaction internal constructor(map: Map<String, Any?>) { | ||
internal val transactionIdentifier: String by map | ||
internal val productIdentifier: String by map | ||
internal val purchaseDate: NSDate by map | ||
} | ||
|
||
public actual val Transaction.transactionIdentifier: String | ||
get() = transactionIdentifier() | ||
get() = transactionIdentifier | ||
public actual val Transaction.productIdentifier: String | ||
get() = productIdentifier() | ||
get() = productIdentifier | ||
public actual val Transaction.purchaseDateMillis: Long | ||
get() = purchaseDate().toEpochMilliseconds() | ||
get() = purchaseDate.toEpochMilliseconds() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters