# PurchaseClient.Builder

public static final class PurchaseClient.Builder\
java.lang.Object    ↳ com.gaa.sdk.iap.PurchaseClient.Builder

\
A builder that helps create a [PurchaseClient](/dev/eng/tools/billing/v21/references/classes/purchaseclient.md) instance easily.

\
Public Methods <a href="#id-en-purchaseclient.builder-publicmethods" id="id-en-purchaseclient.builder-publicmethods"></a>
-------------------------------------------------------------------------------------------------------------------------

***

### setBase64PublicKey <a href="#id-en-purchaseclient.builder-setbase64publickey" id="id-en-purchaseclient.builder-setbase64publickey"></a>

@UiThreadpublic PurchaseClient.Builder setBase64PublicKey(String base64PublicKey)\
Please specify the public key that is issued from the developer center to check the validity of purchase information.

| **Parameters:**        |                        |
| ---------------------- | ---------------------- |
| base64PublicKey        | base64EncodedPublicKey |
| **Returns**            |                        |
| PurchaseClient.Builder | <p><br></p>            |

### setListener <a href="#id-en-purchaseclient.builder-setlistener" id="id-en-purchaseclient.builder-setlistener"></a>

@UiThreadpublic PurchaseClient.Builder setListener(PurchasesUpdatedListener[ ](https://dev.onestore.co.kr/wiki/en/doc/en-purchasesupdatedlistener-38077521.html)listener)\
Please specify to receive onPurchasesUpdated event.

| **Parameters:**        |                                                                                                          |
| ---------------------- | -------------------------------------------------------------------------------------------------------- |
| listener               | [PurchasesUpdatedListener](/dev/eng/tools/billing/v21/references/interfaces/purchasesupdatedlistener.md) |
| **Returns:**           |                                                                                                          |
| PurchaseClient.Builder | <p><br></p>                                                                                              |

### build <a href="#id-en-purchaseclient.builder-build" id="id-en-purchaseclient.builder-build"></a>

@UiThreadpublic PurchaseClient[ ](https://dev.onestore.co.kr/wiki/en/doc/en-purchaseclient-38077503.html)build()\
Creates a PurchaseClient's instance.

| **Return:**                                                                       |                                                  |
| --------------------------------------------------------------------------------- | ------------------------------------------------ |
| [PurchaseClient](/dev/eng/tools/billing/v21/references/classes/purchaseclient.md) | <p><br></p>                                      |
| **Throws:**                                                                       |                                                  |
| java.lang.IllegalArgumentException                                                | Occurs if the context or listener is not normal. |


---

# 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/eng/tools/billing/v21/references/classes/purchaseclient.builder.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.
