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.


Blocks

purchasing supported

boolean purchasing supported()

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

Return Value:

Returns true if available, false otherwise.

purchase product

void purchase product(
    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).

consume product

void consume product(
    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).

manually restore purchases

void manually restore purchases()

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

is product owned

boolean is product owned(
    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.

get count of owned product

number get count of owned product(
    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.

get display price of product

text get display price of product(
    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.

get display title of product

text get display title of product(
    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.

get display description of product

text get display description of product(
    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.

on purchase success

on purchase success()

Called when a purchase is finished successfully.

on purchase failed

on purchase failed()

Called when a purchase failed for any reason.

on consume success

on consume success()

Called when a consume is finished successfully.

on consume failed

on consume failed()

Called when a consume failed for any reason.