# PurchaseClient.Builder

```
public static final class PurchaseClient.Builder
```

```
java.lang.Object
    ↳ com.gaa.sdk.iap.PurchaseClient.Builder
```

<br>

It is a builder for creating the PurchaseClient instances.

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

***

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

```
@UiThread
public PurchaseClient.Builder setBase64PublicKey(String base64PublicKey)
```

Specify the public key issued by Developer Center for checking the validity of purchase information.

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

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

```
@UiThread
public PurchaseClient.Builder setListener( listener)
```

Specify to receive the onPurchasesUpdated event.

| **Parameters:**                   |                                                                                                          |
| --------------------------------- | -------------------------------------------------------------------------------------------------------- |
| listener                          | [PurchasesUpdatedListener](https://dev.onestore.co.kr/wiki/en/doc/purchasesupdatedlistener-5833461.html) |
| **Returns:**                      |                                                                                                          |
| <p>PurchaseClient.Builder<br></p> |                                                                                                          |

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

```
@UiThread
public  build()
```

It creates PurchaseClient instances.

| **Return:**                                                                          |                                               |
| ------------------------------------------------------------------------------------ | --------------------------------------------- |
| [PurchaseClient](https://dev.onestore.co.kr/wiki/en/doc/purchaseclient-5833436.html) |                                               |
| **Throws:**                                                                          |                                               |
| java.lang.IllegalArgumentException                                                   | It occurs if context or listener is abnormal. |


---

# 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/old-version/v19/one-store-iap-reference/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.
