InAppPurchase

The player purchased an IAP

Name
Type
Select
Backend name
Description

purchaseName

string

Required

purchase_name

Name of the purchase/pack the user bought

spentProducts

Product

Required

spent_products

What products the user spent on

receivedProducts

Product

Required

received_products

The user receives the product

purchaseLocation

string

Optional

placement

The location in the app where the purchase was made

productID

string

Optional

product_id

The Store SKU of the purchase unit

transactionID

string

Optional

transaction_id

The receipt ID provided by the Store

additionalData

Dictionary<string, object>

Optional

additional_data

Any additional information

receiptStatus

ReceiptStatus

Optional

validated_receipt

A receipt status object

Override #1

Name
Type
Select
Backend name
Description

purchaseName

string

Required

purchase_name

Name of the purchase/pack the user bought

realCurrencyAmount

string

Required

The localized price of the purchase

realCurrencyType

string

Required

The type of real currency (USD, Euros, etc). Lion Analytics will automatically convert the localized price based on the 'realCurrencyType' (currency code) provided.

virtualCurrencyAmount

string

Required

The virtual Currency amount in game

virtualCurrencyName

string

Required

The virtual currency name used in the game

virtualCurrencyType

string

Required

The type of virtual currency used in the game.

productID

string

Optional

product_id

The Store SKU of the purchase unit

transactionID

string

Optional

transaction_id

The receipt ID provided by the Store

placement

string

Optional

placement

The location in the app where the purchase was made

receiptStatus

string

Optional

validated_receipt

A receipt status object

additionalData

string

Optional

additional_data

Any additional information

Override #2

Name
Type
Select
Backend name
Description

amount

string

Required

amount

The amount the player BET / RAISED if applicable.

itemID

string

Required

item_id

Internal ID of an item within the game

itemType

string

Required

item_type

The type of item that is being interacted with, could be a spell, weapon, etc.

currencyType

string

Optional

The type of currency used to buy the purchase. The default is USD

placement

string

Optional

placement

The location in the app where the purchase was made

additionalData

string

Optional

additional_data

Any additional information

Code examples:

Product productSpent = new Product();
Product productReceived = new Product();
RealCurrency realCurrency = new RealCurrency("$", 25.99f);
productSpent.realCurrency = realCurrency;
int virtualMoneyAmount = Mathf.FloorToInt(1500f);
List<VirtualCurrency> virtualCurrencies = new List<VirtualCurrency>
{ new VirtualCurrency("Received a Pack of : ", "$", virtualMoneyAmount) };
productReceived.virtualCurrencies = virtualCurrencies;
Dictionary<string, object> additionalData = new Dictionary<string, object>
{
{ "Anything", 1356 },
{ "More Anything", 76.85f },
{ "status Something", true },
{ "Message Something", "Yes! this is good" }
};
LionAnalytics.InAppPurchase(virtualMoneyAmount + "Bought", productSpent, productReceived,
"store_money_tab", "com.studio.game.money1500", "xcf22f89574u45k6jy8", additionalData,
ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package

Alternative method using Override #1 example:

using Override #1 example
int virtualMoneyAmount = Mathf.FloorToInt(1500f);
Dictionary<string, object> additionalData = new Dictionary<string, object>
{
{ "Anything", 1356 },
{ "More Anything", 76.85f },
{ "status Something", true },
{ "Message Something", "Yes! this is good" }
};
LionAnalytics.InAppPurchase(virtualMoneyAmount, "Coins", "collectible", "USD", 25.99f,
virtualMoneyAmount + "Bought", "com.studio.game.money1500", "xcf22f89574u45k6jy8", additionalData,
"store_money_tab",
ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package

Alternative method using Override #2 example:

using Override #2 example
Product productSpent = new Product();
Product productReceived = new Product();
RealCurrency realCurrency = new RealCurrency("$", 25.99f);
productSpent.realCurrency = realCurrency;
int virtualMoneyAmount = Mathf.FloorToInt(1500f);
List<VirtualCurrency> virtualCurrencies = new List<VirtualCurrency>
{ new VirtualCurrency("Received a Pack of : ", "$", virtualMoneyAmount) };
productReceived.virtualCurrencies = virtualCurrencies;
Transaction transaction = new Transaction("store Transaction", "USD", productReceived, productSpent,
"xcf22f89574u45k6jy8", "com.studio.game.money1500");
transaction.AddSpentItem("free coins", "USD ", 0);
transaction.AddReceivedItem("free 5 coins", "coins", 5);
Dictionary<string, object> additionalData = new Dictionary<string, object>
{
{ "Anything", 1356 },
{ "More Anything", 76.85f },
{ "status Something", true },
{ "Message Something", "Yes! this is good" }
};
LionAnalytics.InAppPurchase(transaction, additionalData,
transaction.productID, transaction.transactionID,
"store_money_tab",
ReceiptStatus.Success); //Receipt status should be received either from adjust or lion's IAP package

Last updated