Artenus 2D Framework
Artenus Reference
Represents a product in an in-app billing system.
public final class Product

Field Summary

Modifier and TypeField and Description
public static CONSUMABLE
Indicates a product that can be purchased multiple times by a customer.
public static ENTITLEMENT
Indicates any type of content that you sell within your game that requires an access rights.
public static SUBSCRIPTION
Indicates a product with recurring, automated billing at the interval you specify.

Constructor Summary

Modifier and TypeConstructor and Description
public Product(String sku, String title, String desc, String price, int type)
Creates a new instance of Product with the specified information.

Method Summary

Modifier and TypeMethod and Description
public booleanequals(Object obj)
Indicates whether some other object is equal to this one.
public StringgetDescription()
Gets the description of this product.
public StringgetPrice()
Gets the price of this product.
public intgetProductType()
Gets the type of this product.
public ProductReceiptgetReceipt()
Gets the product receipt.
public StringgetSKU()
Gets this product's SKU (unique stock-keeping unit identifier).
public StringgetTitle()
Gets the title of this product.
public voidsetReceipt(ProductReceipt receipt)
This method is called internally during a purchase flow, to assign a receipt to this product.

Methods inherited from java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

CONSUMABLE
public static CONSUMABLE
Indicates a product that can be purchased multiple times by a customer. Examples include fuel and ammo.
ENTITLEMENT
public static ENTITLEMENT
Indicates any type of content that you sell within your game that requires an access rights. Examples include additional levels for a game, unlocking functionality already in your app, etc. This product type is not supported by all app-stores. It is recommended to use subscriptions instead, unless you only target specific app-stores with support for entitlements.
SUBSCRIPTION
public static SUBSCRIPTION
Indicates a product with recurring, automated billing at the interval you specify. Examples of this product type in games include premium version (extra features), removed ads, etc.

Constructor Detail

Product
public  Product(
    String sku,
    String title,
    String desc,
    String price,
    int type
)
Creates a new instance of Product with the specified information.
Parameters:
skuProduct SKU as specified in the app-store
titleProduct title
descDescription
pricePrice, including the currency
typeProduct type; it can be one of CONSUMABLE, SUBSCRIPTION, or ENTITLEMENT

Method Detail

equals
public boolean equals(
    Object obj
)
Indicates whether some other object is equal to this one. Equality in the context of products is closely related to equal SKUs, hence that's what is compared by this method.
Parameters:
objObject to compare to
Returns:
true if obj is a product with the same SKU as this instance, false otherwise.
getDescription
public String getDescription()
Gets the description of this product.
Returns:
The description
getPrice
public String getPrice()
Gets the price of this product.
Returns:
Price string, including the currency
getProductType
public int getProductType()
Gets the type of this product. It can be one of CONSUMABLE, SUBSCRIPTION, or ENTITLEMENT.
Returns:
Product type
getReceipt
public ProductReceipt getReceipt()
Gets the product receipt. A product has a receipt if it has been acquired by the user. The receipt contains purchase information.
Returns:
Product receipt, or null if there is no purchase
See Also:
getSKU
public String getSKU()
Gets this product's SKU (unique stock-keeping unit identifier).
Returns:
Product SKU as specified in the app-store
getTitle
public String getTitle()
Gets the title of this product.
Returns:
The title
setReceipt
public void setReceipt(
    ProductReceipt receipt
)
This method is called internally during a purchase flow, to assign a receipt to this product.
Parameters:
receiptProduct receipt, or null if there is no purchase
See Also: