# PurchaseFlowParams

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

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

***

| **Nested classes** | <p><br></p>                                                                                                                |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| class              | <p><a href="purchaseflowparams.builder">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](../annotations/purchaseclient.producttype) |

### 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`](purchaseflowparams.builder) `newBuilder()`

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

| **Returns:**                                             | <p><br></p> |
| -------------------------------------------------------- | ----------- |
| [PurchaseFlowParams.Builder](purchaseflowparams.builder) | <p><br></p> |

