ProductDetails.PricingPhase

public final class ProductDetails.PricingPhase


Represents a pricing phase, describing how a user pays at a point in time.

Summary

Public methods

int

Number of cycles for which the billing period is applied.

String

Billing period for which the given price applies, specified in ISO 8601 format.

String

Returns formatted price for the payment cycle, including its currency sign.

long

Returns the price for the payment cycle in micro-units, where 1,000,000 micro-units equal one unit of the currency.

String

Returns ISO 4217 currency code for price.

int

Returns RecurrenceMode for the pricing phase.

Public methods

getBillingCycleCount

public int getBillingCycleCount()

Number of cycles for which the billing period is applied.

For example, for formattedPrice $6.99 and billingPeriod P1M, if billingCycleCount is 2, the user will be charged $6.99/month for 2 months.

Note: Set to 0 for RecurrenceMode#INFINITE_RECURRING and NON_RECURRING

getBillingPeriod

public String getBillingPeriod()

Billing period for which the given price applies, specified in ISO 8601 format.

For example, P1W equates to one week, P1M equates to one month, P3M equates to three months, P6M equates to six months, and P1Y equates to one year.

getFormattedPrice

public String getFormattedPrice()

Returns formatted price for the payment cycle, including its currency sign.

For tax exclusive countries, the price doesn't include tax.

getPriceAmountMicros

public long getPriceAmountMicros()

Returns the price for the payment cycle in micro-units, where 1,000,000 micro-units equal one unit of the currency.

For example, if price is "€7.99", price_amount_micros is "7990000". This value represents the localized, rounded price for a particular currency.

getPriceCurrencyCode

public String getPriceCurrencyCode()

Returns ISO 4217 currency code for price.

For example, if price is specified in British pounds sterling, currency code is "GBP".

getRecurrenceMode

public int getRecurrenceMode()

Returns RecurrenceMode for the pricing phase.