TestStoreProduct

data class TestStoreProduct(val id: String, val name: String, val title: String, val description: String, val price: Price, val period: Period?, freeTrialPeriod: Period? = null, introPrice: Price? = null) : StoreProduct

A test-only StoreProduct implementation. This can be used to create mock data for tests or Jetpack Compose previews.

Constructors

Link copied to clipboard
constructor(id: String, name: String, title: String, description: String, price: Price, period: Period?, freeTrialPeriod: Period? = null, introPrice: Price? = null)

Functions

Link copied to clipboard
open override fun copyWithPresentedOfferingContext(presentedOfferingContext: PresentedOfferingContext?): StoreProduct

For internal RevenueCat use.

Link copied to clipboard
open fun formattedPricePerMonth(locale: Locale = Locale.getDefault()): String?

Null for INAPP products. The price of the StoreProduct in the given locale in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value.

Link copied to clipboard
open fun pricePerMonth(locale: Locale = Locale.getDefault()): Price?

Null for INAPP products. The price of the StoreProduct in the given locale in a monthly recurrence. This means that, for example, if the period is annual, the price will be divided by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value.

Link copied to clipboard
open fun pricePerWeek(locale: Locale = Locale.getDefault()): Price?

Null for INAPP products. The price of the StoreProduct in the given locale in a weekly recurrence. This means that, for example, if the period is monthly, the price will be divided by 4. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value.

Link copied to clipboard
open fun pricePerYear(locale: Locale = Locale.getDefault()): Price?

Null for INAPP products. The price of the StoreProduct in the given locale in a yearly recurrence. This means that, for example, if the period is monthly, the price will be multiplied by 12. It uses a currency formatter to format the price in the given locale. Note that this value may be an approximation. For Google subscriptions, this value will use the basePlan to calculate the value.

Properties

Link copied to clipboard

StoreProduct object containing Amazon-specific fields: originalProductJson freeTrialPeriod iconUrl

Link copied to clipboard
open override val defaultOption: SubscriptionOption?

The default SubscriptionOption that will be used when purchasing and not specifying a different option. Null for INAPP products.

Link copied to clipboard
open override val description: String

The description of the product.

Link copied to clipboard

StoreProduct object containing Google-specific fields: productId basePlanId productDetails

Link copied to clipboard
open override val id: String

The product ID. Google INAPP: "" Google Sub: "productId:basePlanID" Amazon INAPP: "" Amazon Sub: ""

Link copied to clipboard
open override val name: String

Name of the product.

Link copied to clipboard
open override val period: Period?

Subscription period.

Link copied to clipboard

The context from which this product was obtained.

Link copied to clipboard
open override val price: Price

Price information for a non-subscription product. Base plan price for a Google subscription. Term price for an Amazon subscription. For Google subscriptions, use SubscriptionOption's pricing phases for offer pricing.

Link copied to clipboard
open override val purchasingData: PurchasingData

Contains only data that is required to make the purchase.

Link copied to clipboard
open override val sku: String

The sku of the StoreProduct

Link copied to clipboard

Contains all SubscriptionOptions. Null for Amazon or for INAPP products.

Link copied to clipboard
open override val title: String

Title of the product.

Link copied to clipboard
open override val type: ProductType

Type of product. One of ProductType.