API Reference

UM_InAppPurchaseManager

public class UM_InAppPurchaseManager {
	static UM_InAppClient Client {get;}
	static List<UM_InAppProduct> InAppProducts {get;}

	static UM_InAppProduct GetProductById(string id);
	
	static UM_InAppProduct GetProductByIOSId(string id);
	
	static UM_InAppProduct GetProductByAndroidId(string id);

	static UM_InAppProduct GetProductByAmazonId(string id);
	
	static UM_InAppProduct GetProductByWp8Id(string id);
}

UM_InAppClient

public interface UM_InAppClient {
	//Actions
	event Action<UM_BillingConnectionResult>  OnServiceConnected;
	event Action<UM_PurchaseResult> OnPurchaseFinished;
	event Action<UM_BaseResult> OnRestoreFinished;


	/// <summary>
	/// Connect to Android InApp service
	/// ActionBillingSetupFinished Action fired when connect
	/// is complete
	/// </summary>
	void Connect();


	/// <summary>
	/// Start purchase flow for product
	/// ActionProductPurchased Action fired when flow
	/// is complete
	/// </summary>
	/// <param name="SKU">product SKU you want to purchase</param>
	void Purchase(string productId);


	/// <summary>
	/// Start purchase flow for product
	/// ActionProductPurchased Action fired when flow
	/// is complete
	/// </summary>
	/// <param name="SKU">product SKU you want to purchase</param>
	void Purchase(UM_InAppProduct product);

	/// <summary>
	/// Start subscribe flow for product
	/// ActionProductPurchased Action fired when flow
	/// is complete
	/// </summary>
	/// <param name="SKU">product SKU you want to purchase</param>
	void Subscribe(UM_InAppProduct product);


	/// <summary>
	/// Start purchase flow for product
	/// ActionProductPurchased Action fired when flow
	/// is complete
	/// </summary>
	/// <param name="SKU">product SKU you want to purchase</param>
	void Subscribe(string productId);

	/// <summary>
	/// The Method will finish trsansaction for a product
	/// <param name="productId">target product Id</param>
	/// </summary>
	void FinishTransaction(string productId);


	/// <summary>
	///  The Method will finish trsansaction for a product
	/// <param name="product">target product</param>
	/// </summary>
	void FinishTransaction(UM_InAppProduct product);


	/// <summary>
	/// Restores purchases made by current user
	/// OnPurchaseFinished Action will be  fired for eatch previously purchaed product
	/// When restore flow is complete, OnRestoreFinished action fired.
	/// </summary>
	void RestorePurchases();


	/// <summary>
	/// Returns true if product with provided id owned by user
	/// <param name="productId">product Id</param>
	/// </summary>
	bool IsProductPurchased(string productId);


	/// <summary>
	/// Returns true if provided product  owned by user
	/// <param name="productId">product object</param>
	/// </summary>
	bool IsProductPurchased(UM_InAppProduct product);


	/// <summary>
	/// Can be used to determine if app is connection
	/// to the Android billing services 
	/// </summary>
	bool IsConnected {get;}
}

UM_InAppProduct

public class UM_InAppProduct {

	string LocalizedPrice  { get; }
	string CurrencyCode { get; }
	long PriceAmountMicros { get; }
	string ActualPrice { get; }
	float ActualPriceValue { get; }
	bool IsPurchased { get; }
	

	WP8ProductTemplate WP8Template { get; }
	IOSProductTemplate IOSTemplate { get; }
	GoogleProductTemplate AndroidTemplate { get; }
	AmazonProductTemplate AmazonTemplate { get; }
	UM_InAppProductTemplate template { get; }
}

UM_PurchaseResult

public class UM_PurchaseResult  {

	bool isSuccess {get;}
	string TransactionId  {get;}
	int ResponceCode {get;}
	UM_InAppProduct product {get;}


	GooglePurchaseTemplate Google_PurchaseInfo {get;}
	SA.IOSNative.StoreKit.PurchaseResult IOS_PurchaseInfo {get;}
	WP8PurchseResponce WP8_PurchaseInfo {get;}
	AMN_PurchaseResponse Amazon_PurchaseInfo {get;}
}