Companion

object Companion

Functions

Link copied to clipboard
fun clearCartById(callback: ClearCartByIdCallback, cartId: String)

Removes all items from the cart with the specified ID.

Link copied to clipboard
fun clearCurrentCart(callback: ClearCurrentCartCallback)

Updates the quantity of a previously added item in the cart with the specified ID. If there is no item with the specified SKU in the cart, it will be added.

Link copied to clipboard
fun createOrderByItemSku(    callback: CreateOrderCallback,     itemSku: String,     options: PaymentOptions? = PaymentOptions(),     quantity: Long = 1,     externalTransactionToken: String? = null)

Create an order with a specified item

Link copied to clipboard
fun createOrderByVirtualCurrency(    callback: CreateOrderByVirtualCurrencyCallback,     itemSku: String,     virtualCurrencySku: String,     customParameters: JSONObject? = null)

Creates an order with a specified item. The created order will get a new order status.

Link copied to clipboard
fun createOrderFromCartById(    callback: CreateOrderCallback,     cartId: String,     options: PaymentOptions? = PaymentOptions(),     externalTransactionToken: String? = null)

Creates an order with items from the cart with the specified ID. Returns the payment token and order ID.

Link copied to clipboard
fun createOrderFromCurrentCart(    callback: CreateOrderCallback,     options: PaymentOptions? = PaymentOptions(),     externalTransactionToken: String? = null)

Creates an order with items from the cart of the current user. Returns the payment token and order ID.

Link copied to clipboard
fun createOrderWithFreeCart(callback: CreateFreeOrderCallback, cartId: String? = null)

Create order with free cart

Link copied to clipboard
fun createOrderWithSpecifiedFreeItem(    callback: CreateFreeOrderCallback,     itemSku: String,     quantity: Long = 1)

Create an order with a specified free item

Link copied to clipboard
fun createPaymentToken(    callback: CreatePaymentTokenCallback,     purchase: PurchaseObject,     settings: PaymentTokenBodySettings? = null,     customParameters: JSONObject? = null)

Creates a new payment token.

Link copied to clipboard
fun deleteItemFromCartByCartId(    callback: DeleteItemFromCartByIdCallback,     cartId: String,     itemSku: String)

Removes the item from the cart with the specified ID.

Link copied to clipboard
fun deleteItemFromCurrentCart(callback: DeleteItemFromCurrentCartCallback, itemSku: String)

Removes the item from the current user cart.

Link copied to clipboard
fun fillCartByIdWithItems(    callback: FillSpecificCartWithItemsCallback,     cartId: String,     items: List<FillCartItem>)

Fills the current user cart with items. If there is already an item with the same SKU in the cart, the existing item position will be replaced by the passed value.

Link copied to clipboard
fun fillCurrentCartWithItems(callback: FillCartWithItemsCallback, items: List<FillCartItem>)

Fills the cart with the specified ID with items. If there is already an item with the same SKU in the cart, the existing item position will be replaced by the passed value.

Link copied to clipboard
fun getBundle(callback: GetBundleCallback, bundleSku: String)

Returns information about the contents of the specified bundle. In the bundle settings, display in the store must be enabled.

Link copied to clipboard
fun getBundleList(    callback: GetBundleListCallback,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = emptyList(),     country: String? = null)

Returns a list of bundles according to pagination settings. The list includes bundles for which display in the store is enabled in the settings.

Link copied to clipboard
fun getCartById(    callback: GetCartByIdCallback,     cartId: String,     currency: String? = null,     locale: String? = null)

Returns a list of items from the cart with the specified ID. For each item, complete data is returned.

Link copied to clipboard
fun getCouponRewardsByCode(callback: GetCouponRewardsByCodeCallback, couponCode: String)

Returns a list of items that can be credited to the user when the coupon is redeemed. Can be used to let users choose one of many items as a bonus. The usual case is choosing a DRM if the coupon contains a game as a bonus. The usual case is choosing a DRM if the coupon contains a game as a bonus (type=unit).

Link copied to clipboard
fun getCurrentCart(    callback: GetCurrentUserCartCallback,     currency: String? = null,     locale: String? = null)

Returns a list of items from the cart of the current user. For each item, complete data is returned.

Link copied to clipboard
fun getDrmList(callback: GetDrmListCallback)

Gets the list of available DRMs.

Link copied to clipboard
fun getGameForCatalog(    callback: GetGameForCatalogCallback,     itemSku: String,     locale: String? = null,     additionalFields: List<String>? = null,     country: String? = null)

Gets a game for the catalog.

Link copied to clipboard
fun getGameKeyForCatalog(    callback: GetGameKeyForCatalogCallback,     itemSku: String,     locale: String? = null,     additionalFields: List<String>? = null,     country: String? = null)

Gets a game key for the catalog.

