All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iosMain.com.revenuecat.purchases.kmp.mappings.Transaction.ios.kt Maven / Gradle / Ivy

The newest version!
package com.revenuecat.purchases.kmp.mappings

import com.revenuecat.purchases.kmp.mappings.ktx.toEpochMilliseconds
import com.revenuecat.purchases.kmp.models.Transaction
import platform.Foundation.NSDate

internal fun Map.toTransaction(): Transaction {
    // TODO: This is a workaround for the fact that PHC does not expose
    // the NonSubscriptionTransaction type
    return Transaction(
        transactionIdentifier = get("transactionIdentifier") as String,
        productIdentifier = get("productIdentifier") as String,
        purchaseDateMillis = (get("purchaseDate") as NSDate).toEpochMilliseconds()
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy