API reference

ProductDetails Class

Modifiers: final
Represents the details of a one time or subscription product.
The equivalent Google Play Billing Library class can be found at the Android developer documentation for ProductDetails⁠.

Signature

data class ProductDetails(val productId: String, val title: String = "", val name: String = "", val description: String = "", val productType: String, val oneTimePurchaseOfferDetails: ProductDetails.OneTimePurchaseOfferDetails?, var subscriptionOfferDetails: List<ProductDetails.SubscriptionOfferDetails>?)

Constructors

ProductDetails ( evoProduct )
Signature
constructor(evoProduct: Product)
Parameters
evoProduct: Product
Returns
ProductDetails
ProductDetails ( productId , title , name , description , productType , oneTimePurchaseOfferDetails , subscriptionOfferDetails )
Signature
constructor(productId: String, title: String = "", name: String = "", description: String = "", productType: String, oneTimePurchaseOfferDetails: ProductDetails.OneTimePurchaseOfferDetails?, subscriptionOfferDetails: List<ProductDetails.SubscriptionOfferDetails>?)
Parameters
productId: String  The product's Id.
title: String  The title of the product being sold.
name: String  The name of the product being sold.
description: String  The description of the product.
productType: String  The @BillingClient.ProductType of the product
oneTimePurchaseOfferDetails: ProductDetails.OneTimePurchaseOfferDetails?  The offer details of an one-time purchase product.
subscriptionOfferDetails: List?  The available purchase plans to buy a subscription product.
Returns
ProductDetails

Properties

description : String
[Get]
The description of the product.
Signature
val description: String
name : String
[Get]
The name of the product being sold.
Signature
val name: String
oneTimePurchaseOfferDetails : ProductDetails.OneTimePurchaseOfferDetails?
[Get]
The offer details of an one-time purchase product.
Signature
val oneTimePurchaseOfferDetails: ProductDetails.OneTimePurchaseOfferDetails?
productId : String
[Get]
The product's Id.
Signature
val productId: String
productType : String
[Get]
The @BillingClient.ProductType of the product
Signature
val productType: String
subscriptionOfferDetails : List?
[Get][Set]
The available purchase plans to buy a subscription product.
Signature
var subscriptionOfferDetails: List<ProductDetails.SubscriptionOfferDetails>?
title : String
[Get]
The title of the product being sold.
Signature
val title: String

Companion Object

Properties

SUBS_VIRTUAL_SKU_PREFIX : String
[Get]
Signature
const val SUBS_VIRTUAL_SKU_PREFIX: String

Inner Classes

OneTimePurchaseOfferDetails Class

Modifiers: final
Represents the offer details to buy an one-time purchase product.

Signature

data class OneTimePurchaseOfferDetails(val formattedPrice: String, val priceAmountMicros: Long, val priceCurrencyCode: String)

Constructors

OneTimePurchaseOfferDetails ( formattedPrice , priceAmountMicros , priceCurrencyCode )
Signature
constructor(formattedPrice: String, priceAmountMicros: Long, priceCurrencyCode: String)
Parameters
formattedPrice: String  The formatted price for the payment, including its currency sign.
priceAmountMicros: Long  The price for the payment in micro-units, where 1,000,000 micro-units equal one unit of the currency.
priceCurrencyCode: String  ISO 4217 currency code for price.
Returns
ProductDetails.OneTimePurchaseOfferDetails

Properties

formattedPrice : String
[Get]
The formatted price for the payment, including its currency sign.
Signature
val formattedPrice: String
priceAmountMicros : Long
[Get]
The price for the payment in micro-units, where 1,000,000 micro-units equal one unit of the currency.
Signature
val priceAmountMicros: Long
priceCurrencyCode : String
[Get]
ISO 4217 currency code for price.
Signature
val priceCurrencyCode: String

SubscriptionOfferDetails Class

Modifiers: final
Represents the available purchase plans to buy a subscription product.

Signature

data class SubscriptionOfferDetails(val basePlanId: String, val installmentPlanDetails: ProductDetails.InstallmentPlanDetails, val offerId: String?, val offerTags: List<String>, val offerToken: String, val pricingPhases: ProductDetails.PricingPhases)

Constructors

SubscriptionOfferDetails ( basePlanId , installmentPlanDetails , offerId , offerTags , offerToken , pricingPhases )
Signature
constructor(basePlanId: String, installmentPlanDetails: ProductDetails.InstallmentPlanDetails, offerId: String?, offerTags: List<String>, offerToken: String, pricingPhases: ProductDetails.PricingPhases)
Parameters
basePlanId: String  The base plan id associated with the subscription product.
installmentPlanDetails: ProductDetails.InstallmentPlanDetails  The additional details of an installment plan.
offerId: String?  The the offer id associated with the subscription product.
offerTags: List  The offer tags associated with this Subscription Offer.
offerToken: String  The offer token required to pass in launchBillingFlow to purchase the subscription product with these pricing phases.
pricingPhases: ProductDetails.PricingPhases  The pricing phases for the subscription product.
Returns
ProductDetails.SubscriptionOfferDetails

Properties

