com.amazon.InApp.transaction
Class PurchaseResponse

java.lang.Object
  extended by com.amazon.InApp.transaction.PurchaseResponse

public final class PurchaseResponse
extends java.lang.Object

Represents the result of a call to TransactionManager.initiatePurchaseRequest(String) and is sent to the registered TransactionObserver asynchronously via TransactionObserver.notifyPurchaseResponse(PurchaseResponse).


Nested Class Summary
static class PurchaseResponse.PurchaseRequestStatus
          Indicates the result of a purchase operation initiated via TransactionManager.initiatePurchaseRequest(String).
 
Method Summary
 PurchaseResponse.PurchaseRequestStatus getPurchaseRequestStatus()
          Indicates the status of the purchase request.
 Receipt getReceipt()
          In the case where getPurchaseRequestStatus() returns PurchaseResponse.PurchaseRequestStatus.Successful a Receipt will also be returned with details of the item that was purchased.
 java.lang.String getRequestId()
          Provides access to the request ID originally returned by TransactionManager.initiatePurchaseRequest(String).
 java.lang.String getSku()
          Provides access to the vendor SKU that was originally provided in the request to TransactionManager.initiatePurchaseRequest(String).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRequestId

public java.lang.String getRequestId()
Provides access to the request ID originally returned by TransactionManager.initiatePurchaseRequest(String). This identifier can be used to correlate the original request with this response.

Returns:
the ID of the request that this response is associated with

getSku

public java.lang.String getSku()
Provides access to the vendor SKU that was originally provided in the request to TransactionManager.initiatePurchaseRequest(String).

Returns:
The vendor SKU used to initiate the purchase

getReceipt

public Receipt getReceipt()
In the case where getPurchaseRequestStatus() returns PurchaseResponse.PurchaseRequestStatus.Successful a Receipt will also be returned with details of the item that was purchased. If the PurchaseResponse.PurchaseRequestStatus is not PurchaseResponse.PurchaseRequestStatus.Successful, this method will return null.

Returns:
a Receipt in the case where getPurchaseRequestStatus() returns PurchaseResponse.PurchaseRequestStatus.Successful, null otherwise

getPurchaseRequestStatus

public PurchaseResponse.PurchaseRequestStatus getPurchaseRequestStatus()
Indicates the status of the purchase request.

Returns:
the status of the purchase request