Home


Using older version? Download library for Construct 2

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.

ACEs

Refresh status

Action Refresh status()

Check if the In-App Payments support is currently available in your app. When a response arrives, the On status received condition will be triggered.

Attempt purchase

Action Attempt purchase(
    String productName
)

Start the purchase flow for the given product. When this is done, either the On purchase success or the On purchase failed condition will be triggered.

Parameters:

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

Consume purchase

Action Consume purchase(
    String productName
)

Start the purchase flow for the given product. When this is done, either the On consume success or the On consume failed condition will be triggered.

Parameters:

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

Manually restore purchases

Action Manually restore purchases()

Manually restore purchases and update the user's inventory, if applicable (availability of this feature depends on the SDK provider). When this is done, either the On restore purchases success or the On restore purchases failed condition will be triggered.

Check if item is owned

Action Check if item is owned(
    String 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. When a response arrives, either the On item is owned or the On item is not owned condition will be triggered.

Parameters:

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

Get item count

Action Get item count(
    String 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. When a response arrives, the On owned item count received condition will be triggered.

Parameters:

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

Get display price

Action Get display price(
    String productName,
    String defaultPrice
)

Get a localized display price of the given product, for example: "100zł", "100¥". When a response arrives, the On display price received condition will be triggered.

Parameters:

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

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

Get display title

Action Get display title(
    String productName,
    String defaultTitle
)

Get a localized display title of the given product. When a response arrives, the On display title received condition will be triggered.

Parameters:

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

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

Get display description

Action Get display description(
    String productName,
    String defaultDescription
)

Get a localized display description of the given product. When a response arrives, the On display description received condition will be triggered.

Parameters:

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

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

On status received

Condition On status received()

Called when In-App Payments support status is refreshed. Now, you can check the status with the Is supported condition.

Is supported

Condition Is supported()

Returns true if available, false otherwise.

On purchase success

Condition On purchase success(
    String productName
)

Called when a purchase is finished successfully.

Parameters:

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

On purchase failed

Condition On purchase failed(
    String productName
)

Called when a purchase failed for any reason.

Parameters:

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

On consume success

Condition On consume success(
    String productName
)

Called when a consume is finished successfully.

Parameters:

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

On consume failed

Condition On consume failed(
    String productName
)

Called when a consume failed for any reason.

Parameters:

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

On restore purchases success

Condition On restore purchases success()

Called when a restore is finished successfully.

On restore purchases failed

Condition On restore purchases failed()

Called when a restore failed for any reason.

On item is owned

Condition On item is owned(
    String productName
)

Called when the given product is owned, after calling the Check if item is owned action.

Parameters:

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

On item is not owned

Condition On item is not owned(
    String productName
)

Called when the given product is not owned, after calling the Check if item is owned action.

Parameters:

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

On item count received

Condition On item count received(
    String productName
)

Called when an owned count of the item is received. To fetch the count, use the Enhance.LastOwnedItemCount expression.

Parameters:

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

On display price received

Condition On display price received(
    String productName
)

Called when a display price of the given product is received. To fetch the price, use the Enhance.LastDisplayPrice expression.

Parameters:

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

On display title received

Condition On display title received(
    String productName
)

Called when a display title of the given product is received. To fetch the title, use the Enhance.LastDisplayTitle expression.

Parameters:

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

On display description received

Condition On display description received(
    String productName
)

Called when a display description of the given product is received. To fetch the description, use the Enhance.LastDisplayDescription expression.

Parameters:

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

LastOwnedItemCount

Expression LastOwnedItemCount()

The last received owned item count.

LastDisplayPrice

Expression LastDisplayPrice()

The last received display price.

LastDisplayTitle

Expression LastDisplayTitle()

The last received display title.

LastDisplayDescription

Expression LastDisplayDescription()

The last received display description.