# \[Unity Plugin] Upgrade ONE store IAP

### **Compare Import Unity Package**  <a href="#id-unityplugin-upgradeonestoreiap-compareimportunitypackage" id="id-unityplugin-upgradeonestoreiap-compareimportunitypackage"></a>

| <p><br></p>                    | SDK V17                         | SDK V19               |
| ------------------------------ | ------------------------------- | --------------------- |
| <p>PURCHASE<br><br></p>        | Onestore\_IapCallbackManager.cs | GaaCallbackManager.cs |
| Onestore\_IapCallManager.cs    | GaaCallManager.cs               |                       |
| Onestore\_IapResultListener.cs | GaaIapResultListener.cs         |                       |
| Onestore\_PurchaseResponse.cs  | GaaPurchaseResponse.cs          |                       |
| UTIL                           | AndroidNative.cs                | AndroidNative.cs      |
| UI                             | Onestore\_IapUi.cs              | MainUIScript.cs       |
| <p><br></p>                    | LogScript.cs                    |                       |
| <p><br></p>                    | LoadingScript.cs                |                       |
| JSON                           | <p><br></p>                     | global-appstores.json |

<br>

### **Compare IapCallManager API**  <a href="#id-unityplugin-upgradeonestoreiap-compareiapcallmanagerapi" id="id-unityplugin-upgradeonestoreiap-compareiapcallmanagerapi"></a>

| <p><br></p>                                                                              | <p>v17<br>Onestore\_IapCallManager.cs</p> | <p>v19<br>GaaIapCallManager.cs</p> |
| ---------------------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------- |
| <p>Connect to billing module<br><br></p>                                                 | connect                                   | StartConnection                    |
| Disconnect with billing module                                                           | terminate                                 | EndConnection                      |
| Check support status                                                                     | isBillingSupported                        | x                                  |
| Purchase in-app                                                                          | launchPurchaseFlowAsync                   | LaunchPurchaseFlow                 |
| Consume in-app                                                                           | consume                                   | Consume                            |
| Acknowledge in-app purchase                                                              | x                                         | Acknowledge                        |
| <p>Purchase history of unconsumed in-app</p><p>(including monthly automatic payment)</p> | getPurchases                              | QueryPurchases                     |
| In-app product details                                                                   | getProductDetails                         | QueryProductDetails                |
| Change monthly automatic payment status                                                  | manageRecurringAuto                       | ManageRecurringProduct             |
| Update or install billing module                                                         | x                                         | LaunchUpdateOrInstallFlow          |
| Call ONE store login                                                                     | login                                     | LaunchLoginFlow                    |
| Check market identification code                                                         | x                                         | GetStoreInfo                       |

<br>

### **Initialize & connect ONE store IAP**  <a href="#id-unityplugin-upgradeonestoreiap-initialize-and-connectonestoreiap" id="id-unityplugin-upgradeonestoreiap-initialize-and-connectonestoreiap"></a>

In v19 SDK and above, you can determine whether it is a success or failure with the value of IapResult.code.

The way to connect to the billing module is the same.

<br>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `connectService (){    var base64EncodedPublicKey = "MIGfMA0GCSqGSIb3D....";    IapCallManager.connectService (base64EncodedPublicKey);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**After**

| `// MainUIScript.cspublic` `void` `StartConnection(){    if` `(GaaIapCallManager.IsServiceAvailable() == false)    {        GaaIapCallManager.StartConnection( /* your public key */` `);    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

The response to the successful or failed connection has significantly changed.

In SDK V17, you had to confirm the support status through isBillingSupported() after the successful connection.

However, in SDK V19 and above, you do not need to check the support status. Inside the SDK, the support status will be automatically checked.

To check the value of IapResult.code, refer to PurchaseResponse.ResponseCode.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<string> serviceConnectionEvent;public` `void` `ServiceConnectionListener (string` `callback){    if` `(callback.Contains (preDefinedStrings [CBType.Connected])) {        serviceAvailableEvent ();    }    serviceConnectionEvent (callback);}` `// Onestore_IapResultListener.cs (C#)Onestore_IapCallbackManager.serviceConnectionEvent += serviceConnectionResult;void` `serviceConnectionResult (string` `result){    AndroidNative.showMessage ("serivce connect", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**After**

