BillingFlowParams.Builder
public
static
class
BillingFlowParams.Builder
extends Object
java.lang.Object | |
↳ | com.android.billingclient.api.BillingFlowParams.Builder |
Helps to construct BillingFlowParams
that are used to initiate a purchase flow.
Summary
Public methods | |
---|---|
BillingFlowParams.Builder
|
addOldSku(String oldSku)
Add the SKU that the user is upgrading or downgrading from. |
BillingFlowParams
|
build()
Returns |
BillingFlowParams.Builder
|
setAccountId(String accountId)
Specify an optional obfuscated string that is uniquely associated with the user's account in your app. |
BillingFlowParams.Builder
|
setOldSkus(ArrayList<String> oldSkus)
Specify the SKU(s) that the user is upgrading or downgrading from. |
BillingFlowParams.Builder
|
setReplaceSkusProration(boolean bReplaceSkusProration)
Specify an optional flag indicating whether the user should be credited for any unused subscription time on the SKUs they are upgrading or downgrading. |
BillingFlowParams.Builder
|
setSku(String sku)
Specify the SKU that is being purchased or upgraded/downgraded to as published in the Google Developer console. |
BillingFlowParams.Builder
|
setType(String type)
Specify the billing type |
BillingFlowParams.Builder
|
setVrPurchaseFlow(boolean isVrPurchaseFlow)
Specify an optional flag indicating whether you wish to launch a VR purchase flow. |
Inherited methods | |
---|---|
![]()
java.lang.Object
|
Public methods
addOldSku
BillingFlowParams.Builder addOldSku (String oldSku)
Add the SKU that the user is upgrading or downgrading from.
Mandatory:
- To replace an old subscription
Parameters | |
---|---|
oldSku |
String |
Returns | |
---|---|
BillingFlowParams.Builder |
build
BillingFlowParams build ()
Returns BillingFlowParams
reference to initiate a purchase flow.
Returns | |
---|---|
BillingFlowParams |
setAccountId
BillingFlowParams.Builder setAccountId (String accountId)
Specify an optional obfuscated string that is uniquely associated with the user's account in your app.
If you pass this value, Google Play can use it to detect irregular activity, such as many devices making purchases on the same account in a short period of time. Do not use the developer ID or the user's Google ID for this field. In addition, this field should not contain the user's ID in cleartext. We recommend that you use a one-way hash to generate a string from the user's ID and store the hashed string in this field.
Optional:
- To buy in-app item
- To create a new subscription
- To replace an old subscription
Parameters | |
---|---|
accountId |
String |
Returns | |
---|---|
BillingFlowParams.Builder |
setOldSkus
BillingFlowParams.Builder setOldSkus (ArrayList<String> oldSkus)
Specify the SKU(s) that the user is upgrading or downgrading from.
Mandatory:
- To replace an old subscription
Parameters | |
---|---|
oldSkus |
ArrayList |
Returns | |
---|---|
BillingFlowParams.Builder |
setReplaceSkusProration
BillingFlowParams.Builder setReplaceSkusProration (boolean bReplaceSkusProration)
Specify an optional flag indicating whether the user should be credited for any unused subscription time on the SKUs they are upgrading or downgrading.
If you set this field to false, the user does not receive credit for any unused subscription time and the recurrence date does not change. Otherwise, Google Play swaps out the old SKUs and credits the user with the unused value of their subscription time on a pro-rated basis. Google Play applies this credit to the new subscription, and does not begin billing the user for the new subscription until after the credit is used up.
Optional:
- To buy in-app item
- To create a new subscription
- To replace an old subscription
Parameters | |
---|---|
bReplaceSkusProration |
boolean |
Returns | |
---|---|
BillingFlowParams.Builder |
setSku
BillingFlowParams.Builder setSku (String sku)
Specify the SKU that is being purchased or upgraded/downgraded to as published in the Google Developer console.
Mandatory:
- To buy in-app item
- To create a new subscription
- To replace an old subscription
Parameters | |
---|---|
sku |
String |
Returns | |
---|---|
BillingFlowParams.Builder |
setType
BillingFlowParams.Builder setType (String type)
Specify the billing type BillingClient.SkuType
of the item being purchased.
Mandatory:
- To buy in-app item
- To create a new subscription
- To replace an old subscription
Parameters | |
---|---|
type |
String |
Returns | |
---|---|
BillingFlowParams.Builder |
setVrPurchaseFlow
BillingFlowParams.Builder setVrPurchaseFlow (boolean isVrPurchaseFlow)
Specify an optional flag indicating whether you wish to launch a VR purchase flow.
Optional:
- To buy in-app item
- To create a new subscription
- To replace an old subscription
Parameters | |
---|---|
isVrPurchaseFlow |
boolean |
Returns | |
---|---|
BillingFlowParams.Builder |
Annotations
Interfaces
Classes