# PurchaseFlowParams

`public class PurchaseFlowParams extends Object`\
`java.lang.Object`     \
&#x20;    `↳ com.gaa.sdk.iap.PurchaseFlowParams`\
&#x20;\
用于购买In-App商品的参数。\
**See Also:**\
[PurchaseClient](/dev/chi/tools/billing/v21/references/classes/purchaseclient.md).launchPurchaseFlow(Activity, [PurchaseFlowParams](/dev/chi/tools/billing/v21/references/classes/purchaseflowparams.md))

## Summary <a href="#id-cn-purchaseflowparams-summary" id="id-cn-purchaseflowparams-summary"></a>

***

| **Nested classes** | <p><br></p>                                                                                                                 |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| class              | <p><a href="/pages/sH74S2r0dmvy51IH6Eq5">PurchaseFlowParams.Builder</a><br>是轻松创建PurchaseFlowParams实例（instance）的builder。</p> |

## Public methods <a href="#id-cn-purchaseflowparams-publicmethods" id="id-cn-purchaseflowparams-publicmethods"></a>

***

### getProductId <a href="#id-cn-purchaseflowparams-getproductid" id="id-cn-purchaseflowparams-getproductid"></a>

`String getProductId()`

要购买的In-App商品的ID。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getProductType <a href="#id-cn-purchaseflowparams-getproducttype" id="id-cn-purchaseflowparams-getproducttype"></a>

`String getProductType()`

要购买的In-App商品类型。

| **Returns:** | <p><br></p>                                                                                                   |
| ------------ | ------------------------------------------------------------------------------------------------------------- |
| String       | [PurchaseClient.ProductType](/dev/chi/tools/billing/v21/references/annotations/purchaseclient.producttype.md) |

### getProductName <a href="#id-cn-purchaseflowparams-getproductname" id="id-cn-purchaseflowparams-getproductname"></a>

`String getProductName()`

不是注册商品的名字，而是购买当时显示的商品名字。如果null，已注册的商品名称将在购买页面显示。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getGameUserId <a href="#id-cn-purchaseflowparams-getgameuserid" id="id-cn-purchaseflowparams-getgameuserid"></a>

`String getGameUserId()`

开发公司可以确认的用户ID。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### isPromotionApplicable <a href="#id-cn-purchaseflowparams-ispromotionapplicable" id="id-cn-purchaseflowparams-ispromotionapplicable"></a>

`boolean isPromotionApplicable()`

显示是否可以进行促销。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| boolean      | <p><br></p> |

### getDeveloperPayload <a href="#id-cn-purchaseflowparams-getdeveloperpayload" id="id-cn-purchaseflowparams-getdeveloperpayload"></a>

String getDeveloperPayload()\
返回开发公司指定的payload。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getOldPurchaseToken <a href="#id-cn-purchaseflowparams-getoldpurchasetoken" id="id-cn-purchaseflowparams-getoldpurchasetoken"></a>

`String getOldPurchaseToken()`

要变更的定期支付商品的购买token。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| String       | <p><br></p> |

### getProrationMode() <a href="#id-cn-purchaseflowparams-getprorationmode" id="id-cn-purchaseflowparams-getprorationmode"></a>

`int getProrationMode()`

升级或降级的比例分配模式。

| **Returns:** | <p><br></p>                      |
| ------------ | -------------------------------- |
| int          | PurchaseFlowParams.ProrationMode |

### getQuantity() <a href="#id-cn-purchaseflowparams-getquantity" id="id-cn-purchaseflowparams-getquantity"></a>

`int getQuantity()`

显示商品数量。

| **Returns:** | <p><br></p> |
| ------------ | ----------- |
| int          | <p><br></p> |

### newBuilder <a href="#id-cn-purchaseflowparams-newbuilder" id="id-cn-purchaseflowparams-newbuilder"></a>

[`PurchaseFlowParams.Builder`](/dev/chi/tools/billing/v21/references/classes/purchaseflowparams.builder.md) `newBuilder()`

生成创建PurchaseFlowParams实例（instance）的builder。

| **Returns:**                                                                                              | <p><br></p> |
| --------------------------------------------------------------------------------------------------------- | ----------- |
| [PurchaseFlowParams.Builder](/dev/chi/tools/billing/v21/references/classes/purchaseflowparams.builder.md) | <p><br></p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onestore-dev.gitbook.io/dev/chi/tools/billing/v21/references/classes/purchaseflowparams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