| `// GaaIapResultListener.csGaaIapCallbackManager.PurchaseClientStateEvent += PurchaseClientStateEvent;void` `PurchaseClientStateEvent(IapResult iapResult){    if` `(iapResult.IsSuccess())    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_UPDATE)    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_LOGIN)    {        ...    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Check in-app product details** <a href="#id-unityplugin-upgradeonestoreiap-checkin-appproductdetails" id="id-unityplugin-upgradeonestoreiap-checkin-appproductdetails"></a>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `getProductDetails (){    var inapp_products = new` `string[] {inapp_pId1, inapp_pId2, inapp_pId3};    var auto_products = new` `string[] {auto_pId1};` `IapCallManager.getProductDetails (inapp_products, inapp_type);    IapCallManager.getProductDetails (auto_products, auto_type);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

Specify the array value of the in-app ID (productid) and the corresponding in-app type. There are two types of in-app: Managed product (ProductType.INAPP) and Monthly auto-renewal product (ProductType.AUTO). Enter ProductType.ALL to check both types of in-app.

**After**

| `// MainUIScript.cs// 상품 상세 정보를 조회한다.string[] all_products = { inapp_p5000, inapp_p10000, inapp_p50000, auto_a100000 };GaaIapCallManager.QueryProductDetails(all_products, ProductType.ALL);` `or` `string[] inapp_products = new` `string[] {inapp_p5000, inapp_p10000, inapp_p50000};string[] auto_products = new` `string[] {auto_a100000};` `GaaIapCallManager.QueryProductDetails(inapp_products, ProductType.INAPP);GaaIapCallManager.QueryProductDetails(auto_products, ProductType.AUTO);` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

You can receive the response result value of checking the in-app product details through ProductDetailsSuccessEvent(), ProductDetailsErrorEvent() of GaaIapResultListener.

The communication between Android and Unity is string communication. There is a limit in the string length to be sent at once, and therefore the result value will be transmitted per in-app at a time.

Therefore, the value of ProductDetailsSuccessEvent(..., ..., int count, int totalCount) is important.

<br>

ex) If there is one in-app: count = 1, totalCount = 1 /

if there are 10 in-apps: count = 1, totalCount = 10 ... count = 10, totalCount = 10

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<ProductDetail> queryProductsSuccessEvent;public` `static` `event` `Action<string> queryProductsErrorEvent;` `public` `void` `QueryProductsListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);    if` `(data.Length > 0) {        ProductDetail productDetail = JsonUtility.FromJson<ProductDetail> (data);        queryProductsSuccessEvent (productDetail);    } else` `{        string` `errorData = findStringAfterCBType (callback, CBType.Error);        queryProductsErrorEvent (errorData);    }}`  `// Onestore_IapResultListener.cs (C#)void` `queryProductsSuccessEvent (ProductDetail result){    AndroidNative.showMessage ("queryProducts success", result.ToString (), "ok");}` `void` `queryProductsErrorEvent (string` `result) {    AndroidNative.showMessage ("queryProducts error", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// GaaIapResultListener.csList<ProductDetail> products = new` `List<ProductDetail>();void` `ProductDetailsSuccessEvent(ProductDetail productDetail, int` `count, int` `totalCount){    if` `(count == 1)    {        products.Clear();    }` `products.Add(productDetail);` `if` `(count == totalCount)    {        // send ProductDetail List to UI    }}` `void` `ProductDetailsErrorEvent(IapResult iapResult){    if` `(iapResult.code == ResponseCode.RESULT_NEED_UPDATE)    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_LOGIN)    {        ...    }}` |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Request purchase**  <a href="#id-unityplugin-upgradeonestoreiap-requestpurchase" id="id-unityplugin-upgradeonestoreiap-requestpurchase"></a>

