# IapResult

`public final class IapResult extends Object`\
`java.lang.Object`     \
&#x20;    `↳ com.gaa.sdk.iap.IapResult`\
&#x20;\
是包括了In-app Purchase API响应代码和信息的对象。

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

| **Nested classes** | <p><br></p>                                                                                               |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| class              | <p><a href="/pages/lpmRqknMZyEhaHpo8sYS">IapResult.Builder</a><br>是易于创建IapResult实例（instance）的builder。</p> |

## 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的响应代码。

<table data-header-hidden><thead><tr><th></th><th width="290.3333333333333"></th></tr></thead><tbody><tr><td><strong>Returns:</strong></td><td><br></td></tr><tr><td>int</td><td>与<a href="/pages/ffN8NCzx5o6qKXzIdVZC">PurchaseClient.ResponseCode</a>相对应的结果值</td></tr></tbody></table>

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

`String getMessage()`

返回In-app Purchase API响应信息。

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

### 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:** | <p><br></p> |
| ------------ | ----------- |
| boolean      | <p><br></p> |

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

`boolean isFailure()`

显示In-app Purchase API响应代码是否失败。

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

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

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

生成用于创建IapResult实例（instance）的builder。\
&#x20;

| **Returns:**                                                                            | <p><br></p> |
| --------------------------------------------------------------------------------------- | ----------- |
| [IapResult.Builder](/dev/chi/tools/billing/v21/references/classes/iapresult.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/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.
