iosMain.com.revenuecat.purchases.kmp.mappings.DiscountPaymentMode.ios.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of purchases-kmp-mappings Show documentation
Show all versions of purchases-kmp-mappings Show documentation
Mobile subscriptions in hours, not months.
The newest version!
package com.revenuecat.purchases.kmp.mappings
import cocoapods.PurchasesHybridCommon.RCPaymentModeFreeTrial
import cocoapods.PurchasesHybridCommon.RCPaymentModePayAsYouGo
import cocoapods.PurchasesHybridCommon.RCPaymentModePayUpFront
import com.revenuecat.purchases.kmp.models.DiscountPaymentMode
import cocoapods.PurchasesHybridCommon.RCPaymentMode as IosDiscountPaymentMode
internal fun IosDiscountPaymentMode.toDiscountPaymentMode(): DiscountPaymentMode =
when (this) {
RCPaymentModeFreeTrial -> DiscountPaymentMode.FREE_TRIAL
RCPaymentModePayAsYouGo -> DiscountPaymentMode.PAY_AS_YOU_GO
RCPaymentModePayUpFront -> DiscountPaymentMode.PAY_UP_FRONT
else -> error("Unexpected RCPaymentMode: $this")
}