public class PaymentButton
extends android.app.Fragment
implements android.view.View.OnClickListener
Created PaymentMethodNonces will be posted to PaymentMethodNonceCreatedListener.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG |
| Constructor and Description |
|---|
PaymentButton() |
| Modifier and Type | Method and Description |
|---|---|
static PaymentButton |
newInstance(android.app.Activity activity,
int containerViewId,
PaymentRequest paymentRequest)
Create a new instance of
PaymentButton using the CheckoutRequest and add it
to the Activity's FragmentManager. |
void |
onActivityCreated(android.os.Bundle savedInstanceState) |
void |
onClick(android.view.View v) |
void |
onConfigurationFetched(Configuration configuration) |
void |
onCreate(android.os.Bundle savedInstanceState) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onInflate(android.app.Activity activity,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState) |
void |
onInflate(android.content.Context context,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState) |
void |
onResponse(java.lang.Exception exception) |
void |
setOnClickListener(android.view.View.OnClickListener listener)
Set the on click listener to be called when the
PaymentButton is clicked. |
void |
setPaymentRequest(PaymentRequest paymentRequest)
Initialize the
PaymentButton. |
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, hashCode, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isRemoving, isResumed, isVisible, onActivityResult, onAttach, onAttach, onConfigurationChanged, onContextItemSelected, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onDestroyView, onDetach, onHiddenChanged, onInflate, onLowMemory, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPrepareOptionsMenu, onRequestPermissionsResult, onResume, onSaveInstanceState, onStart, onStop, onTrimMemory, onViewCreated, onViewStateRestored, registerForContextMenu, requestPermissions, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, toString, unregisterForContextMenupublic static final java.lang.String TAG
public static PaymentButton newInstance(android.app.Activity activity, int containerViewId, PaymentRequest paymentRequest) throws InvalidArgumentException
PaymentButton using the CheckoutRequest and add it
to the Activity's FragmentManager.activity - The Activity to add the Fragment to.paymentRequest - The PaymentRequest to use to configure the
PaymentButton. *Note:* This CheckoutRequest must include a client key
or client token.containerViewId - Optional identifier of the container this fragment is to be placed in.
If 0, it will not be placed in a container.PaymentButtonInvalidArgumentException - If the client key or tokenization key is not valid or
cannot be parsed.public void onInflate(android.app.Activity activity,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState)
onInflate in class android.app.Fragmentpublic void onInflate(android.content.Context context,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState)
onInflate in class android.app.Fragmentpublic void onCreate(android.os.Bundle savedInstanceState)
onCreate in class android.app.Fragmentpublic android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
onCreateView in class android.app.Fragmentpublic void onActivityCreated(android.os.Bundle savedInstanceState)
onActivityCreated in class android.app.Fragmentpublic void setPaymentRequest(PaymentRequest paymentRequest) throws InvalidArgumentException
PaymentButton. This method *MUST* be called if the PaymentButton was adding using XML or PaymentButton will not be displayed.paymentRequest - PaymentRequest containing payment method options.InvalidArgumentExceptionpublic void setOnClickListener(android.view.View.OnClickListener listener)
PaymentButton is clicked.listener - View.OnClickListener to be called.public void onConfigurationFetched(Configuration configuration)
public void onResponse(java.lang.Exception exception)
public void onClick(android.view.View v)
onClick in interface android.view.View.OnClickListener