net.rimlib.blackberry.api.paymentsdk
Interface PurchaseResult

All Superinterfaces:
Purchase, Result, ResultCodes

public interface PurchaseResult
extends Purchase, Result

Represents the result of an in-app purchase attempt. Every PurchaseResult object provides its creation date via the getDate() method. All other data is optional, and may depend on whether the purchase result is successful. For example, getLicenseKey() only provides an actual license key if a purchase is successful and the purchased digital good has a license key (some do not).


Field Summary
static java.lang.String ATTR_ENDDATE
           
static java.lang.String ATTR_ID
           
static java.lang.String ATTR_INITIALSUBSCRIPTIONPERIOD
           
static java.lang.String ATTR_LICENSEKEY
           
static java.lang.String ATTR_PURCHASEDATE
           
static java.lang.String ATTR_PURCHASEID
           
static java.lang.String ATTR_STARTDATE
           
static java.lang.String ATTR_STATUS
           
static java.lang.String META_DATA
           
static java.lang.String SUB_STATUS
           
static java.lang.String TAG_PERIOD
           
static java.lang.String TAG_SKU
           
 
Fields inherited from interface net.rimlib.blackberry.api.paymentsdk.Purchase
CANCELED, NO_VALUE_SET, OWNED, REFUNDED, RENEW, SUBSCRIBED
 
Fields inherited from interface net.rimlib.blackberry.api.paymentsdk.Result
RETURN_CODE, STATUS_MESSAGE
 
Fields inherited from interface net.rimlib.blackberry.api.paymentsdk.ResultCodes
REASON_APP_WORLD_NOT_CORRECT_VERSION, REASON_ARGUMENTS_ERROR, REASON_CANCELED, REASON_GOOD_NOT_FOUND, REASON_ILLEGAL_APPLICATION, REASON_NONE, REASON_SERVER_ERROR, REASON_UNKNOWN
 
Method Summary
 java.util.Hashtable getData()
           
 java.util.Date getDate()
          Returns the date when the purchase attempt represented by this PurchaseResult was made.
 java.lang.String getDigitalGoodId()
          Retrieves the ID of the purchased digital good, or null if this purchase result did not succeed.
 java.lang.String getDigitalGoodSku()
          Retrieves the SKU of the purchased digital good, or null if this purchase result did not succeed.
 int getFailureReason()
          Retrieves a constant representing the reason this result is unsuccessful, or REASON_NONE if this result is successful.
 java.lang.String getLicenseKey()
          Retrieves the license key for a purchase attempt, or null if the purchase attempt did not succeed or the purchased digital good does not have a license key.
 java.lang.String getMetadata()
          Retrieves the metadata for this purchase result, or null if this purchase result did not succeed (or no metadata was included with the purchase).
 java.lang.String getTransactionId()
          Retrieves the transaction ID for this purchase result, or null if this purchase result did not succeed.
 java.lang.String getValue(java.lang.String key)
           
 
Methods inherited from interface net.rimlib.blackberry.api.paymentsdk.Purchase
getEndDate, getInitialSubscriptionPeriod, getItemState, getStartDate
 
Methods inherited from interface net.rimlib.blackberry.api.paymentsdk.Result
getStatusMessage, isSuccessful
 

Field Detail

ATTR_ID

static final java.lang.String ATTR_ID
See Also:
Constant Field Values

TAG_SKU

static final java.lang.String TAG_SKU
See Also:
Constant Field Values

ATTR_LICENSEKEY

static final java.lang.String ATTR_LICENSEKEY
See Also:
Constant Field Values

META_DATA

static final java.lang.String META_DATA
See Also:
Constant Field Values

ATTR_PURCHASEID

static final java.lang.String ATTR_PURCHASEID
See Also:
Constant Field Values

SUB_STATUS

static final java.lang.String SUB_STATUS
See Also:
Constant Field Values

TAG_PERIOD

static final java.lang.String TAG_PERIOD
See Also:
Constant Field Values

ATTR_STARTDATE

static final java.lang.String ATTR_STARTDATE
See Also:
Constant Field Values

ATTR_ENDDATE

static final java.lang.String ATTR_ENDDATE
See Also:
Constant Field Values

ATTR_STATUS

static final java.lang.String ATTR_STATUS
See Also:
Constant Field Values

ATTR_PURCHASEDATE

static final java.lang.String ATTR_PURCHASEDATE
See Also:
Constant Field Values

ATTR_INITIALSUBSCRIPTIONPERIOD

static final java.lang.String ATTR_INITIALSUBSCRIPTIONPERIOD
See Also:
Constant Field Values
Method Detail

getDate

java.util.Date getDate()
Returns the date when the purchase attempt represented by this PurchaseResult was made.

Specified by:
getDate in interface Purchase
Returns:
The date the purchase attempt was made.

getLicenseKey

java.lang.String getLicenseKey()
Retrieves the license key for a purchase attempt, or null if the purchase attempt did not succeed or the purchased digital good does not have a license key.

Specified by:
getLicenseKey in interface Purchase
Returns:
The license key or null.

getDigitalGoodId

java.lang.String getDigitalGoodId()
Retrieves the ID of the purchased digital good, or null if this purchase result did not succeed.

Specified by:
getDigitalGoodId in interface Purchase
Returns:
The ID of the purchased digital good or null.

getDigitalGoodSku

java.lang.String getDigitalGoodSku()
Retrieves the SKU of the purchased digital good, or null if this purchase result did not succeed.

Specified by:
getDigitalGoodSku in interface Purchase
Returns:
The SKU of the purchased digital good or null.

getTransactionId

java.lang.String getTransactionId()
Retrieves the transaction ID for this purchase result, or null if this purchase result did not succeed.

Specified by:
getTransactionId in interface Purchase
Returns:
The transaction ID or null.

getMetadata

java.lang.String getMetadata()
Retrieves the metadata for this purchase result, or null if this purchase result did not succeed (or no metadata was included with the purchase).

Specified by:
getMetadata in interface Purchase
Returns:
The metadata or null.

getValue

java.lang.String getValue(java.lang.String key)

getData

java.util.Hashtable getData()

getFailureReason

int getFailureReason()
Description copied from interface: Result
Retrieves a constant representing the reason this result is unsuccessful, or REASON_NONE if this result is successful.

Specified by:
getFailureReason in interface Result
Returns:
One of the REASON_* constants. If this result is successful, then REASON_NONE is returned.