Exception: com.soomla.store.exceptions.VirtualItemNotFoundException: Virtual item was not found when searching with itemId=coins_10
I am using soomla project to implement IAP in my project.
I have created my assets file named abcAssets.cs and have put it in the path
Assets/Soomla/Code
here is the code of abcAssets.cs
namespace com.soomla.unity.example {
public class HHAssets : IStoreAssets{
public int GetVersion() {
return 0;
}
public VirtualCurrency[] GetCurrencies() {
return new VirtualCurrency[]{COIN_CURRENCY};
}
public VirtualCurrencyPack[] GetCurrencyPacks() {
return new VirtualCurrencyPack[] {TEN_COINS_PACK};
}
public VirtualCategory[] GetCategories() {
return new VirtualCategory[]{GENERAL_CATEGORY};
}
public NonConsumableItem[] GetNonConsumableItems() {
return new NonConsumableItem[]{NO_ADDS_NONCONS};
}
public const string TEN_COINS_PACK_PRODUCT_ID = "[MY_PRODUCT_ID]";
public const string COIN_CURRENCY_ITEM_ID = "currency_coin";
public static VirtualCurrency COIN_CURRENCY = new VirtualCurrency(
"Coins",
"",
COIN_CURRENCY_ITEM_ID
);
public static VirtualCurrencyPack TEN_COINS_PACK = new VirtualCurrencyPack(
"10 Coins", // name
"A pack of 10 coins", // description
"coins_10", // item id
10,
COIN_CURRENCY_ITEM_ID, // the currency associated with this pack
new PurchaseWithMarket(TEN_COINS_PACK_PRODUCT_ID, 60.00)
);
}
}
I am initializing this in start function like this
StoreController.Initialize(new HHAssets());
But when I am trying to purchase ten_coin_pack with this code
StoreInventory.BuyItem(HHAssets.TEN_COINS_PACK.ItemId);
I am getting this exception in Log
Exception: com.soomla.store.exceptions.VirtualItemNotFoundException: Virtual item was not found when searching with itemId=coins_10