Payments



Payments: Unity (C#)




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

Example Usage

private void OnPurchaseSuccess() {
    string price = Enhance.Purchases.GetDisplayPrice("my_product", "$5");

    string title = Enhance.Purchases.GetDisplayTitle("my_product", "My Product");

    string desc  = Enhance.Purchases.GetDisplayDescription("my_product", "Some useful item.");
}

private void OnPurchaseFailed() {
    // Failure
}

if (Enhance.Purchases.IsSupported()) {
    Enhance.Purchases.AttemptPurchase("my_product", OnPurchaseSuccess, OnPurchaseFailed);
}

Methods

bool Enhance.Purchases.IsSupported()

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

void Enhance.Purchases.AttemptPurchase( string productName, Action onPurchaseSuccessCallback, Action onPurchaseFailedCallback )

Start the purchase flow for the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

ActiononPurchaseSuccessCallback - Specifies the action which is triggered when the product purchase is finished successfully.

ActiononPurchaseFailedCallback - Specifies the action which is triggered when the product purchase failed.

void Enhance.Purchases.Consume( string productName, Action onConsumeSuccessCallback, Action onConsumeFailedCallback )

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

ActiononConsumeSuccessCallback - Specifies the action which is triggered when the product consumption is finished successfully.

ActiononConsumeFailedCallback - Specifies the action which is triggered when the product consumption failed.

bool Enhance.Purchases.IsItemOwned( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

int Enhance.Purchases.GetOwnedItemCount( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

void Enhance.Purchases.ManuallyRestorePurchases( Action onRestoreSuccessCallback, Action onRestoreFailedCallback )

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

Parameters:
ActiononRestoreSuccessCallback - Specifies the action which is triggered when the restore is finished successfully.

ActiononRestoreFailedCallback - Specifies the action which is triggered when the restore failed.

string Enhance.Purchases.GetDisplayPrice( string productName, string defaultPrice )

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

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

string Enhance.Purchases.GetDisplayTitle( string productName, string defaultTitle )

Get a localized display title of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

string Enhance.Purchases.GetDisplayDescription( string productName, string defaultDescription )

Get a localized display description of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Payments: Android (Java)




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

Example Usage

if (Enhance.purchases.isSupported()) {
    Enhance.purchases.attemptPurchase("my_product", new EnhanceInAppPurchases.PurchaseCallback() {
        @Override
        public void onPurchaseSuccess() {
            String price = Enhance.purchases.getDisplayPrice("my_product", "$5");

            String title = Enhance.purchases.getDisplayTitle("my_product", "My Product");

            String desc  = Enhance.purchases.getDisplayDescription("my_product", "Some useful item.");
        }

        @Override
        public void onPurchaseFailed() {
            // Failure
        }
    });
}

Methods

boolean Enhance.purchases.isSupported()

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

void Enhance.purchases.attemptPurchase( String productName, EnhanceInAppPurchases.PurchaseCallback callbacks )

Start the purchase flow for the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

EnhanceInAppPurchases.PurchaseCallbackcallbacks - Specifies the callbacks which are triggered when the product purchase is finished successfully, or not (for more information about the EnhanceInAppPurchases.PurchaseCallback type, see the Interfaces section).

void Enhance.purchases.consume( String productName, EnhanceInAppPurchases.ConsumeCallback callbacks )

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

EnhanceInAppPurchases.ConsumeCallbackcallbacks - Specifies the callbacks which are triggered when the product consumption is finished successfully, or not (for more about the EnhanceInAppPurchases.ConsumeCallback type, see the Interfaces section).

boolean Enhance.purchases.isItemOwned( 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.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

int Enhance.purchases.getOwnedItemCount( 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.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

void Enhance.purchases.manuallyRestorePurchases( EnhanceInAppPurchases.RestoreCallback callbacks )

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

Parameters:
EnhanceInAppPurchases.RestoreCallbackcallbacks - Specifies the callbacks which are triggered when the restore is finished, successfully or not (for more information about the EnhanceInAppPurchases.RestoreCallback type, see the Interfaces section).

String Enhance.purchases.getDisplayPrice( String productName, String defaultPrice )

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

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

String Enhance.purchases.getDisplayTitle( String productName, String defaultTitle )

Get a localized display title of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

String Enhance.purchases.getDisplayDescription( String productName, String defaultDescription )

Get a localized display description of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Interfaces

interface EnhanceInAppPurchases.PurchaseCallback { void onPurchaseSuccess(); void onPurchaseFailed(); }

interface EnhanceInAppPurchases.ConsumeCallback { void onConsumeSuccess(); void onConsumeFailed(); }

interface EnhanceInAppPurchases.RestoreCallback { void onRestoreSuccess(); void onRestoreFailed(); }

Payments: iOS (Objective-C)




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

Example Usage

-(void)onPurchaseSuccess {
    NSString *price = [[Enhance purchases] getDisplayPrice:@"Enhance_SKU_One" defaultPrice:@"Default Price"];

    NSString *title = [[Enhance purchases] getDisplayTitle:@"Enhance_SKU_One" defaultTitle:@"Default Title"];

    NSString *desc = [[Enhance purchases] getDisplayDescription:@"Enhance_SKU_One" defaultDescription:@"Default Description"];
}

-(void)onPurchaseFailed 
    // Failure
}

-(void)makePurchase {
    if ([[Enhance purchases] isSupported]) {
        [[Enhance purchases] attemptPurchase:@"my_product" delegate:self];
    }
}

Methods

BOOL [[Enhance purchases] isSupported]

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns YES if purchasing is available, NO otherwise.

void [[Enhance purchases] attemptPurchase: (NSString*)sku delegate:(id)delegate ]

Start the purchase flow for the given product.

Parameters:
NSString*productName - The product's reference name which you entered during the Enhance flow.

id delegate - Specifies the object which implements the PurchaseDelegate protocol (for more information about this type, see the Protocols section).

void [[Enhance purchases] consume: (NSString*)productName delegate:(id)delegate ]

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
NSString*sku - The product's reference name which you entered during the Enhance flow.

id delegate - Specifies the object which implements the ConsumeDelegate protocol (for more information about this type, see the Protocols section).

BOOL [[Enhance purchases] isItemOwned: (NSString*)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:
NSString*productName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns YES if the item is owned, NO otherwise.

int [[Enhance purchases] getOwnedItemCount: (NSString*)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:
NSString*productName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

void [[Enhance purchases] manuallyRestorePurchases: (id)delegate ]

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

Parameters:
id delegate - Specifies the object which implements the RestoreDelegate protocol (for more information about this type, see the Protocols section).

NSString* [[Enhance purchases] getDisplayPrice: (NSString*)productName defaultPrice:(NSString*)defaultPrice ]

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

Parameters:
NSString*productName - The product's reference name which you entered during the Enhance flow.

NSString*defaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

NSString* [[Enhance purchases] getDisplayTitle: (NSString*)productName defaultTitle:(NSString*)defaultTitle ]

Get a localized display title of the given product.

Parameters:
NSString*productName - The product's reference name which you entered during the Enhance flow.

NSString*defaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

NSString* [[Enhance purchases] getDisplayDescription: (NSString*)productName defaultDescription:(NSString*)defaultDescription ]

Get a localized display description of the given product.

Parameters:
NSString*productName - The product's reference name which you entered during the Enhance flow.

NSString*defaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Protocols

protocol PurchaseDelegate<NSObject> -(void)onPurchaseSuccess; -(void)onPurchaseFailed;

protocol ConsumeDelegate<NSObject> -(void)onConsumeSuccess; -(void)onConsumeFailed;

protocol RestoreDelegate<NSObject> -(void)onRestoreSuccess; -(void)onRestoreFailed;

Payments: OpenFL (Haxe)




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

Example Usage

var  onPurchaseSuccess = function() {
    var price:String = Enhance.purchases.getDisplayPrice("my_product", "$5");

    var title:String = Enhance.purchases.getDisplayTitle("my_product", "My Product");

    var desc:String  = Enhance.purchases.getDisplayDescription("my_product", "Some useful item.");
};

var onPurchaseFailed = function() {
    // Failure
};

if (Enhance.purchases.isSupported()) {
    Enhance.purchases.attemptPurchase("my_product", onPurchaseSuccess, onPurchaseFailed);
}

Methods

Enhance.purchases.isSupported():Bool

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

Enhance.purchases.attemptPurchase( productName:String, onPurchaseSuccessCallback:Void->Void, onPurchaseFailedCallback:Void->Void ):Void

Start the purchase flow for the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

Void->VoidonPurchaseSuccessCallback - Specifies the function which is triggered when the product purchase is finished successfully.

Void->VoidonPurchaseFailedCallback - Specifies the function which is triggered when the product purchase failed.

Enhance.purchases.consume( productName:String, onConsumeSuccessCallback:Void->Void, onConsumeFailedCallback:Void->Void ):Void

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

Void->VoidonConsumeSuccessCallback - Specifies the function which is triggered when the product consumption is finished successfully.

Void->VoidonConsumeFailedCallback - Specifies the function which is triggered when the product consumption failed.

Enhance.purchases.isItemOwned( productName:String ):Bool

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:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

Enhance.purchases.getOwnedItemCount( productName:String ):Int

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:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

Enhance.purchases.manuallyRestorePurchases( onRestoreSuccessCallback:Void->Void, onRestoreFailedCallback:Void->Void ):Void

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

Parameters:
Void->VoidonRestoreSuccessCallback - Specifies the function which is triggered when the restore is finished successfully.

Void->VoidonRestoreFailedCallback - Specifies the function which is triggered when the restore failed.

Enhance.purchases.getDisplayPrice( productName:String, defaultPrice:String ):String

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

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

Enhance.purchases.getDisplayTitle( productName:String, defaultTitle:String ):String

Get a localized display title of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

Enhance.purchases.getDisplayDescription( productName:String, defaultDescription:String ):String

Get a localized display description of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Payments: Adobe Air (AS3)




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

Example Usage

private function onPurchaseSuccess():void {
    var price:String = Enhance.purchases.getDisplayPrice("my_product", "$5");

    var title:String = Enhance.purchases.getDisplayTitle("my_product", "My Product");

    var desc:String  = Enhance.purchases.getDisplayDescription("my_product", "Some useful item.");
}

private function onPurchaseFailed():void {
    // Failure
}

private function purchase():void {
    if (Enhance.purchases.isSupported()) {
        Enhance.purchases.attemptPurchase("my_product", onPurchaseSuccess, onPurchaseFailed);
    } 
}

Methods

Enhance.purchases.isSupported():Boolean

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

Enhance.purchases.attemptPurchase( productName:String, onPurchaseSuccessCallback:Function, onPurchaseFailedCallback:Function ):void

Start the purchase flow for the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

FunctiononPurchaseSuccessCallback - Specifies the function which is triggered when the product purchase is finished successfully.

FunctiononPurchaseFailedCallback - Specifies the function which is triggered when the product purchase failed.

Enhance.purchases.consume( productName:String, onConsumeSuccessCallback:Function, onConsumeFailedCallback:Function ):void

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

FunctiononConsumeSuccessCallback - Specifies the function which is triggered when the product consumption is finished successfully.

FunctiononConsumeFailedCallback - Specifies the function which is triggered when the product consumption failed.

Enhance.purchases.isItemOwned( productName:String ):Boolean

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:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

Enhance.purchases.getOwnedItemCount( productName:String ):int

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:
StringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

Enhance.purchases.manuallyRestorePurchases( onRestoreSuccessCallback:Function, onRestoreFailedCallback:Function ):void

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

Parameters:
FunctiononRestoreSuccessCallback - Specifies the function which is triggered when the restore is finished successfully.

FunctiononRestoreFailedCallback - Specifies the function which is triggered when the restore failed.

Enhance.purchases.getDisplayPrice( productName:String, defaultPrice:String ):String

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

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

Enhance.purchases.getDisplayTitle( productName:String, defaultTitle:String ):String

Get a localized display title of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

Enhance.purchases.getDisplayDescription( productName:String, defaultDescription:String ):String

Get a localized display description of the given product.

Parameters:
StringproductName - The product's reference name which you entered during the Enhance flow.

StringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Payments: Defold (Lua)




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

Example Usage

function on_purchase_success()
    local price = enhance.getDisplayPrice("my_product", "$5")

    local title = enhance.getDisplayTitle("my_product", "My Product")

    local desc = enhance.getDisplayDescription("my_product", "Some useful item.")
end

function on_purchase_failed()
    // Failure
end

function purchase()
    if enhance.iapIsSupported() then
        enhance.attemptPurchase("my_product", on_purchase_success, on_purchase_failed)
    end
end

Methods

boolean enhance.iapIsSupported()

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

nil enhance.attemptPurchase( string productName, function onPurchaseSuccessCallback, function onPurchaseFailedCallback )

Start the purchase flow for the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

functiononPurchaseSuccessCallback - Specifies the function which is triggered when the product purchase is finished successfully.

functiononPurchaseFailedCallback - Specifies the function which is triggered when the product purchase failed.

nil enhance.consume( string productName, function onConsumeSuccessCallback, function onConsumeFailedCallback )

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

functiononConsumeSuccessCallback - Specifies the function which is triggered when the product consumption is finished successfully.

functiononConsumeFailedCallback - Specifies the function which is triggered when the product consumption failed.

boolean enhance.isItemOwned( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

number enhance.getOwnedItemCount( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

nil enhance.manuallyRestorePurchases( function onRestoreSuccessCallback, function onRestoreFailedCallback )

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

Parameters:
functiononRestoreSuccessCallback - Specifies the function which is triggered when the restore is finished successfully.

functiononRestoreFailedCallback - Specifies the function which is triggered when the restore failed.

string enhance.getDisplayPrice( string productName, string defaultPrice )

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

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

string enhance.getDisplayTitle( string productName, string defaultTitle )

Get a localized display title of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

string enhance.getDisplayDescription( string productName, string defaultDescription )

Get a localized display description of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Payments: Construct 2 (Visual)




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

Example Usage

Function On "purchase"
    Enhance Attempt purchase of "my_product"

Enhance On purchase of "my_product" succeeded
    Enhance Get owned item count of "my_product"

Enhance On owned count of "my_product" received
    System Set product_quantity to Enhance.LastOwnedItemCount

Actions

Enhance Check status

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

Enhance Attempt purchase

Start the purchase flow for the given product.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance Consume product

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance Manually restore purchases

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

Enhance Check if item is owned

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 reponse arrives, either the On item is owned or On item is NOT owned condition will be triggered.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance Get owned item count

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 reponse arrives, the On owned item count received condition will be triggered.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance Get display price

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Default Price - Default price which will be used if a real one can't be fetched.

Enhance Get display title

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Default Title - Default title which will be used if a real one can't be fetched.

Enhance Get display description

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Default Description - Default description which will be used if a real one can't be fetched.

Conditions

Enhance On status received

Triggered when an IAP status is received. You can check the status with the Is supported condition.

Enhance Is supported

Check whether you can use In-App Purchases.

Returns:
Returns true if purchasing is supported, false otherwise.

Enhance On purchase success

Triggered when a purchase of the given product is finished successfully.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On purchase failed

Triggered when a purchase of the given product failed.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On product consumption success

Triggered when a consumption of the given product succeeded.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On product consumption failed

Triggered when a consumption of the given product failed.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On purchases restore success

Triggered when a restore of the purchases succeeded.

Enhance On purchases restore failed

Triggered when a restore of the purchases failed.

Enhance On item is owned

Triggered when the given product is owned.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On item is not owned

Triggered when the given product is not owned.

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On owned item count received

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On display price received

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On display title received

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Enhance On display description received

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

Parameters:
Product Name (sku) - The product's reference name which you entered during the Enhance flow.

Expressions

number Enhance.LastOwnedItemCount

The last received owned item count.

string Enhance.LastDisplayPrice

The last received display price.

string Enhance.LastDisplayTitle

The last received display title.

string Enhance.LastDisplayDescription

The last received display description.

Payments: Stencyl (Visual)




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

Example Usage


Action Blocks



Start the purchase flow for the given product.

Parameters:
text product name (SKU) - The product's reference name which you entered during the Enhance flow.



Consume the given product, if applicable (depends on the SDK provider).

Parameters:
text product name (SKU) - The product's reference name which you entered during the Enhance flow.



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

Normal Blocks



Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.



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 product name (SKU) - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.



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 product name (SKU) - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.



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

Parameters:
text product name (SKU) - The product's reference name which you entered during the Enhance flow.

text default price - Default price which will be used if a real one can't be fetched.

Returns:
Returns a text containing the localized display price.



Get a localized display title of the given product.

Parameters:
text product name (SKU) - The product's reference name which you entered during the Enhance flow.

text default title - Default title which will be used if a real one can't be fetched.

Returns:
Returns a text containing the localized display title.



Get a localized display description of the given product.

Parameters:
text product name (SKU) - The product's reference name which you entered during the Enhance flow.

text default description - Default description which will be used if a real one can't be fetched.

Returns:
Returns a text containing the localized display description.

Wrapper Blocks



Define actions which are triggered on a purchase success.



Define actions which are triggered on a purchase failure.



Define actions which are triggered on a consume success.



Define actions which are triggered on a consume failure.



Define actions which are triggered on a manual purchases restore success.



Define actions which are triggered on a manual purchases restore failure.

Payments: Cordova (JS)




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

Example Usage

var callback = function() {
    var onPurchaseSuccess = function() {
        Enhance.purchases.getDisplayTitle('my_product', 'My product', function(result) {
            alert(result);
        });
    };

    var onPurchaseFailed = function() {
        // Failure
    };

    Enhance.purchases.attemptPurchase('my_product', onPurchaseSuccess, onPurchaseFailed);
};

Enhance.purchases.isSupported(callback);

Methods

void Enhance.purchases.isSupported( resultCallback )

Check if the In-App Purchasing is currently available in your application.

Parameters:
function resultCallback - Specifies the function which will receive a response (true or false).

void Enhance.purchases.attemptPurchase( productName, onPurchaseSuccessCallback, onPurchaseFailedCallback )

Start the purchase flow for the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

functiononPurchaseSuccessCallback - Specifies the function which is triggered when the product purchase is finished successfully.

functiononPurchaseFailedCallback - Specifies the function which is triggered when the product purchase failed.

void Enhance.purchases.consume( productName, onConsumeSuccessCallback, onConsumeFailedCallback )

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

function onConsumeSuccessCallback - Specifies the function which is triggered when the product consumption is finished successfully.

function onConsumeFailedCallback - Specifies the function which is triggered when the product consumption failed.

void Enhance.purchases.manuallyRestorePurchases( onRestoreSuccessCallback, onRestoreFailedCallback )

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

Parameters:
functiononRestoreSuccessCallback - Specifies the function which is triggered when the restore is finished successfully.

functiononRestoreFailedCallback - Specifies the function which is triggered when the restore failed.

void Enhance.purchases.isItemOwned( productName, resultCallback )

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:
stringproductName - The product's reference name which you entered during the Enhance flow.

function resultCallback - Specifies the function which will receive a response (true or false).

void Enhance.purchases.getOwnedItemCount( productName, resultCallback )

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:
string productName - The product's reference name which you entered during the Enhance flow.

function resultCallback - Specifies the function which will receive a response (a number of the given product copies).

void Enhance.purchases.getDisplayPrice( productName, defaultPrice, resultCallback )

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

Parameters:
string productName - The product's reference name which you entered during the Enhance flow.

string defaultPrice - Default price which will be used if a real one can't be fetched.

function resultCallback - Specifies the function which will receive a response (a string containing the localized display price).

void Enhance.purchases.getDisplayTitle( productName, defaultTitle, resultCallback )

Get a localized display title of the given product.

Parameters:
string productName - The product's reference name which you entered during the Enhance flow.

string defaultTitle - Default title which will be used if a real one can't be fetched.

function resultCallback - Specifies the function which will receive a response (a string containing the localized display title).

void Enhance.purchases.getDisplayDescription( productName, defaultDescription, resultCallback )

Get a localized display description of the given product.

Parameters:
string productName - The product's reference name which you entered during the Enhance flow.

string defaultDescription - Default description which will be used if a real one can't be fetched.

function resultCallback - Specifies the function which will receive a response (a string containing the localized display description).

Payments: Construct 3 (Visual)




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

Example Usage

Function On "purchase"
    Enhance Attempt purchase of "my_product"

Enhance On purchase of "my_product" succeeded
    Enhance Get owned item count of "my_product"

Enhance On count of "my_product" received
    System Set product_quantity to Enhance.LastOwnedItemCount

Actions

Enhance Refresh status

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

Enhance Attempt purchase

Start the purchase flow for the given product.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance Consume purchase

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance Manually restore purchases

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

Enhance Check if item is owned

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 reponse arrives, either the On item is owned or On item is NOT owned condition will be triggered.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance Get item count

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 reponse arrives, the On owned item count received condition will be triggered.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance Get display price

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Default Price - Default price which will be used if a real one can't be fetched.

Enhance Get display title

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Default Title - Default title which will be used if a real one can't be fetched.

Enhance Get display description

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Default Description - Default description which will be used if a real one can't be fetched.

Conditions

Enhance On status received

Triggered when an IAP status is received. You can check the status with the Is supported condition.

Enhance Is supported

Check whether you can use In-App Purchases.

Returns:
Returns true if purchasing is supported, false otherwise.

Enhance On purchase success

Triggered when a purchase of the given product is finished successfully.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On purchase failed

Triggered when a purchase of the given product failed.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On consume success

Triggered when a consumption of the given product succeeded.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On consume failed

Triggered when a consumption of the given product failed.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On restore purchases success

Triggered when a restore of the purchases succeeded.

Enhance On restore purchases failed

Triggered when a restore of the purchases failed.

Enhance On item is owned

Triggered when the given product is owned.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On item is not owned

Triggered when the given product is not owned.

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On item count received

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On display price received

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On display title received

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Enhance On display description received

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

Parameters:
Product ID - The product's reference name which you entered during the Enhance flow.

Expressions

number Enhance.LastOwnedItemCount

The last received owned item count.

string Enhance.LastDisplayPrice

The last received display price.

string Enhance.LastDisplayTitle

The last received display title.

string Enhance.LastDisplayDescription

The last received display description.

Payments: Xamarin (C#)




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

Example Usage

private void OnPurchaseSuccess() {
    string price = Enhance.Purchases.GetDisplayPrice("my_product", "$5");

    string title = Enhance.Purchases.GetDisplayTitle("my_product", "My Product");

    string desc  = Enhance.Purchases.GetDisplayDescription("my_product", "Some useful item.");
}

private void OnPurchaseFailed() {
    // Failure
}

if (Enhance.Purchases.IsSupported()) {
    Enhance.Purchases.AttemptPurchase("my_product", OnPurchaseSuccess, OnPurchaseFailed);
}

Methods

bool Enhance.Purchases.IsSupported()

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

void Enhance.Purchases.AttemptPurchase( string productName, Action onPurchaseSuccessCallback, Action onPurchaseFailedCallback )

Start the purchase flow for the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

ActiononPurchaseSuccessCallback - Specifies the action which is triggered when the product purchase is finished successfully.

ActiononPurchaseFailedCallback - Specifies the action which is triggered when the product purchase failed.

void Enhance.Purchases.Consume( string productName, Action onConsumeSuccessCallback, Action onConsumeFailedCallback )

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

ActiononConsumeSuccessCallback - Specifies the action which is triggered when the product consumption is finished successfully.

ActiononConsumeFailedCallback - Specifies the action which is triggered when the product consumption failed.

bool Enhance.Purchases.IsItemOwned( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

int Enhance.Purchases.GetOwnedItemCount( 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.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

void Enhance.Purchases.ManuallyRestorePurchases( Action onRestoreSuccessCallback, Action onRestoreFailedCallback )

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

Parameters:
ActiononRestoreSuccessCallback - Specifies the action which is triggered when the restore is finished successfully.

ActiononRestoreFailedCallback - Specifies the action which is triggered when the restore failed.

string Enhance.Purchases.GetDisplayPrice( string productName, string defaultPrice )

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

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

string Enhance.Purchases.GetDisplayTitle( string productName, string defaultTitle )

Get a localized display title of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

string Enhance.Purchases.GetDisplayDescription( string productName, string defaultDescription )

Get a localized display description of the given product.

Parameters:
stringproductName - The product's reference name which you entered during the Enhance flow.

stringdefaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Payments: MIT App Inventor (Visual)




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

Example Usage

when Button.Click
do
    if      call EnhanceConnector1.IsPurchasingSupported
    then    call EnhanceConnector1.AttemptPurchase
                 productName = "my_product"

when EnhanceConnector1.PurchaseSuccess
do
    set displayTitle to call EnhanceConnector1.GetDisplayTitle
                             productName  = "my_product"
                             defaultTitle = "My product"
    call Notifier1.ShowAlert
         notice = displayTitle

Methods

boolean IsPurchasingSupported

Check if the In-App Purchasing is currently available in your application.

Returns:
Returns true if purchasing is available, false otherwise.

void AttemptPurchase

Start the purchase flow for the given product.

Parameters:
text productName - The product's reference name which you entered during the Enhance flow.

void ConsumePurchase

Consume the given product, if applicable (depends on the SDK provider).

Parameters:
text productName - The product's reference name which you entered during the Enhance flow.

void ManuallyRestorePurchases

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

boolean IsItemOwned

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 product's reference name which you entered during the Enhance flow.

Returns:
Returns true if the item is owned, false otherwise.

number GetOwnedItemCount

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 product's reference name which you entered during the Enhance flow.

Returns:
Returns a number of the given product copies.

text GetPurchaseDisplayPrice

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

Parameters:
text productName - The product's reference name which you entered during the Enhance flow.

text defaultPrice - Default price which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display price.

text GetPurchaseDisplayTitle

Get a localized display title of the given product.

Parameters:
text productName - The product's reference name which you entered during the Enhance flow.

text defaultTitle - Default title which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display title.

text GetPurchaseDisplayDescription

Get a localized display description of the given product.

Parameters:
text productName - The product's reference name which you entered during the Enhance flow.

text defaultDescription - Default description which will be used if a real one can't be fetched.

Returns:
Returns a string containing the localized display description.

Events

PurchaseSuccess

This event is raised when a purchase is finished successfully.

PurchaseFailed

This event is raised when a purchase failed.

ConsumeSuccess

This event is raised when a product consume is finished successfully.

ConsumeFailed

This event is raised when a product consume failed.

ManualRestoreSuccess

This event is raised when a manual purchases restore is successful.

ManualRestoreFailed

This event is raised when a manual purchases restore failed.

Payments: Construct 3 (Visual)




Enhance library provides a set of functions which help you to easily make use of different In-App Purchases SDKs in your application.

Actions

Refresh status
Refresh In-App Purchases status to check whether it's currently supported or not. Triggers [On status received].

Attempt purchase
Start the purchase flow for the given product.

Consume product
Try to consume the given product from the user's inventory.

Check if item is owned
Check if item is already owned.

Get owned item count
Get the number of the given product that user owns, or 0 if none.

Get display title
Get the string containing the localized display title.

Get display description
Get the string containing the localized display description.

Get display price
Get the string containing the localized display price.

Manually restore purchases
Manually restore purchases and update the user's inventory, if applicable.

Conditions

On status received
Triggered when IAP status is received. [Is IAP supported] is updated.

Is IAP supported
Check if In-App purchasing is currently supported.

On purchase success
Triggered when a purchase is finished successfully.

On purchase failed
Triggered when a purchase failed.

On consume success
Triggered when consumption of the item succeeded.

On consume failed
Triggered when consumption of the item failed.

On restore purchases success
Triggered when restore of purchases succeeded.

On restore purchases failed
Triggered when restore of purchases failed.

On item is owned
Triggered when the item is owned.

On item is not owned
Triggered when the item is NOT owned.

On owned item count received
Triggered when count of the owned item is received. Use expresion to fetch the count.

On display title received
Triggered when a display title of the product is received. Use expression to fetch the title.

On display description received
Triggered when a display description of the product is received. Use expression to fetch the description.

On display price received
Triggered when a display price of the product is received. Use expression to fetch the price.

Expressions

Enhance.LastOwnedItemCount
Last received owned item count. Returns number.

Enhance.LastDisplayTitle
Last received display title. Returns string.

Enhance.LastDisplayDescription
Last received display description. Returns string.

Enhance.LastDisplayPrice
Last received display price. Returns string.

Payments: Xamarin (C#)




Enhance library provides a set of functions which help you to easily make use of different In-App Purchases SDKs in your application.

1) Check if In-App purchasing is currently supported:
bool isSupported = Enhance.Purchases.IsSupported();

2) Start the purchase flow for the given product:
Enhance.Purchases.AttemptPurchase(string productName, Action onPurchaseSuccess, Action onPurchaseFailed);

3) Try to consume the given product from the user's inventory:
Enhance.Purchases.Consume(string productName, Action onConsumeSuccess, Action onConsumeFailed);

4) Check if item is already owned:
bool isOwned = Enhance.Purchases.IsItemOwned(string productName);

5) Get the number of the given product that user owns, or 0 if none:
int count = Enhance.Purchases.GetOwnedItemCount(string productName);

6) Get the string containing the localized display title:
string displayTitle = Enhance.Purchases.GetDisplayTitle(string productName, string defaultTitle);

7) Get the string containing the localized display description:
string displayDesc = Enhance.Purchases.GetDisplayDescription(string productName, string defaultDescription);

8) Get the string containing the localized display price:
string displayPrice = Enhance.Purchases.GetDisplayPrice(string productName, string defaultPrice);

9) Manually restore purchases and update the user's inventory, if applicable:
Enhance.Purchases.ManuallyRestorePurchases(Action onRestoreSuccess, Action onRestoreFailed);

Payments: MIT App Inventor (Visual)




Enhance library provides a set of functions which help you to easily make use of different In-App Purchases SDKs in your application.

1) Check if In-App purchasing is currently supported:
IsPurchasingSupported

2) Start the purchase flow for the given product:
AttemptPurchase (Text productName)

3) Try to consume the given product from the user's inventory:
ConsumePurchase (Text productName)

4) Check if item is already owned:
IsItemOwned (Text productName)

5) Get the number of the given product that user owns, or 0 if none:
GetOwnedItemCount (Text productName)

6) Get the string containing the localized display title:
GetPurchaseDisplayTitle (Text productName, Text defaultTitle)

7) Get the string containing the localized display description:
GetPurchaseDisplayDescription (Text productName, Text defaultDescription)

8) Get the string containing the localized display price:
GetPurchaseDisplayPrice (Text productName, Text defaultPrice)

9) Manually restore purchases and update the user's inventory, if applicable:
ManuallyRestorePurchases

10) Listen to events:
PurchaseSuccess
PurchaseFailed

ConsumeSuccess
ConsumeFailed

ManualRestoreSuccess
ManualRestoreFailed