Payment

object Payment

RevenueCat operations and the small subscription model used by JchuComponents paywalls. The SDK performs the store-specific work through Google Play Billing on Android and StoreKit on iOS; this API can be called from shared Kotlin code.

Types

Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
val billingError: StateFlow<PurchasesError?>
Link copied to clipboard
val billingInfo: StateFlow<BillingInfo>
Link copied to clipboard

The RevenueCat app user ID. RevenueCat must be configured before reading this property.

Functions

Link copied to clipboard

Loads the current offering and updates billingInfo and billingError.

Link copied to clipboard
fun isSubscriptionActive(onChecked: (Boolean, String) -> Unit = { _, _ -> })

Checks the configured entitlement without refreshing products.

Link copied to clipboard

Loads the current offering and its entitlement details as a suspendable operation.

Link copied to clipboard
fun purchase(type: Payment.ProductsType, onSuccess: (Boolean, String) -> Unit = { _, _ -> }, onFailure: (PurchasesError, Boolean) -> Unit = { _, _ -> })

Purchases the monthly or annual package currently cached in billingInfo.

Link copied to clipboard

Purchases a package and returns whether its configured entitlement became active.

Link copied to clipboard
fun restorePurchases(onRestored: (Boolean, String) -> Unit = { _, _ -> })

Restores purchases associated with the current App Store or Play Store account.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun upgradeDownGrade(onSuccess: (Boolean, String) -> Unit = { _, _ -> }, onFailure: (PurchasesError, Boolean) -> Unit = { _, _ -> })

Switches between the monthly and annual packages. Play Store replacement settings are ignored by StoreKit; RevenueCat applies the native store's subscription rules on iOS.