PricingPhase

data class PricingPhase(val billingPeriod: Period, val recurrenceMode: RecurrenceMode, val billingCycleCount: Int?, val price: Price) : Parcelable

Encapsulates how a user pays for a subscription at a given point in time.

Constructors

Link copied to clipboard
constructor(billingPeriod: Period, recurrenceMode: RecurrenceMode, billingCycleCount: Int?, price: Price)

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
fun pricePerMonth(locale: Locale = Locale.getDefault()): Price

Gives the price of the PricingPhase 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.

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

Gives the price of the PricingPhase 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.

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

Gives the price of the PricingPhase 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.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)

Properties

Link copied to clipboard

Number of cycles for which the pricing phase applies. Null for INFINITE_RECURRING or NON_RECURRING recurrence modes.

Link copied to clipboard

Billing period for which the PricingPhase applies.

Link copied to clipboard

Indicates how the pricing phase is charged for FINITE_RECURRING pricing phases

Link copied to clipboard