# IapResult

### IapResult <a href="#id-cn-iapresult-iapresult" id="id-cn-iapresult-iapresult"></a>

`public final class IapResult extends Object java.lang.Object ↳ com.gaa.sdk.iap.IapResult` 是包括了In-app Purchase API回應代碼和資訊的對象。

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

| **Nested classes** |                                                       |
| ------------------ | ----------------------------------------------------- |
| class              | IapResult.Builder 是易於創建IapResult實例（instance）的builder。 |

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

***

#### getResponseCode <a href="#id-cn-iapresult-getresponsecode" id="id-cn-iapresult-getresponsecode"></a>

`int getResponseCode()`返回In-app Purchase API的回應代碼。

| **Returns:** |                                     |
| ------------ | ----------------------------------- |
| int          | 與PurchaseClient.ResponseCode相對應的结果值 |

#### getMessage <a href="#id-cn-iapresult-getmessage" id="id-cn-iapresult-getmessage"></a>

`String getMessage()`返回In-app Purchase API回應資訊。

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

#### isSuccess <a href="#id-cn-iapresult-issuccess" id="id-cn-iapresult-issuccess"></a>

`boolean isSuccess()`顯示In-app Purchase API回應代碼是否成功(PurchaseClient.ResponseCode.RESULT\_OK)。&#x20;

| **Returns:** |   |
| ------------ | - |
| boolean      |   |

#### isFailure <a href="#id-cn-iapresult-isfailure" id="id-cn-iapresult-isfailure"></a>

`boolean isFailure()`顯示In-app Purchase API回應代碼是否失敗。

| **Returns:** |   |
| ------------ | - |
| boolean      |   |

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

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

| **Returns:**      |   |
| ----------------- | - |
| IapResult.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/iapresult.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.
