com.txtnation.android
Interface PaymentListener


public interface PaymentListener

Provides callback methods for getting responses, updates and final payment results initiated through the BillingManager class .


Method Summary
 void onCancelled()
          Called when a user has cancelled the billing process from one of the dialogs shown by the billing manager.
 void onFailure(java.lang.String failureDetails)
          Called when the payment transaction has failed.
 void onPaymentStateChanged(java.lang.String paymentState)
          Called each time we have moved to a new state in the payment process.
 void onProductSelected(com.txtnation.android.products.Product product)
          Called when a product (price) has been selected from the list of products returned from server.
 void onProductsReceived(java.util.List<com.txtnation.android.products.Product> products)
          Called when we have received the list products (prices) from the server that we can display on the product selection screen.
 void onSuccess()
          Called if the payment has been processed successfully and user's mobile account has been charged.
 

Method Detail

onProductsReceived

void onProductsReceived(java.util.List<com.txtnation.android.products.Product> products)
Called when we have received the list products (prices) from the server that we can display on the product selection screen.

Parameters:
products - an List of products returned from server so that user can select one of them.

onProductSelected

void onProductSelected(com.txtnation.android.products.Product product)
Called when a product (price) has been selected from the list of products returned from server. This is important if the developer wants to know what product has been selected by the user especially when the product selection screen is handled and displayed by TAL.

Parameters:
products - the selected product

onCancelled

void onCancelled()
Called when a user has cancelled the billing process from one of the dialogs shown by the billing manager.


onFailure

void onFailure(java.lang.String failureDetails)
Called when the payment transaction has failed. A payment transaction can failed for many reasons, see BillingManager#FailureTypes. String of these enums will be passed this method.

Parameters:
failure - The type of failure we have encountered.

onSuccess

void onSuccess()
Called if the payment has been processed successfully and user's mobile account has been charged.


onPaymentStateChanged

void onPaymentStateChanged(java.lang.String paymentState)
Called each time we have moved to a new state in the payment process. You can analyse the states for debug information or as part of your own progress indicators. TAL does not expect your application to do further communication as a result of an update passed through method. To see the full list of Payment states. Here are the full list of payment states and their order

Parameters:
state - The current Payment State of the current transaction