Builder

class Builder : Optionz.OptionBuilder

Builder for setting customizable options, such as modifying an existing subscription or updating pricing information for a purchase flow. To modify an active subscription, make sure to set the desired proration mode, the purchase token, and the productId of the relevant subscription.

Constructors

Link copied to clipboard
fun Builder()

Functions

Link copied to clipboard
open override fun build(): Bundle

Create Bundle object of order options.

Link copied to clipboard
open override fun setConsumerRegion(region: Optionz.Region): Optionz.Builder

Set the consumer's region of origin for region-specific customization options. Default region is Region.NA.

Link copied to clipboard
open override fun setIsOfferPersonalized(isOfferPersonalized: Boolean): Optionz.Builder

Only for Google Play consumers in the European Union. When true, the Play UI includes the disclosure. When false, the UI omits the disclosure. The default value is false. Or, if setConsumerRegion is not updated to the Region.EU, this value will default to false. You must consult Art. 6 (1) (ea) CRD of the Consumer Rights Directive (2011/83/EU) [https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:02011L0083-20220528] to determine if the price you are offering to users is personalized.

Link copied to clipboard
open override fun setOldPurchaseToken(token: String): Optionz.Builder

Set the purchase token for the subscription to be modified.

Link copied to clipboard
open override fun setOldSubscriptionId(id: String): Optionz.Builder

Set the product id of the subscription to be modified.

Link copied to clipboard
open override fun setProrationMode(mode: Int): Optionz.Builder

Modify the proration settings for subscriptions. Refer to Google's BillingFlowParams.ProrationMode https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.ProrationMode

Link copied to clipboard
open override fun setSelectedOfferIndex(index: Int): Optionz.Builder

Set the index (position) of the relevant Subscription OfferDetails to be purchased.