# ONE Billing Lab Guide

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FgrWwFt44RGDaxwvz3PZR%2Fimage.png?alt=media&#x26;token=403f921b-c653-4932-853e-da913a747b9e" alt=""><figcaption></figcaption></figure>

#### 📌 ONE Billing Lab is a development tool that helps developers check the integration status of in-app payment libraries for each ONE store service country.

* Payment tests can be run by logging in as a user from the desired country without separately installing the ONE store app for each service country.
* Payment flow can tested through ONE Billing Lab's response simulator feature, even without integration with the actual ONE store payment system.

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FkO0FEt2vILV6aOVDLoUn%2Fimage.png?alt=media&#x26;token=75a4e4e6-ba8b-46a9-aaba-23d73e924814" alt=""><figcaption></figcaption></figure>

## **Feature Overview** <a href="#onebillinglab-featureoverview" id="onebillinglab-featureoverview"></a>

**✅ Integrated Test Environment**

* All ONE store environments, including South Korea, Singapore, Taiwan, and the United States, can be tested using a single ONE Billing Lab app.
* An integrated test environment is provided for developers who previously had difficulty testing due to different package names for each store.

**✅ Response Simulator**

* In-app purchase scenarios can be tested without going through the actual payment process.
* It is used to verify payment response behavior in development and QA environments.

**✅ Testing Various Payment Scenarios**

* Various payment-related features, such as subscription management, use authentication, and biometric authentication, can be tested.
  * The subscription management menu is available only when logged in with an account registered in South Korea or the United States.

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2F5qnFuTNOhBFBEVnq89Bn%2Fimage.png?alt=media&#x26;token=05775b10-38a6-4671-b830-37ab71546ee0" alt=""><figcaption></figcaption></figure>

## **How to Test** <a href="#onebillinglab-howtotest" id="onebillinglab-howtotest"></a>

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FYaCnhiGQ53Tff1KFpbdZ%2Fimage.png?alt=media&#x26;token=fb3cbc58-0ef6-45e6-b818-dd30247d6600" alt=""><figcaption></figcaption></figure>

### 1. Install ONE Billing Lab <a href="#onebillinglab-1.installonebillinglab" id="onebillinglab-1.installonebillinglab"></a>

* Download and install ONE Billing Lab from the ONE store app or GitHub.
  * [Install from the ONE store app](https://onesto.re/0001002700)
  * [Install from GitHub](https://github.com/ONE-store/one_billing_lab)

### 2. Create and Log In with a ONE store Account <a href="#onebillinglab-2.createandloginwithaonestoreaccount" id="onebillinglab-2.createandloginwithaonestoreaccount"></a>

* After launching ONE Billing Lab, select the country to be tested, then create or log in with a ONE store account.
  * A ONE Billing Lab member account is identical to a regular ONE store account.
* If you already have a ONE store account, you can immediately move on to Step 3.
* If you don't have an account, membership registration can be completed easily within ONE Billing Lab.

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2F2O0GgUU66HVM8Uo6vAko%2Fimage.png?alt=media&#x26;token=76697376-e8ce-4545-be25-38b3ad66fa84" alt=""><figcaption></figcaption></figure>

### 3. Register a Test ID <a href="#onebillinglab-3.registeratestid" id="onebillinglab-3.registeratestid"></a>

* Register the ONE store account as a payment test ID for the app to be tested in the ONE store Developer Center.
* Payment environment can be selected during registration.
  * Sandbox
  * Commercial
* Note:  [Register test ID](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/test?fallback=true#testpurchasesandsecurity.-registertestid) in the ONE store Developer Center

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2F2hQAt0JuyOgxneTQF1cs%2Fimage.png?alt=media&#x26;token=021e9597-2c3d-4fee-8248-b1332cbd129d" alt=""><figcaption></figcaption></figure>

### 4. App Integration Settings <a href="#onebillinglab-4.appintegrationsettings" id="onebillinglab-4.appintegrationsettings"></a>

* Configure the `AndroidManifest.xml` file of the developer's app that will be used for integration testing.
  * Set the developer option for store selection (the `android:value`  of `onestore:dev_option`) to `onestore_03`

<pre class="language-xml"><code class="lang-xml"><strong>&#x3C;manifest>
</strong>    &#x3C;application>
<strong>        &#x3C;meta-data android:name="onestore:dev_option" android:value="onestore_03" />
</strong>    &#x3C;/application>
&#x3C;/manifest>
</code></pre>

* Note: [Setting Developer Options for Store Selection](https://onestore-dev.gitbook.io/dev/eng/tools/billing/v21/sdk#setting-developer-options-for-store-selection)

### 5. Run Payment Tests <a href="#onebillinglab-5.runpaymenttests" id="onebillinglab-5.runpaymenttests"></a>

* Run the developer’s app and attempt a payment.
* The payment screen is displayed based on the country of the logged-in ONE store account and the payment environment configured in the Developer Center.
* Example\
  : United States member + production payment environment → actual payment screen and payment methods are displayed, and real payments are possible.

<figure><img src="https://2218522982-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgStyyzRzNh9x2u93ZH03%2Fuploads%2FGgXdiyRGkfTzYdGbo77V%2Fimage.png?alt=media&#x26;token=64eb9cae-d4d7-4d0a-82fa-a957d758396d" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
To run a commercial test, you must register the Binary in ONE store Developer Center.
{% endhint %}

| Conditions            | Commercial test (uploadKey) | Commercial test (store signingKey) | Sandbox test |                                              |
| --------------------- | --------------------------- | ---------------------------------- | ------------ | -------------------------------------------- |
| Binary not registered | ✖ Not allowed               | ✖ Not allowed                      | ✔ Allowed    | Only Sandbox available                       |
| Binary registered     | ✔ Allowed                   | ✔ Allowed                          | ✔ Allowed    | All allowed if signature verification passes |

### 6. Check Test History and Cancel Payments

* Test history can be checked in the ONE store Developer Center.
* Payment cancellations can also be processed directly if necessary.<br>
