In-App Purchase (IAP) service is an integrated in-app purchase service.
IAP offers the following features.
|Android||One Store (Korea Only)|
|iOS||Apple App Store|
|AppKey||These are terms for IAP service.|
|Store||App Store, Google Play|
|Payment||User purchase history|
|Purchase||Item purchased in-app|
|Consume||Consuming purchase before creating item for user.|
|Payment Purchase Token||Verification token used when user application server consumes purchase.|
IAP service is comprised of 4 components as in following figure: IAP SDK, User Application Server, IAP Server, and Market.
|IAP SDK||Register User ID and request payment for in-app purchase. If payment is performed, you’ll move to in-app purchase screen of the store (Google Store for Android).|
|User Application Server||Verify purchase history requested by client via IAP server, consume purchase and transfer item.|
|User Application Client||If there is no server existent to user application, perform payment consume in application’s client and grant authority for item.|
|IAP Server||This is in-app purchase server provided by NHN Cloud|
|Store||It includes various stores such as Google Store and Apple App Store. Store server for each platform is synchronized with IAP server.|
In-app purchase provides IAP SDK and IAP server API. The following figure is payment flow.
[Table.4 IAP Payment Flow]
|||Register payment user ID. Developer identifies the payment user and provides item accordingly. This is not Google Play or App Store account.
Android : InternalInAppPurchase.InAppPurchase.registerUserId
iOS : TIAPurchase registerUserId: error:
|||Request payment in client
Android : InternalInAppPurchase..InAppPurchases.requestPurchase
iOS : TIAPurchase startPurchaseWithViewController: itemId: completionHandler
|Perform payment in store.|
|||Once payment is done in store, payment result will be delivered.
Consume item in user application server using the result.
For Build in model, if user application server is not existent, payment consume is done directly from client. However, for security reason, we strongly recommend you to consume payment in server to server method before granting authority to item.
|Request consume to IAP Server via transferred result from the store|
|||Deliver item to the user if consume is successful|