public class Receipt
- Object
- Receipt
ImplementsExternalizable
Fields
Constructors
Methods
Inherited methods
Field details
STORE_CODE_ITUNES
public static final String STORE_CODE_ITUNES = "itunes"STORE_CODE_PLAY
public static final String STORE_CODE_PLAY = "play"STORE_CODE_WINDOWS
public static final String STORE_CODE_WINDOWS = "windows"STORE_CODE_SIMULATOR
public static final String STORE_CODE_SIMULATOR = "simulator"Constructor details
Receipt
public Receipt()Receipt
public Receipt(String sku, Date expiryDate, Date cancellationDate, Date purchaseDate, int quantity, String transactionId, String orderData, String storeCode, String internalId)Method details
getSku
public String getSku()Returns
setSku
public void setSku(String sku)Parameters
skuString- the sku to set
See also
getExpiryDate
public Date getExpiryDate()The expiry date of the receipt, in case this is a subscription receipt.
NOTE: The expiry date will NOT be set automatically when the
receipt is generated by the platform. It should be set by the ReceiptStore in the
com.codename1.util.SuccessCallback) step,
and usually on the server-side (in cases where a server is being used to track subscriptions), then the expiry
date will be made available when the receipt is loaded using ReceiptStore#fetchReceipts(com.codename1.util.SuccessCallback).
Returns
setExpiryDate
public void setExpiryDate(Date expiryDate)Parameters
expiryDateDate- the expiryDate to set
See also
getVersion
public int getVersion()Returns
externalize
public void externalize(DataOutputStream out)
throws IOExceptionParameters
outDataOutputStream- the stream into which the object must be serialized
Throws
java.io.IOException- the method may throw an exception
internalize
public void internalize(int version, DataInputStream in)
throws IOExceptionParameters
versionint- the version the class returned during the externalization processs
inDataInputStream- the input stream used to load the class
Throws
java.io.IOException- the method may throw an exception
getObjectId
public String getObjectId()Returns
getCancellationDate
public Date getCancellationDate()Returns
setCancellationDate
public void setCancellationDate(Date cancellationDate)Parameters
cancellationDateDate- the cancellationDate to set
See also
getPurchaseDate
public Date getPurchaseDate()Returns
setPurchaseDate
public void setPurchaseDate(Date originalPurchaseDate)Parameters
originalPurchaseDateDate- the purchaseDate to set
See also
getQuantity
public int getQuantity()Returns
setQuantity
public void setQuantity(int quantity)Parameters
quantityint- the quantity to set
See also
getTransactionId
public String getTransactionId()storeCode to differentiate
between transactions of different stores, which may potentially have the
same transaction Ids.Returns
setTransactionId
public void setTransactionId(String transactionId)Parameters
transactionIdString- the transactionId to set
See also
getOrderData
public String getOrderData()The order data that may be used to verify the receipt with the appropriate REST service. This data will be in different formats for different stores.
iTunes has a base64 encoded string, Play has a JSON structure, Windows has an XML string, etc…
This will be filled in at the time that the receipt is generated by the platform’s implementation, so developers should never have to explicitly set this.
Returns
setOrderData
public void setOrderData(String orderData)Parameters
orderDataString- the orderData to set
See also
getStoreCode
public String getStoreCode()#STORE_CODE_ITUNES, #STORE_CODE_PLAY, #STORE_CODE_WINDOWS,
or #STORE_CODE_SIMULATOR, but developers could also use custom codes
if they use a different store, or no store at all. This code can be used
for validating the receipt.Returns
setStoreCode
public void setStoreCode(String storeCode)Parameters
storeCodeString- the storeCode to set
See also
getInternalId
public String getInternalId()Returns
setInternalId
public void setInternalId(String internalId)Parameters
internalIdString- the internalId to set
See also
toString
public String toString()