# PurchaseFlowParams

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

`public class PurchaseFlowParams extends Object`\
`java.lang.Object`     \
&#x20;    `↳ com.gaa.sdk.iap.PurchaseFlowParams`\
&#x20;\
用於購買In-App商品的參數。\
**See Also:**\
[PurchaseClient](/dev/cht/tools/billing/v21/references/classes/purchaseclient.md#id-cn-purchaseclient-purchaseclient).launchPurchaseFlow(Activity, [PurchaseFlowParams](/dev/cht/tools/billing/v21/references/classes/purchaseflowparams.md#id-cn-purchaseflowparams-purchaseflowparams))

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

***

| **Nested classes** | <p><br></p>                                                                                                                                                                             |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| class              | <p><a href="/pages/sH74S2r0dmvy51IH6Eq5#id-cn-purchaseflowparams.builder-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](https://onestore-dev.gitbook.io/dev/cht/tools/billing/v21/references/classes/pages/GzTZSxN4YNICgDrEwrN2#id-cn-purchaseclient.producttype-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:** |   |
| ------------ | - |
| boolean      |   |

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

String getDeveloperPayload() 返回開發公司指定的payload。

| **Returns:** |   |
| ------------ | - |
| String       |   |

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

`String getOldPurchaseToken()`要變更的定期支付商品的購買token。

| **Returns:** |   |
| ------------ | - |
| String       |   |

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

`int getProrationMode()`升级或降级的比例分配模式。

| **Returns:** |                                  |
| ------------ | -------------------------------- |
| int          | PurchaseFlowParams.ProrationMode |

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

`int getQuantity()`顯示商品數量。

| **Returns:** |   |
| ------------ | - |
| int          |   |

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

`PurchaseFlowParams.Builder newBuilder()`生成創建PurchaseFlowParams實例（instance）的builder。

| **Returns:**               |   |
| -------------------------- | - |
| PurchaseFlowParams.Builder |   |

<br>


---

# 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/cht/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.