basePlanId : String
[Get]
The base plan id associated with the subscription product.
Signature
val basePlanId: String
installmentPlanDetails : ProductDetails.InstallmentPlanDetails
[Get]
The additional details of an installment plan.
Signature
val installmentPlanDetails: ProductDetails.InstallmentPlanDetails
offerId : String?
[Get]
The the offer id associated with the subscription product.
Signature
val offerId: String?
offerTags : List
[Get]
The offer tags associated with this Subscription Offer.
Signature
val offerTags: List<String>
offerToken : String
[Get]
The offer token required to pass in launchBillingFlow to purchase the subscription product with these pricing phases.
Signature
val offerToken: String
pricingPhases : ProductDetails.PricingPhases
[Get]
The pricing phases for the subscription product.
Signature
val pricingPhases: ProductDetails.PricingPhases

InstallmentPlanDetails Class

Modifiers: final
Represents additional details of an installment subscription plan.

Signature

data class InstallmentPlanDetails(val installmentPlanCommitmentPaymentsCount: Int, val subsequentInstallmentPlanCommitmentPaymentsCount: Int)

Constructors

InstallmentPlanDetails ( installmentPlanCommitmentPaymentsCount , subsequentInstallmentPlanCommitmentPaymentsCount )
Signature
constructor(installmentPlanCommitmentPaymentsCount: Int, subsequentInstallmentPlanCommitmentPaymentsCount: Int)
Parameters
installmentPlanCommitmentPaymentsCount: Int  The committed payments count after a user signs up for this subscription plan.
subsequentInstallmentPlanCommitmentPaymentsCount: Int  The subsequent committed payments count after this subscription plan renews.
Returns
ProductDetails.InstallmentPlanDetails

Properties

installmentPlanCommitmentPaymentsCount : Int
[Get]
The committed payments count after a user signs up for this subscription plan.
Signature
val installmentPlanCommitmentPaymentsCount: Int
subsequentInstallmentPlanCommitmentPaymentsCount : Int
[Get]
The subsequent committed payments count after this subscription plan renews.
Signature
val subsequentInstallmentPlanCommitmentPaymentsCount: Int

PricingPhases Class

Modifiers: final
Pricing phases for purchasing an item through a offer. Pricing phases contains time ordered list of ProductDetails.PricingPhase.

Signature

data class PricingPhases(val pricingPhaseList: List<ProductDetails.PricingPhase>)

Constructors

PricingPhases ( pricingPhaseList )
Signature
constructor(pricingPhaseList: List<ProductDetails.PricingPhase>)
Parameters
pricingPhaseList: List  The pricing phases as a time ordered list of Pricing phase.
Returns
ProductDetails.PricingPhases

Properties

pricingPhaseList : List
[Get]
The pricing phases as a time ordered list of Pricing phase.
Signature
val pricingPhaseList: List<ProductDetails.PricingPhase>

PricingPhase Class

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

Signature

data class PricingPhase(val billingCycleCount: Int, val billingPeriod: String, val formattedPrice: String, val priceAmountMicros: Long, val priceCurrencyCode: String, val recurrenceMode: Int)

Constructors

PricingPhase ( billingCycleCount , billingPeriod , formattedPrice , priceAmountMicros , priceCurrencyCode , recurrenceMode )
Signature
constructor(billingCycleCount: Int, billingPeriod: String, formattedPrice: String, priceAmountMicros: Long, priceCurrencyCode: String, recurrenceMode: Int)
Parameters
billingCycleCount: Int  Number of cycles for which the billing period is applied.
billingPeriod: String  Billing period for which the given price applies, specified in ISO 8601 format.
formattedPrice: String  The formatted price for the payment cycle, including its currency sign.
priceAmountMicros: Long  The price for the payment cycle in micro-units, where 1,000,000 micro-units equal one unit of the currency.
priceCurrencyCode: String  ISO 4217 currency code for price.
recurrenceMode: Int  The ProductDetails.RecurrenceMode for the pricing phase.
Returns
ProductDetails.PricingPhase

Properties

billingCycleCount : Int
[Get]
Number of cycles for which the billing period is applied.
Signature
val billingCycleCount: Int
billingPeriod : String
[Get]
Billing period for which the given price applies, specified in ISO 8601 format.
Signature
val billingPeriod: String
formattedPrice : String
[Get]
The formatted price for the payment cycle, including its currency sign.
Signature
val formattedPrice: String
priceAmountMicros : Long
[Get]
The price for the payment cycle in micro-units, where 1,000,000 micro-units equal one unit of the currency.
Signature
val priceAmountMicros: Long
priceCurrencyCode : String
[Get]
ISO 4217 currency code for price.
Signature
val priceCurrencyCode: String
recurrenceMode : Int
[Get]
The ProductDetails.RecurrenceMode for the pricing phase.
Signature
val recurrenceMode: Int

Inner Annotation

RecurrenceMode Annotation

Recurrence mode of the pricing phase.

Signature

annotation class RecurrenceMode

Constructors

RecurrenceMode ()
Signature
constructor()
Returns
ProductDetails.RecurrenceMode

Companion Object

Properties
FINITE_RECURRING : Int
[Get]
The billing plan payment recurs for a fixed number of billing period set in billingCycleCount.
Signature
const val FINITE_RECURRING: Int = 2
INFINITE_RECURRING : Int
[Get]
The billing plan payment recurs for infinite billing periods unless cancelled.
Signature
const val INFINITE_RECURRING: Int = 1
NON_RECURRING : Int
[Get]
The billing plan payment is a one time charge that does not repeat.
Signature
const val NON_RECURRING: Int = 3