Home


In App Payments

The connector library provides a set of functions which help you to make use of different In-App Payment SDKs in your app.

Methods

IsPurchasingSupported

boolean IsPurchasingSupported()

Check if the In-App Payments support is currently available in your app.

Return Value:

Returns true if available, false otherwise.

AttemptPurchase

void AttemptPurchase(
    text productName
)

Start the purchase flow for the given product.

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

ConsumePurchase

void ConsumePurchase(
    text productName
)

Consume the given product, if applicable (availability of this feature depends on the SDK provider, not all support consumable goods).

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

ManuallyRestorePurchases

void ManuallyRestorePurchases()

Manually restore purchases and update the user's inventory, if applicable (availability of this feature depends on the SDK provider).

IsItemOwned

boolean IsItemOwned(
    text productName
)

Check if the given product is already owned. The result may be inaccurate, depending on whether the SDK provider stores the information about your products or not.

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

Return Value:

Returns true if owned, false otherwise.

GetOwnedItemCount

number GetOwnedItemCount(
    text productName
)

Get a number of the given product that user owns, or 0 if none. The result may be inaccurate, depending on whether the SDK provider stores the information about your products or not.

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

Return Value:

Returns a number of the given product copies.

GetPurchaseDisplayPrice

text GetPurchaseDisplayPrice(
    text productName,
    text defaultPrice
)

Get a localized display price of the given product, for example: "100zł", "100¥".

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

text  defaultPrice - Default value, used if the real one cannot be fetched for any reason.

Return Value:

Returns a string containing the localized display price.

GetPurchaseDisplayTitle

text GetPurchaseDisplayTitle(
    text productName,
    text defaultTitle
)

Get a localized display title of the given product.

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

text  defaultTitle - Default value, used if the real one cannot be fetched for any reason.

Return Value:

Returns a string containing the localized display title.

GetPurchaseDisplayDescription

text GetPurchaseDisplayDescription(
    text productName,
    text defaultDescription
)

Get a localized display description of the given product.

Parameters:

text  productName - The reference name which you entered during the Enhance flow (SKU Mappings).

text  defaultDescription - Default value, used if the real one cannot be fetched for any reason.

Return Value:

Returns a string containing the localized display description.

Events

PurchaseSuccess

PurchaseSuccess()

Called when a purchase is finished successfully.

PurchaseFailed

PurchaseFailed()

Called when a purchase failed for any reason.

ConsumeSuccess

ConsumeSuccess()

Called when a consume is finished successfully.

ConsumeFailed

ConsumeFailed()

Called when a consume failed for any reason.

ManualRestoreSuccess

ManualRestoreSuccess()

Called when a restore is finished successfully.

ManualRestoreFailed

ManualRestoreFailed()

Called when a restore failed for any reason.