ONE store In-App Purchase (IAP) V21

ONE store In-App Purchase (IAP) V21

What is ONE store In-App Purchase?

ONE store In-App Purchase (IAP) is a service that sells and charges products implemented in Android apps to users using ONE store's authentication and payment system, and settles them with the developers. In order to pay for in-app products, it must be linked with the ONE store service (OSS) app, and the OSS app works with the ONE store payment server to conduct payments for in-app products. To apply ONE store IAP, use the "ONE store IAP SDK (In-App Purchase Software Development Kit)."

Types of In-App Products

ONE store IAP API V7 (SDK V21) is a managed product and a subscription type product. We offer two types of in-app merchandise. First, check the characteristics of each type, and then try to compose the in-app product list according to the product(s) you provide.

Type

Description

Management-type Products

Management-type products cannot be repurchased after a purchase until it has been consumed. In order to purchase the product again, you must process the consumption. By using these characteristics, you can provide in-app products in the form of consumable/permanent/term-based products.

Monthly Auto-renewal Products (Deprecated)

Monthly auto-renewal products are automatically paid a certain amount every month on a specified date once you sign up. After applying SDK V21 (API V7), you cannot create new monthly subscription products. However, previously created monthly subscription products can still be used. Subscription products (below) can be used instead.

Subscription Products

Subscription products are provided starting from SDK V21 (API V7). ONE store processes regular payments according to a set cycle, and provides user-friendly features such as promotions to attract new users and change of payment methods. For more information on subscription products, please refer to the Subscription Products Application page.

Payment Process

ONE store IAP consists of the following four processes:

ONE store Member Login

To use the ONE store IAP service, you must be registered and logged in as a ONE store member. If you receive an error code (RESULT_NEED_LOGIN) related to login failure, you must either call the login process to log in to ONE store or induce users to log in by running the ONE store app.

Encourage login by running the ONE store app

A message stating that a 'ONE store member login is required' is delivered to the user using a dialog box, etc. This method provides a simple guide to users and induces them to directly run the ONE store app.

Invoke login process with launchLoginFlowAsync

Developers use the launchLoginFlowAsync API to call the login screen. When the user completes login, the result value can be delivered through IapResultLIstener, which is entered as a parameter when calling the API. If the result code value is confirmed as successful, you can use the ONE store IAP SDK API. The figure below shows the login process between the developer's app and the ONE store.

Request to Purchase In-App Products

To purchase a product, first call the product detail information (queryProductDetailAsync) API and call the purchase screen through the launchPurchaseFlow API with product information. When payment is complete, purchase information can be delivered through the PurchasesUpdatedListener entered when initializing the PurchaseClient object. After verifying the result code value, if it is confirmed as successful, the process of paying the item corresponding to the in-app product proceeds. The figure below shows the process of purchasing in-app products between the developer's app and ONE store.

Confirm Purchases

If you are using ONE store IAP Library V6 or later, you must proceed to confirm a purchase within 3 days. If the purchase is not confirmed, the purchase amount will be refunded to the user. There are two ways to confirm a purchase:

  • Consume a purchase

    • A feature of managed products is that they are not repurchased until consumed after purchase. Therefore, if you provide a consumable product that can be purchased repeatedly among managed products, you must process the consumption using PurchaseClient.consumeAsync(), to allow users to purchase the product again.

    • When implementing a consumable product, the purchased product is consumed immediately after the purchase process is completed, and the item is paid after consumption is complete.

    • It is recommended that a process to check if there are any unpaid products in advance by calling the above APIs when the user runs the app/game or when they log in to the app/game is added.

  • Acknowledge a purchase

    • For non-consumable products, use PurchaseClient.acknowledgeAsync() . Permanent products can only be implemented by acknowledging them, not consuming them.

    • When implementing a product in a permanent form, you must acknowledge a purchase, not consume it.

    • Purchase confirmation is also required for subscription products, and you only need to confirm the purchase for the first payment

Due to a network disconnection or sudden abnormal termination of the app, there may be cases where the user has completed the payment, but the payment information is not delivered to the developer and the in-app product is not paid. It is recommended that the process be implemented to ensure that purchases are completed but unpaid products can be processed after checking whether there are any outstanding purchases (using the queryPurchases and consumption functions).

Manage Subscription Products

Subscription products renews payment periodically following the first purchase. ONE store provides a subscription management screen with various functions, such as pausing or canceling a subscription and changing the payment method, so that users can manage their products. You can provide a subscription management menu by calling the launchManageSubscription API or using a deep link.

Recommended Development Environment

The following development environment required to use ONE store IAP SDK:

  • Android 6.0 or higher (API version 23 or higher)

  • Java SDK 11

  • Android studio 2.0 or higher

Last updated