GoogleSubscriptionOption

data class GoogleSubscriptionOption(val productId: String, val basePlanId: String, val offerId: String?, val pricingPhases: List<PricingPhase>, val tags: List<String>, val productDetails: ProductDetails, val offerToken: String, val presentedOfferingIdentifier: String? = null) : SubscriptionOption

Defines an option for purchasing a Google subscription

Constructors

Link copied to clipboard
constructor(productId: String, basePlanId: String, offerId: String?, pricingPhases: List<PricingPhase>, tags: List<String>, productDetails: ProductDetails, offerToken: String, presentedOfferingIdentifier: String? = null)

Properties

Link copied to clipboard

The id of the base plan that this GoogleSubscriptionOption belongs to.

Link copied to clipboard

The subscription period of fullPricePhase (after free and intro trials).

Link copied to clipboard

The free trial PricingPhase of the subscription. Looks for the first pricing phase of the SubscriptionOption where amountMicros is 0. There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.

Link copied to clipboard

The full price PricingPhase of the subscription. Looks for the last price phase of the SubscriptionOption.

Link copied to clipboard
open override val id: String

For Google subscriptions: If this SubscriptionOption represents a base plan, this will be the basePlanId. If it represents an offer, it will be {basePlanId}:{offerId}

Link copied to clipboard

The intro trial PricingPhase of the subscription. Looks for the first pricing phase of the SubscriptionOption where amountMicros is greater than 0. There can be a freeTrialPhase and an introductoryPhase in the same SubscriptionOption.

Link copied to clipboard

True if this SubscriptionOption represents a Google subscription base plan (rather than an offer). Not applicable for Amazon subscriptions.

Link copied to clipboard
open val isPrepaid: Boolean

True if the subscription is pre-paid. Not applicable for Amazon subscriptions.

Link copied to clipboard

If this represents an offer, the offerId set in the Play Console. Null otherwise.

Link copied to clipboard

The token used to purchase this GoogleSubscriptionOption, whether it represents a base plan or an offer.

Link copied to clipboard
open override val presentedOfferingIdentifier: String? = null

The offering ID this GoogleSubscriptionOption was returned from.

Link copied to clipboard
open override val pricingPhases: List<PricingPhase>

Pricing phases defining a user's payment plan for the product over time.

Link copied to clipboard
val productDetails: ProductDetails

The ProductDetails object this GoogleSubscriptionOption was created from. Use to get underlying BillingClient information.

Link copied to clipboard

If this SubscriptionOption represents a base plan, this will be the basePlanId. If it represents an offer, it will be basePlanId:offerId

Link copied to clipboard
open override val purchasingData: PurchasingData
Link copied to clipboard
open override val tags: List<String>

Tags defined on the base plan or offer. Keep in mind that offers automatically inherit their base plan's tag.