|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.robotmedia.billing.BillingController
public class BillingController
| Nested Class Summary | |
|---|---|
static class |
BillingController.BillingStatus
|
static interface |
BillingController.IConfiguration
Used to provide on-demand values to the billing controller. |
| Field Summary | |
|---|---|
static String |
LOG_TAG
|
| Constructor Summary | |
|---|---|
BillingController()
|
|
| Method Summary | |
|---|---|
static BillingController.BillingStatus |
checkBillingSupported(android.content.Context context)
Returns the current billing status. |
static boolean |
confirmNotifications(android.content.Context context,
String productId)
Requests to confirm all pending MANUAL notifications for the specified item. |
static int |
countPurchases(android.content.Context context,
String productId)
Returns the number of purchases for the specified item. |
protected static void |
debug(String message)
|
static void |
dropBillingData(android.content.Context context)
|
static SecretKey |
getSecretKey(android.content.Context context)
|
static List<Transaction> |
getTransactions(android.content.Context context)
Lists all transactions stored locally, including cancellations and refunds. |
static List<Transaction> |
getTransactions(android.content.Context context,
String productId)
Lists all transactions of the specified item, stored locally. |
static boolean |
isDebug()
|
static boolean |
isPurchased(android.content.Context context,
String productId)
Returns true if the specified item has been registered as purchased in local memory. |
protected static void |
onNotify(android.content.Context context,
String notifyId)
Called when an IN_APP_NOTIFY message is received. |
protected static void |
onPurchaseStateChanged(android.content.Context context,
String signedData,
String signature)
Called after the response to a BillingRequest.GetPurchaseInformation request is
received. |
protected static void |
onRequestSent(long requestId,
net.robotmedia.billing.IBillingRequest request)
Called after a BillingRequest is
sent. |
protected static void |
onResponseCode(long requestId,
int responseCode)
Called after a BillingRequest is
sent. |
static void |
registerObserver(IBillingObserver billingObserver)
|
static void |
requestPurchase(android.content.Context context,
String productId)
Requests the purchase of the specified item. |
static void |
requestPurchase(android.content.Context context,
String productId,
boolean autoConfirmation)
Requests the purchase of the specified item with optional automatic confirmation. |
static void |
restoreTransactions(android.content.Context context)
Requests to restore all transactions. |
static void |
setConfiguration(BillingController.IConfiguration config)
Sets the configuration instance of the controller. |
static void |
setDebug(boolean debug)
Sets debug mode. |
static void |
setSignatureValidator(ISignatureValidator validator)
Sets a custom signature validator. |
static void |
startPurchaseIntent(android.content.Context context,
android.app.PendingIntent purchaseIntent,
android.content.Intent intent)
Starts the specified purchase intent with the specified activity. |
static void |
unregisterObserver(IBillingObserver billingObserver)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOG_TAG
| Constructor Detail |
|---|
public BillingController()
| Method Detail |
|---|
@Nonnull
public static SecretKey getSecretKey(@Nonnull
android.content.Context context)
throws org.solovyev.common.security.CiphererException
org.solovyev.common.security.CiphererException
@Nonnull
public static BillingController.BillingStatus checkBillingSupported(@Nonnull
android.content.Context context)
context - context
IBillingObserver.onCheckBillingSupportedResponse(boolean)
public static boolean confirmNotifications(@Nonnull
android.content.Context context,
@Nonnull
String productId)
context - contextproductId - id of the item whose purchase must be confirmed.
public static int countPurchases(@Nonnull
android.content.Context context,
@Nonnull
String productId)
context - contextproductId - id of the item whose purchases will be counted.
protected static void debug(@Nullable
String message)
@Nonnull
public static List<Transaction> getTransactions(@Nonnull
android.content.Context context)
context - context
@Nonnull
public static List<Transaction> getTransactions(@Nonnull
android.content.Context context,
@Nonnull
String productId)
context - contextproductId - id of the item whose transactions will be returned.
public static boolean isPurchased(@Nonnull
android.content.Context context,
@Nonnull
String productId)
context - contextproductId - item id.
protected static void onNotify(@Nonnull
android.content.Context context,
@Nonnull
String notifyId)
context - contextnotifyId - notification id.
protected static void onPurchaseStateChanged(@Nonnull
android.content.Context context,
@Nullable
String signedData,
@Nullable
String signature)
BillingRequest.GetPurchaseInformation request is
received. Registers all transactions in local memory and confirms those
who can be confirmed automatically.
context - contextsignedData - signed JSON data received from the Market Billing service.signature - data signature.
protected static void onRequestSent(long requestId,
@Nonnull
net.robotmedia.billing.IBillingRequest request)
BillingRequest is
sent.
requestId - the id the request.request - the billing request.
protected static void onResponseCode(long requestId,
int responseCode)
BillingRequest is
sent.
requestId - the id of the request.responseCode - the response code.ResponseCode
public static void requestPurchase(@Nonnull
android.content.Context context,
@Nonnull
String productId)
context - contextproductId - id of the item to be purchased.requestPurchase(android.content.Context, String, boolean)
public static void requestPurchase(@Nonnull
android.content.Context context,
@Nonnull
String productId,
boolean autoConfirmation)
context - contextproductId - id of the item to be purchased.autoConfirmation - if true, the transaction will be confirmed automatically. If
false, the transaction will have to be confirmed with a call
to confirmNotifications(android.content.Context, String).IBillingObserver.onPurchaseIntentOK(String, android.app.PendingIntent)
public static void restoreTransactions(@Nonnull
android.content.Context context)
context - contextpublic static void setConfiguration(BillingController.IConfiguration config)
config - configuration instance.public static void setDebug(boolean debug)
debug - debugpublic static boolean isDebug()
public static void setSignatureValidator(ISignatureValidator validator)
DefaultSignatureValidator will
be used.
validator - signature validator instance.
public static void startPurchaseIntent(@Nonnull
android.content.Context context,
@Nonnull
android.app.PendingIntent purchaseIntent,
@Nullable
android.content.Intent intent)
context - contextpurchaseIntent - purchase intent.intent - intent
public static void dropBillingData(@Nonnull
android.content.Context context)
public static void registerObserver(@Nonnull
IBillingObserver billingObserver)
public static void unregisterObserver(@Nonnull
IBillingObserver billingObserver)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||