> For the complete documentation index, see [llms.txt](https://onestore-dev.gitbook.io/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onestore-dev.gitbook.io/dev/chi/tools/billing/v21/references/classes/iapresult.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
