net.rimlib.blackberry.api.paymentsdk
Interface Purchase

All Known Subinterfaces:
PurchaseResult

public interface Purchase

Represents a successful in-app purchase.


Field Summary
static int CANCELED
          The constant CANCELED.
static int NO_VALUE_SET
          The constant NO_VALUE_SET.
static int OWNED
          The constant OWNED.
static int REFUNDED
          The constant REFUNDED.
static int RENEW
          The constant RENEW.–Subscribed
static int SUBSCRIBED
          The constant SUBSCRIBED.
 
Method Summary
 java.util.Date getDate()
          Retrieves the date this purchase was made.
 java.lang.String getDigitalGoodId()
          Retrieves the ID of the purchased digital good.
 java.lang.String getDigitalGoodSku()
          Retrieves the SKU of the purchased digital good.
 java.util.Date getEndDate()
          Retrieves the date the subscription expires.
 java.lang.String getInitialSubscriptionPeriod()
          Retrieves the duration of the initial subscription period.
 int getItemState()
          Retrieves the state of this item.
 java.lang.String getLicenseKey()
          Retrieves the license key for this purchase, or null if the purchased digital good does not have a license key.
 java.lang.String getMetadata()
          Retrieves the metadata for this purchase, or null if no metadata was included with the purchase.
 java.util.Date getStartDate()
          Retrieves the date this subscription starts.
 java.lang.String getTransactionId()
          Retrieves the transaction ID for this purchase.
 

Field Detail

NO_VALUE_SET

static final int NO_VALUE_SET
The constant NO_VALUE_SET. Used for an error or an uninitialized item

See Also:
Constant Field Values

SUBSCRIBED

static final int SUBSCRIBED
The constant SUBSCRIBED. For a valid subscribed item

See Also:
Constant Field Values

REFUNDED

static final int REFUNDED
The constant REFUNDED. Not subscribed or not owned

See Also:
Constant Field Values

CANCELED

static final int CANCELED
The constant CANCELED. Check date to see if the subscription is still active.

See Also:
Constant Field Values

RENEW

static final int RENEW
The constant RENEW.–Subscribed

See Also:
Constant Field Values

OWNED

static final int OWNED
The constant OWNED. For a non-subscription that is owned by the user

See Also:
Constant Field Values
Method Detail

getDate

java.util.Date getDate()
Retrieves the date this purchase was made.

Returns:
The date this purchase was made.

getStartDate

java.util.Date getStartDate()
Retrieves the date this subscription starts.

Returns:
The date this subscription becomes active. Returns null for a non-subscription good.

getEndDate

java.util.Date getEndDate()
Retrieves the date the subscription expires.

Returns:
The date this subscription expires. Returns null for a non-subscription good.

getInitialSubscriptionPeriod

java.lang.String getInitialSubscriptionPeriod()
Retrieves the duration of the initial subscription period.

Returns:
The duration of the initial subscription period (in days). Returns null for a non-subscription good.

getItemState

int getItemState()
Retrieves the state of this item.

Returns:
A string representing the state of this item SUBSCRIBED: For a valid subscribed item REFUNDED: For a subscription not subscribed or for an item not owned CANCELED: Check the date to see if the subscription is still active. RENEW: Subscribed OWNED: For a non-subscription that is owned by the user.

getLicenseKey

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

Returns:
The license key or null.

getDigitalGoodId

java.lang.String getDigitalGoodId()
Retrieves the ID of the purchased digital good.

Returns:
The ID of the purchased digital good.

getDigitalGoodSku

java.lang.String getDigitalGoodSku()
Retrieves the SKU of the purchased digital good.

Returns:
The SKU of the purchased digital good.

getTransactionId

java.lang.String getTransactionId()
Retrieves the transaction ID for this purchase.

Returns:
The transaction ID.

getMetadata

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

Returns:
The metadata or null.