ProductDetails.PricingPhase

public static final class ProductDetails.PricingPhase
extends Object

java.lang.Object
   ↳ com.android.billingclient.api.ProductDetails.PricingPhase
Included in documentation by the annotations: @Annotations.ProductDetails

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

Summary

Public methods

int getBillingCycleCount()

Number of cycles for which the billing period is applied.

String getBillingPeriod()

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

String getFormattedPrice()

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

long getPriceAmountMicros()

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

String getPriceCurrencyCode()

Returns ISO 4217 currency code for price.

int getRecurrenceMode()

Returns ProductDetails.RecurrenceMode for the pricing phase.

Inherited methods

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 ProductDetails.RecurrenceMode.INFINITE_RECURRING and ProductDetails.RecurrenceMode.NON_RECURRING

Returns
int

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.

Returns
String

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.

Returns
String

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.

Returns
long

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".

Returns
String

getRecurrenceMode

public int getRecurrenceMode ()

Returns ProductDetails.RecurrenceMode for the pricing phase.

Returns
int