net.robotmedia.billing.helper
Class DefaultBillingObserver

java.lang.Object
  extended by net.robotmedia.billing.helper.AbstractBillingObserver
      extended by net.robotmedia.billing.helper.DefaultBillingObserver
All Implemented Interfaces:
IBillingObserver

public class DefaultBillingObserver
extends AbstractBillingObserver

User: serso Date: 5/14/12 Time: 4:16 PM


Field Summary
 
Fields inherited from class net.robotmedia.billing.helper.AbstractBillingObserver
context, KEY_TRANSACTIONS_RESTORED
 
Constructor Summary
DefaultBillingObserver(android.content.Context context, IBillingObserver nestedBillingObserver)
           
 
Method Summary
 void onCheckBillingSupportedResponse(boolean supported)
          Called each time
 void onErrorRestoreTransactions(ResponseCode responseCode)
          Called when a restore transactions request ended with a server error.
 void onPurchaseIntentFailure(String productId, ResponseCode responseCode)
          Called when purchase intent was not sent due to billing service error
 void onPurchaseIntentOK(String productId, android.app.PendingIntent purchaseIntent)
          Called after requesting the purchase of the specified item.
 void onPurchaseStateChanged(String productId, Transaction.PurchaseState state)
          Called when the specified item is purchased, cancelled or refunded.
 void onRequestPurchaseResponse(String productId, ResponseCode response)
          Called with the response for the purchase request of the specified item.
 void onTransactionsRestored()
          Called when a restore transactions request has been successfully received by the server.
 
Methods inherited from class net.robotmedia.billing.helper.AbstractBillingObserver
isTransactionsRestored, isTransactionsRestored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBillingObserver

public DefaultBillingObserver(@Nonnull
                              android.content.Context context,
                              @Nullable
                              IBillingObserver nestedBillingObserver)
Method Detail

onCheckBillingSupportedResponse

public void onCheckBillingSupportedResponse(boolean supported)
Description copied from interface: IBillingObserver
Called each time

Parameters:
supported - if true, in-app billing is supported. Otherwise, it isn't.
See Also:
BillingController.checkBillingSupported(android.content.Context)

onPurchaseIntentOK

public void onPurchaseIntentOK(@Nonnull
                               String productId,
                               @Nonnull
                               android.app.PendingIntent purchaseIntent)
Description copied from class: AbstractBillingObserver
Called after requesting the purchase of the specified item. The default implementation simply starts the pending intent.

Specified by:
onPurchaseIntentOK in interface IBillingObserver
Overrides:
onPurchaseIntentOK in class AbstractBillingObserver
Parameters:
productId - id of the item whose purchase was requested.
purchaseIntent - a purchase pending intent for the specified item.
See Also:
BillingController.requestPurchase(android.content.Context, String, boolean)

onPurchaseIntentFailure

public void onPurchaseIntentFailure(@Nonnull
                                    String productId,
                                    @Nonnull
                                    ResponseCode responseCode)
Description copied from interface: IBillingObserver
Called when purchase intent was not sent due to billing service error

Parameters:
productId - id of the item whose purchase was requested
responseCode - one of the failures response codes from billing service

onPurchaseStateChanged

public void onPurchaseStateChanged(@Nonnull
                                   String productId,
                                   @Nonnull
                                   Transaction.PurchaseState state)
Description copied from interface: IBillingObserver
Called when the specified item is purchased, cancelled or refunded.

Parameters:
productId - id of the item whose purchase state has changed.
state - purchase state of the specified item.

onRequestPurchaseResponse

public void onRequestPurchaseResponse(@Nonnull
                                      String productId,
                                      @Nonnull
                                      ResponseCode response)
Description copied from interface: IBillingObserver
Called with the response for the purchase request of the specified item. This is used for reporting various errors, or if the user backed out and didn't purchase the item.

Parameters:
productId - id of the item whose purchase was requested
response - response of the purchase request

onTransactionsRestored

public void onTransactionsRestored()
Description copied from interface: IBillingObserver
Called when a restore transactions request has been successfully received by the server.

Specified by:
onTransactionsRestored in interface IBillingObserver
Overrides:
onTransactionsRestored in class AbstractBillingObserver

onErrorRestoreTransactions

public void onErrorRestoreTransactions(@Nonnull
                                       ResponseCode responseCode)
Description copied from interface: IBillingObserver
Called when a restore transactions request ended with a server error.

Specified by:
onErrorRestoreTransactions in interface IBillingObserver
Overrides:
onErrorRestoreTransactions in class AbstractBillingObserver
Parameters:
responseCode - response code


Copyright © 2013. All Rights Reserved.