To purchase the in-app, changes have been made in putting productId, productType obtained with QueryProductDetails into the PurchaseFlowParams object and sending it.

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `buyProductInapp (){    //Up to 100 bytes are permitted for developPayload in size.    IapCallManager.buyProduct (inapp_pId1,  inapp_type, devPayload);}` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csvoid` `BuyProduct(string` `productId, string` `type){    PurchaseFlowParams param = new` `PurchaseFlowParams();    param.productId = productId;    param.productType = type;    //param.productName = "";    //param.devPayload = "your Developer Payload"; // Up to 200 bytes are permitted for developPayload in size.    //param.gameUserId = "";    //param.promotionApplicable = false;` `GaaIapCallManager.LaunchPurchaseFlow(param);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

If you call the LaunchPurchaseFlow() method, ONE store billing screen will appear.

**Fig.1** ONE store in-app billing screen

For the same reason as ‘Check in-app product information’, count, totalCount exist in the part in which the response result to payment has been received.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<PurchaseData> getPurchaseIntentSuccessEvent;public` `static` `event` `Action<string> getPurchaseIntentErrorEvent;` `public` `void` `PurchaseFlowListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);` `if` `(data.Length > 0) {        try` `{            PurchaseResponse purchaseRes = JsonUtility.FromJson<PurchaseResponse> (data);            PurchaseData purchaseData = JsonUtility.FromJson<PurchaseData>  (purchaseRes.purchaseData);            getPurchaseIntentSuccessEvent (purchaseData);        } catch` `(System.Exception ex) {            Debug.Log ("PurchaseFlowListener Exception "` `+ ex.Message);        }    } else` `{        //onError만 뒤에 추가데이터 IapResult 가 있으므로 추가 데이터만 전달해주고 나머지 에러들은 추가 데이터가 없으므로 callback 그대로만 전달해준다.        string` `errorData = findStringAfterCBType (callback, CBType.Error);        if` `(errorData.Length > 0) {            getPurchaseIntentErrorEvent (errorData);        } else` `{            getPurchaseIntentErrorEvent (callback);        }    }}`  `// Onestore_IapResultListener.cs (C#)void` `getPurchaseIntentSuccessResult (PurchaseData result){    AndroidNative.showMessage ("getPurchaseIntent sucess",  result.ToString (), "ok");    PlayerPrefs.SetString (result.productId, JsonUtility.ToJson  (result));}` `void` `getPurchaseIntentErrorResult (string` `result){    AndroidNative.showMessage ("getPurchaseIntent error", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// GaaIapResultListener.csprivate` `List<PurchaseData> purchases = new` `List<PurchaseData>();private` `List<string> signatures = new` `List<string>();`   `void` `PurchaseUpdatedSuccessEvent(PurchaseData purchaseData, string` `signature, int` `count, int` `totalCount){    if` `(purchaseData != null) {        if` `(count == 1)        {            purchases.Clear();            signatures.Clear();        }` `purchases.Add(purchaseData);        signatures.Add(signature);` `if` `(count == totalCount)        {            OnPurchaseUpdatedResponse(purchases, signatures); // send to ui        }    }    else    {        // no PurchaseData    }}` `void` `PurchaseUpdatedErrorEvent(IapResult iapResult){    ...}` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Acknowledge purchase**  <a href="#id-unityplugin-upgradeonestoreiap-acknowledgepurchase" id="id-unityplugin-upgradeonestoreiap-acknowledgepurchase"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

### **Consume Managed product** <a href="#id-unityplugin-upgradeonestoreiap-consumemanagedproduct" id="id-unityplugin-upgradeonestoreiap-consumemanagedproduct"></a>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `consume (){    string` `inapp_json = PlayerPrefs.GetString  (inapp_pId1);` `if` `(inapp_json.Length > 0) {        IapCallManager.consume (inapp_json);    } else` `{        AndroidNative.showMessage ("error", "no  data to consume", "ok");    }}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csPurchaseData purchaseData = ...GaaIapCallManager.Consume(purchaseData, "your developer payload");` |
| --------------------------------------------------------------------------------------------------------------------- |

### **Check purchase history** <a href="#id-unityplugin-upgradeonestoreiap-checkpurchasehistory" id="id-unityplugin-upgradeonestoreiap-checkpurchasehistory"></a>

There is no significant change in the request for check purchase hitsory.&#x20;

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `getPurchases (){    Onestore_IapCallManager.getPurchases ();}`  `// Onestore_IapCallMnager.cs (C#)//inapp과 auto 두 가지 상품 타입이 존재하는데 각각 상품에 대해서 각각 따로 호출해야 합니다.  개발사에서 변경 가능한 부분public` `static` `void` `getPurchases (){    checkServiceAvailable ();    iapRequestAdapter.Call ("getPurchase", IAP_API_VERSION, "inapp");    iapRequestAdapter.Call ("getPurchase", IAP_API_VERSION, "auto");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csGaaIapCallManager.QueryPurchases(ProductType.INAPP);GaaIapCallManager.QueryPurchases(ProductType.AUTO);` |
| --------------------------------------------------------------------------------------------------------------------------- |

The following is the response part and is transmitted the same as the response for ‘Request purchase’.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<PurchaseData> getPurchaseSuccessEvent;public` `static` `event` `Action<string> getPurchaseErrorEvent;` `public` `void` `QueryPurchaseListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);    if` `(data.Length > 0) {        try` `{            PurchaseResponse purchaseRes = JsonUtility.FromJson<PurchaseResponse> (data);            PurchaseData purchaseData = JsonUtility.FromJson<PurchaseData> (purchaseRes.purchaseData);            getPurchaseSuccessEvent (purchaseData);        } catch` `(System.Exception ex) {            Debug.Log ("QueryPurchaseListener Exception "` `+ ex.Message);            getPurchaseErrorEvent (data); //success but no data        }    } else` `{        //onError만 뒤에 추가데이터 IapResult 가 있으므로 추가 데이터만 전달해주고 나머지 에러들은 추가 데이터가 없으므로 callback 그대로만 전달해줍니다.        string` `errorData = findStringAfterCBType (callback, CBType.Error);        if` `(errorData.Length > 0) {            getPurchaseErrorEvent (errorData);        } else` `{            getPurchaseErrorEvent (callback);        }    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

<br>

**After**

| `// GaaIapResultListener.csvoid` `QueryPurchasesSuccessEvent(PurchaseData purchaseData, string` `signature, int` `count, int` `totalCount)` `void` `QueryPurchasesErrorEvent(IapResult iapResult)` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Change Monthly auto-renewal product status**  <a href="#id-unityplugin-upgradeonestoreiap-changemonthlyauto-renewalproductstatus" id="id-unityplugin-upgradeonestoreiap-changemonthlyauto-renewalproductstatus"></a>

In SDK V17, the developer had to decide recurringState in person and to send the command value, however, in SDK V19, if PurchaseData is entered, the SDK determines and transfers the command value.

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `cancelAutoItem (){    string` `auto_json = PlayerPrefs.GetString (auto_pId1);    PurchaseData response = JsonUtility.FromJson<PurchaseData> (auto_json);` `if` `(auto_json.Length > 0) {        string` `command = "";        if` `(response.recurringState == 0) {            command = "cancel";        } else` `if` `(response.recurringState == 1) {            command = "reactivate";        }        IapCallManager.manageRecurringAuto (auto_json, command);    } else` `{        AndroidNative.showMessage ("Warning!!", "no data for manageRecurringAuto", "ok");    }}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csPurchaseData purchaseData = ...string` `recurringAction;if` `(purchaseData.recurringState == RecurringState.RECURRING) {    recurringAction = RecurringAction.CANCEL;} else` `if` `(purchaseData.recurringState == RecurringState.CANCEL) {    recurringAction = RecurringAction.REACTIVATE;}GaaIapCallManager.ManageRecurringProduct(purchaseData, recurringAction);` |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Request ONE store login**  <a href="#id-unityplugin-upgradeonestoreiap-requestonestorelogin" id="id-unityplugin-upgradeonestoreiap-requestonestorelogin"></a>

**Before**

| `// Onestore_IapUi.cs (C#)IapCallManager.login();`  `// Onestore_IapResultListener.cs (C#)void` `getLoginIntentEvent (string` `result){    AndroidNative.showMessage ("getLoginIntent ", result.ToString (), "ok");}` |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csGaaIapCallManager.LaunchLoginFlow();` `// GaaIapResultListener.csvoid` `LoginFlowEvent(IapResult iapResult){    if` `(iapResult.IsSuccess()) {        // You need to specify the scenario after successful login.    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Install ONE store service (OSS)**  <a href="#id-unityplugin-upgradeonestoreiap-installonestoreservice-oss" id="id-unityplugin-upgradeonestoreiap-installonestoreservice-oss"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

<br>

<br>

### **Obtain store identification code**  <a href="#id-unityplugin-upgradeonestoreiap-obtainstoreidentificationcode" id="id-unityplugin-upgradeonestoreiap-obtainstoreidentificationcode"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

<br>

<br>

* [Compare Import Unity Package](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-CompareImportUnityPackage)
* [Compare IapCallManager API](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-CompareIapCallManagerAPI)
* [Initialize & connect ONE store IAP](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Initialize\&connectONEstoreIAP)
* [Check in-app product details](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Checkin-appproductdetails)
* [Request purchase](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Requestpurchase)
* [Acknowledge purchase ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Acknowledgepurchase)
* [Consume Managed product](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-ConsumeManagedproduct)
* [Check purchase history](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Checkpurchasehistory)
* [Change Monthly auto-renewal product status ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-ChangeMonthlyauto-renewalproductstatus)
* [Request ONE store login ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-RequestONEstorelogin)
* [Install ONE store service (OSS)](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-InstallONEstoreservice\(OSS\))
* [Obtain store identification code](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Obtainstoreidentificationcode)
* [Compare Import Unity Package](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-CompareImportUnityPackage.1)
* [Compare IapCallManager API](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-CompareIapCallManagerAPI.1)
* [Initialize & connect ONE store IAP](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Initialize\&connectONEstoreIAP.1)
* [Check in-app product details](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Checkin-appproductdetails.1)
* [Request purchase](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Requestpurchase.1)
* [Acknowledge purchase ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Acknowledgepurchase.1)
* [Consume Managed product](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-ConsumeManagedproduct.1)
* [Check purchase history](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Checkpurchasehistory.1)
* [Change Monthly auto-renewal product status ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-ChangeMonthlyauto-renewalproductstatus.1)
* [Request ONE store login ](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-RequestONEstorelogin.1)
* [Install ONE store service (OSS)](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-InstallONEstoreservice\(OSS\).1)
* [Obtain store identification code](https://dev.onestore.co.kr/wiki/en/doc/unity-plugin-upgrade-one-store-iap-5833099.html#id-\[UnityPlugin]UpgradeONEstoreIAP-Obtainstoreidentificationcode.1)

### **Compare Import Unity Package**  <a href="#id-unityplugin-upgradeonestoreiap-compareimportunitypackage.1" id="id-unityplugin-upgradeonestoreiap-compareimportunitypackage.1"></a>

| <p><br></p>                    | SDK V17                         | SDK V19               |
| ------------------------------ | ------------------------------- | --------------------- |
| <p>PURCHASE<br><br></p>        | Onestore\_IapCallbackManager.cs | GaaCallbackManager.cs |
| Onestore\_IapCallManager.cs    | GaaCallManager.cs               |                       |
| Onestore\_IapResultListener.cs | GaaIapResultListener.cs         |                       |
| Onestore\_PurchaseResponse.cs  | GaaPurchaseResponse.cs          |                       |
| UTIL                           | AndroidNative.cs                | AndroidNative.cs      |
| UI                             | Onestore\_IapUi.cs              | MainUIScript.cs       |
| <p><br></p>                    | LogScript.cs                    |                       |
| <p><br></p>                    | LoadingScript.cs                |                       |
| JSON                           | <p><br></p>                     | global-appstores.json |

<br>

### **Compare IapCallManager API**  <a href="#id-unityplugin-upgradeonestoreiap-compareiapcallmanagerapi.1" id="id-unityplugin-upgradeonestoreiap-compareiapcallmanagerapi.1"></a>

| <p><br></p>                                                                              | <p>v17<br>Onestore\_IapCallManager.cs</p> | <p>v19<br>GaaIapCallManager.cs</p> |
| ---------------------------------------------------------------------------------------- | ----------------------------------------- | ---------------------------------- |
| <p>Connect to billing module<br><br></p>                                                 | connect                                   | StartConnection                    |
| Disconnect with billing module                                                           | terminate                                 | EndConnection                      |
| Check support status                                                                     | isBillingSupported                        | x                                  |
| Purchase in-app                                                                          | launchPurchaseFlowAsync                   | LaunchPurchaseFlow                 |
| Consume in-app                                                                           | consume                                   | Consume                            |
| Acknowledge in-app purchase                                                              | x                                         | Acknowledge                        |
| <p>Purchase history of unconsumed in-app</p><p>(including monthly automatic payment)</p> | getPurchases                              | QueryPurchases                     |
| In-app product details                                                                   | getProductDetails                         | QueryProductDetails                |
| Change monthly automatic payment status                                                  | manageRecurringAuto                       | ManageRecurringProduct             |
| Update or install billing module                                                         | x                                         | LaunchUpdateOrInstallFlow          |
| Call ONE store login                                                                     | login                                     | LaunchLoginFlow                    |
| Check market identification code                                                         | x                                         | GetStoreInfo                       |

<br>

### **Initialize & connect ONE store IAP**  <a href="#id-unityplugin-upgradeonestoreiap-initialize-and-connectonestoreiap.1" id="id-unityplugin-upgradeonestoreiap-initialize-and-connectonestoreiap.1"></a>

In v19 SDK and above, you can determine whether it is a success or failure with the value of IapResult.code.

The way to connect to the billing module is the same.

<br>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `connectService (){    var base64EncodedPublicKey = "MIGfMA0GCSqGSIb3D....";    IapCallManager.connectService (base64EncodedPublicKey);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**After**

| `// MainUIScript.cspublic` `void` `StartConnection(){    if` `(GaaIapCallManager.IsServiceAvailable() == false)    {        GaaIapCallManager.StartConnection( /* your public key */` `);    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

The response to the successful or failed connection has significantly changed.

In SDK V17, you had to confirm the support status through isBillingSupported() after the successful connection.

However, in SDK V19 and above, you do not need to check the support status. Inside the SDK, the support status will be automatically checked.

To check the value of IapResult.code, refer to PurchaseResponse.ResponseCode.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<string> serviceConnectionEvent;public` `void` `ServiceConnectionListener (string` `callback){    if` `(callback.Contains (preDefinedStrings [CBType.Connected])) {        serviceAvailableEvent ();    }    serviceConnectionEvent (callback);}` `// Onestore_IapResultListener.cs (C#)Onestore_IapCallbackManager.serviceConnectionEvent += serviceConnectionResult;void` `serviceConnectionResult (string` `result){    AndroidNative.showMessage ("serivce connect", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

**After**

| `// GaaIapResultListener.csGaaIapCallbackManager.PurchaseClientStateEvent += PurchaseClientStateEvent;void` `PurchaseClientStateEvent(IapResult iapResult){    if` `(iapResult.IsSuccess())    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_UPDATE)    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_LOGIN)    {        ...    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Check in-app product details** <a href="#id-unityplugin-upgradeonestoreiap-checkin-appproductdetails.1" id="id-unityplugin-upgradeonestoreiap-checkin-appproductdetails.1"></a>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `getProductDetails (){    var inapp_products = new` `string[] {inapp_pId1, inapp_pId2, inapp_pId3};    var auto_products = new` `string[] {auto_pId1};` `IapCallManager.getProductDetails (inapp_products, inapp_type);    IapCallManager.getProductDetails (auto_products, auto_type);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

Specify the array value of the in-app ID (productid) and the corresponding in-app type. There are two types of in-app: Managed product (ProductType.INAPP) and Monthly auto-renewal product (ProductType.AUTO). Enter ProductType.ALL to check both types of in-app.

**After**

| `// MainUIScript.cs// 상품 상세 정보를 조회한다.string[] all_products = { inapp_p5000, inapp_p10000, inapp_p50000, auto_a100000 };GaaIapCallManager.QueryProductDetails(all_products, ProductType.ALL);` `or` `string[] inapp_products = new` `string[] {inapp_p5000, inapp_p10000, inapp_p50000};string[] auto_products = new` `string[] {auto_a100000};` `GaaIapCallManager.QueryProductDetails(inapp_products, ProductType.INAPP);GaaIapCallManager.QueryProductDetails(auto_products, ProductType.AUTO);` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

You can receive the response result value of checking the in-app product details through ProductDetailsSuccessEvent(), ProductDetailsErrorEvent() of GaaIapResultListener.

The communication between Android and Unity is string communication. There is a limit in the string length to be sent at once, and therefore the result value will be transmitted per in-app at a time.

Therefore, the value of ProductDetailsSuccessEvent(..., ..., int count, int totalCount) is important.

<br>

ex) If there is one in-app: count = 1, totalCount = 1 /

if there are 10 in-apps: count = 1, totalCount = 10 ... count = 10, totalCount = 10

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<ProductDetail> queryProductsSuccessEvent;public` `static` `event` `Action<string> queryProductsErrorEvent;` `public` `void` `QueryProductsListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);    if` `(data.Length > 0) {        ProductDetail productDetail = JsonUtility.FromJson<ProductDetail> (data);        queryProductsSuccessEvent (productDetail);    } else` `{        string` `errorData = findStringAfterCBType (callback, CBType.Error);        queryProductsErrorEvent (errorData);    }}`  `// Onestore_IapResultListener.cs (C#)void` `queryProductsSuccessEvent (ProductDetail result){    AndroidNative.showMessage ("queryProducts success", result.ToString (), "ok");}` `void` `queryProductsErrorEvent (string` `result) {    AndroidNative.showMessage ("queryProducts error", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// GaaIapResultListener.csList<ProductDetail> products = new` `List<ProductDetail>();void` `ProductDetailsSuccessEvent(ProductDetail productDetail, int` `count, int` `totalCount){    if` `(count == 1)    {        products.Clear();    }` `products.Add(productDetail);` `if` `(count == totalCount)    {        // send ProductDetail List to UI    }}` `void` `ProductDetailsErrorEvent(IapResult iapResult){    if` `(iapResult.code == ResponseCode.RESULT_NEED_UPDATE)    {        ...    }    else` `if` `(iapResult.code == ResponseCode.RESULT_NEED_LOGIN)    {        ...    }}` |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Request purchase**  <a href="#id-unityplugin-upgradeonestoreiap-requestpurchase.1" id="id-unityplugin-upgradeonestoreiap-requestpurchase.1"></a>

To purchase the in-app, changes have been made in putting productId, productType obtained with QueryProductDetails into the PurchaseFlowParams object and sending it.

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `buyProductInapp (){    //Up to 100 bytes are permitted for developPayload in size.    IapCallManager.buyProduct (inapp_pId1,  inapp_type, devPayload);}` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csvoid` `BuyProduct(string` `productId, string` `type){    PurchaseFlowParams param = new` `PurchaseFlowParams();    param.productId = productId;    param.productType = type;    //param.productName = "";    //param.devPayload = "your Developer Payload"; // Up to 200 bytes are permitted for developPayload in size.    //param.gameUserId = "";    //param.promotionApplicable = false;` `GaaIapCallManager.LaunchPurchaseFlow(param);}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

If you call the LaunchPurchaseFlow() method, ONE store billing screen will appear.

![](http://172.21.139.61:8090/wiki/ko/download/attachments/8291149/image2020-8-4_16-5-51.png?version=1\&modificationDate=1596526261000\&api=v2)

**Fig.1** ONE store in-app billing screen

For the same reason as ‘Check in-app product information’, count, totalCount exist in the part in which the response result to payment has been received.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<PurchaseData> getPurchaseIntentSuccessEvent;public` `static` `event` `Action<string> getPurchaseIntentErrorEvent;` `public` `void` `PurchaseFlowListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);` `if` `(data.Length > 0) {        try` `{            PurchaseResponse purchaseRes = JsonUtility.FromJson<PurchaseResponse> (data);            PurchaseData purchaseData = JsonUtility.FromJson<PurchaseData>  (purchaseRes.purchaseData);            getPurchaseIntentSuccessEvent (purchaseData);        } catch` `(System.Exception ex) {            Debug.Log ("PurchaseFlowListener Exception "` `+ ex.Message);        }    } else` `{        //onError만 뒤에 추가데이터 IapResult 가 있으므로 추가 데이터만 전달해주고 나머지 에러들은 추가 데이터가 없으므로 callback 그대로만 전달해준다.        string` `errorData = findStringAfterCBType (callback, CBType.Error);        if` `(errorData.Length > 0) {            getPurchaseIntentErrorEvent (errorData);        } else` `{            getPurchaseIntentErrorEvent (callback);        }    }}`  `// Onestore_IapResultListener.cs (C#)void` `getPurchaseIntentSuccessResult (PurchaseData result){    AndroidNative.showMessage ("getPurchaseIntent sucess",  result.ToString (), "ok");    PlayerPrefs.SetString (result.productId, JsonUtility.ToJson  (result));}` `void` `getPurchaseIntentErrorResult (string` `result){    AndroidNative.showMessage ("getPurchaseIntent error", result, "ok");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// GaaIapResultListener.csprivate` `List<PurchaseData> purchases = new` `List<PurchaseData>();private` `List<string> signatures = new` `List<string>();`   `void` `PurchaseUpdatedSuccessEvent(PurchaseData purchaseData, string` `signature, int` `count, int` `totalCount){    if` `(purchaseData != null) {        if` `(count == 1)        {            purchases.Clear();            signatures.Clear();        }` `purchases.Add(purchaseData);        signatures.Add(signature);` `if` `(count == totalCount)        {            OnPurchaseUpdatedResponse(purchases, signatures); // send to ui        }    }    else    {        // no PurchaseData    }}` `void` `PurchaseUpdatedErrorEvent(IapResult iapResult){    ...}` |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Acknowledge purchase**  <a href="#id-unityplugin-upgradeonestoreiap-acknowledgepurchase.1" id="id-unityplugin-upgradeonestoreiap-acknowledgepurchase.1"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

### **Consume Managed product** <a href="#id-unityplugin-upgradeonestoreiap-consumemanagedproduct.1" id="id-unityplugin-upgradeonestoreiap-consumemanagedproduct.1"></a>

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `consume (){    string` `inapp_json = PlayerPrefs.GetString  (inapp_pId1);` `if` `(inapp_json.Length > 0) {        IapCallManager.consume (inapp_json);    } else` `{        AndroidNative.showMessage ("error", "no  data to consume", "ok");    }}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csPurchaseData purchaseData = ...GaaIapCallManager.Consume(purchaseData, "your developer payload");` |
| --------------------------------------------------------------------------------------------------------------------- |

### **Check purchase history** <a href="#id-unityplugin-upgradeonestoreiap-checkpurchasehistory.1" id="id-unityplugin-upgradeonestoreiap-checkpurchasehistory.1"></a>

There is no significant change in the request for check purchase hitsory.&#x20;

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `getPurchases (){    Onestore_IapCallManager.getPurchases ();}`  `// Onestore_IapCallMnager.cs (C#)//inapp과 auto 두 가지 상품 타입이 존재하는데 각각 상품에 대해서 각각 따로 호출해야 합니다.  개발사에서 변경 가능한 부분public` `static` `void` `getPurchases (){    checkServiceAvailable ();    iapRequestAdapter.Call ("getPurchase", IAP_API_VERSION, "inapp");    iapRequestAdapter.Call ("getPurchase", IAP_API_VERSION, "auto");}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csGaaIapCallManager.QueryPurchases(ProductType.INAPP);GaaIapCallManager.QueryPurchases(ProductType.AUTO);` |
| --------------------------------------------------------------------------------------------------------------------------- |

The following is the response part and is transmitted the same as the response for ‘Request purchase’.

**Before**

| `// Onestore_IapCallbackManager.cs (C#)public` `static` `event` `Action<PurchaseData> getPurchaseSuccessEvent;public` `static` `event` `Action<string> getPurchaseErrorEvent;` `public` `void` `QueryPurchaseListener (string` `callback){    string` `data = findStringAfterCBType (callback, CBType.Success);    if` `(data.Length > 0) {        try` `{            PurchaseResponse purchaseRes = JsonUtility.FromJson<PurchaseResponse> (data);            PurchaseData purchaseData = JsonUtility.FromJson<PurchaseData> (purchaseRes.purchaseData);            getPurchaseSuccessEvent (purchaseData);        } catch` `(System.Exception ex) {            Debug.Log ("QueryPurchaseListener Exception "` `+ ex.Message);            getPurchaseErrorEvent (data); //success but no data        }    } else` `{        //onError만 뒤에 추가데이터 IapResult 가 있으므로 추가 데이터만 전달해주고 나머지 에러들은 추가 데이터가 없으므로 callback 그대로만 전달해줍니다.        string` `errorData = findStringAfterCBType (callback, CBType.Error);        if` `(errorData.Length > 0) {            getPurchaseErrorEvent (errorData);        } else` `{            getPurchaseErrorEvent (callback);        }    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
// GaaIapResultListener.cs\
void QueryPurchasesSuccessEvent(PurchaseData purchaseData, string signature, int count, int totalCount)

void QueryPurchasesErrorEvent(IapResult iapResult)

**After**

| `// GaaIapResultListener.csvoid` `PurchaseUpdatedSuccessEvent(PurchaseData purchaseData, string` `signature, int` `count, int` `totalCount)` `void` `PurchaseUpdatedErrorEvent(IapResult iapResult)` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Change Monthly auto-renewal product status**  <a href="#id-unityplugin-upgradeonestoreiap-changemonthlyauto-renewalproductstatus.1" id="id-unityplugin-upgradeonestoreiap-changemonthlyauto-renewalproductstatus.1"></a>

In SDK V17, the developer had to decide recurringState in person and to send the command value, however, in SDK V19, if PurchaseData is entered, the SDK determines and transfers the command value.

**Before**

| `// Onestore_IapUi.cs (C#)public` `void` `cancelAutoItem (){    string` `auto_json = PlayerPrefs.GetString (auto_pId1);    PurchaseData response = JsonUtility.FromJson<PurchaseData> (auto_json);` `if` `(auto_json.Length > 0) {        string` `command = "";        if` `(response.recurringState == 0) {            command = "cancel";        } else` `if` `(response.recurringState == 1) {            command = "reactivate";        }        IapCallManager.manageRecurringAuto (auto_json, command);    } else` `{        AndroidNative.showMessage ("Warning!!", "no data for manageRecurringAuto", "ok");    }}` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csPurchaseData purchaseData = ...string` `recurringAction;if` `(purchaseData.recurringState == RecurringState.RECURRING) {    recurringAction = RecurringAction.CANCEL;} else` `if` `(purchaseData.recurringState == RecurringState.CANCEL) {    recurringAction = RecurringAction.REACTIVATE;}GaaIapCallManager.ManageRecurringProduct(purchaseData, recurringAction);` |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Request ONE store login**  <a href="#id-unityplugin-upgradeonestoreiap-requestonestorelogin.1" id="id-unityplugin-upgradeonestoreiap-requestonestorelogin.1"></a>

**Before**

| `// Onestore_IapUi.cs (C#)IapCallManager.login();`  `// Onestore_IapResultListener.cs (C#)void` `getLoginIntentEvent (string` `result){    AndroidNative.showMessage ("getLoginIntent ", result.ToString (), "ok");}` |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

\
**After**

| `// MainUIScript.csGaaIapCallManager.LaunchLoginFlow();` `// GaaIapResultListener.csvoid` `LoginFlowEvent(IapResult iapResult){    if` `(iapResult.IsSuccess()) {        // You need to specify the scenario after successful login.    }}` |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

### **Install ONE store service (OSS)**  <a href="#id-unityplugin-upgradeonestoreiap-installonestoreservice-oss-.1" id="id-unityplugin-upgradeonestoreiap-installonestoreservice-oss-.1"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

<br>

<br>

### **Obtain store identification code**  <a href="#id-unityplugin-upgradeonestoreiap-obtainstoreidentificationcode.1" id="id-unityplugin-upgradeonestoreiap-obtainstoreidentificationcode.1"></a>

This API is newly added to ONE store IAP library V6(SDK V19).

For details, refer to ‘[Use ONE store IAP in Unity](https://dev.onestore.co.kr/wiki/en/x/gQFZ)’.

<br>

<br>