Link copied to clipboard
fun getGameKeysListByGroup(    callback: GetGameKeysListByGroupCallback,     externalId: String,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = null,     country: String? = null)

Gets a game key list from the specified group for building a catalog.

Link copied to clipboard
fun getGamesList(    callback: GetGamesListCallback,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = null,     country: String? = null)

Gets a games list for building a catalog.

Link copied to clipboard
fun getGamesListByGroup(    callback: GetGamesListByGroupCallback,     externalId: String,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = null,     country: String? = null)

Gets a games list from the specified group for building a catalog.

Link copied to clipboard
fun getItemsBySpecifiedGroup(    callback: GetVirtualItemsByGroupCallback,     externalId: String = "all",     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String> = listOf(),     country: String? = null)

Returns a list of items for the specified group according to pagination settings. The list includes items for which display in the store is enabled in the settings. In the settings of the group, the display in the store must be enabled.

Link copied to clipboard
fun getItemsGroups(callback: GetItemsGroupsCallback)

Returns a full list of virtual item groups. The list includes groups for which display in the store is enabled in the settings.

Link copied to clipboard
fun getListOfOwnedGames(    callback: GetListOfOwnedGamesCallback,     limit: Int = 50,     offset: Int = 0,     isSandbox: Int = 1,     additionalFields: List<String>? = null)

Get the list of games owned by the user. The response will contain an array of games owned by a particular user.

Link copied to clipboard
fun getOrder(callback: GetOrderCallback, orderId: String)

Get a specified order

Link copied to clipboard
fun getOrderStatus(listener: OrderStatusListener, orderId: String)

Subscribes to order status updates.

Link copied to clipboard
fun getPromocodeRewardsByCode(callback: GetPromocodeRewardByCodeCallback, promocode: String)

Returns a list of items that can be credited to the user when the promo code is activated. Allows users to choose from several available items. The usual case is choosing a DRM if the promo code contains a game as a bonus (type=unit).

Link copied to clipboard
fun getVirtualCurrency(    callback: GetVirtualCurrencyCallback,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String> = listOf(),     country: String? = null)

Returns a list of virtual currencies according to pagination settings.

Link copied to clipboard
fun getVirtualCurrencyPackage(    callback: GetVirtualCurrencyPackageCallback,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = listOf(),     country: String? = null)

Returns a list of virtual currency packages according to pagination settings. The list includes packages for which display in the store is enabled in the settings.

Link copied to clipboard
fun getVirtualItems(    callback: GetVirtualItemsCallback,     limit: Int = 50,     offset: Int = 0,     locale: String? = null,     additionalFields: List<String>? = listOf(),     country: String? = null,     requestGeoLocale: Boolean? = null)

Returns a list of virtual items according to pagination settings. The list includes items for which display in the store is enabled in the settings. For each virtual item, complete data is returned.

Link copied to clipboard
fun getVirtualItemsShort(callback: GetVirtualItemsShortCallback, locale: String? = null)

Returns a full list of virtual items. The list includes items for which display in the store is enabled in the settings. For each virtual item, the SKU, name, description, and data about the groups it belongs to are returned.

Link copied to clipboard
fun init(projectId: Int, token: String? = null)

Initialize SDK

Link copied to clipboard
fun redeemCoupon(    callback: RedeemCouponCallback,     couponCode: String,     selectedUnitItems: Pair<String, String>? = null)

Redeems the coupon code and delivers a reward to the user in one of the following ways:

Link copied to clipboard
fun redeemGameCode(    callback: RedeemGameCodeCallback,     code: String,     isSandbox: Boolean)

Grants entitlement by a provided game code.

Link copied to clipboard
fun redeemPromocode(    callback: RedeemPromocodeCallback,     promocode: String,     selectedUnitItems: Pair<String, String>? = null,     cartId: String = "current")

Redeems a promo code. After activating the promo code, the user gets free items and/or the price of the cart is reduced.

Link copied to clipboard
fun removePromocode(callback: RemovePromocodeCallback, cartId: String = "current")

Removes a promo code from a cart. After the promo code is removed, the total price of all items in the cart will be recalculated without bonuses and discounts provided by a promo code.

Link copied to clipboard
fun setAuthToken(token: String)

Set authentication token

Link copied to clipboard
fun updateItemFromCartByCartId(    callback: UpdateItemFromCartByCartIdCallback,     cartId: String,     itemSku: String,     quantity: Long)

Updates the quantity of a previously added item in the cart with the specified ID. If there is no item with the specified SKU in the cart, it will be added.

Link copied to clipboard
fun updateItemFromCurrentCart(    callback: UpdateItemFromCurrentCartCallback,     itemSku: String,     quantity: Long)

Updates the quantity of a previously added item in the current user cart. If there is no item with the specified SKU in the cart, it will be added.

Sources

Link copied to clipboard