BasePaymentDataCallbacksService

public abstract class BasePaymentDataCallbacksService extends Service

Base service class which hosts the payment data callbacks initiated by Google Play services within a PaymentsClient.loadPaymentData(PaymentDataRequest).

The callbacks are implemented through a subclass of BasePaymentDataCallbacks returned by subclasses of this service in the createPaymentDataCallbacks().

Constant Summary

int MESSAGE_RESULT
String MESSAGE_TASK_TAG

Inherited Constant Summary

Public Constructor Summary

Public Method Summary

IBinder
onBind(Intent intent)
void

Protected Method Summary

abstract BasePaymentDataCallbacks
createPaymentDataCallbacks()
Returns an implementation of BasePaymentDataCallbacks to handle the incoming callbacks.
final void
onRunTask(String tag, CallbackInput callbackInput, OnCompleteListener<CallbackOutput> onCompleteListener)
Runs the task and creates a response with the merchant callback instance created by createPaymentDataCallbacks() method.

Inherited Method Summary

Constants

public static final int MESSAGE_RESULT

Constant Value: 1

public static final String MESSAGE_TASK_TAG

Constant Value: "message_task_tag"

Public Constructors

public BasePaymentDataCallbacksService ()

Public Methods

public IBinder onBind (Intent intent)

public void onCreate ()

Protected Methods

protected abstract BasePaymentDataCallbacks createPaymentDataCallbacks ()

Returns an implementation of BasePaymentDataCallbacks to handle the incoming callbacks.

Note that createPaymentDataCallbacks will be called once per callback and it is recommended that you create a new instance on every createPaymentDataCallbacks call.

If your callbacks need to keep the state, we recommend that you use the saved state facilities provided in the inputs/outputs of the callback methods. See PaymentDataRequest.withSavedState(Bundle) for more details. Avoid at all costs to keep state in the service class because it and/or your app process may be destroyed between multiple invocations of the callbacks if the Android system is under the memory pressure.

protected final void onRunTask (String tag, CallbackInput callbackInput, OnCompleteListener<CallbackOutput> onCompleteListener)

Runs the task and creates a response with the merchant callback instance created by createPaymentDataCallbacks() method.