public class GooglePayClient
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
EXTRA_ENVIRONMENT |
protected static java.lang.String |
EXTRA_PAYMENT_DATA_REQUEST |
| Constructor and Description |
|---|
GooglePayClient(BraintreeClient braintreeClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
getTokenizationParameters(FragmentActivity activity,
GooglePayGetTokenizationParametersCallback callback)
Get Braintree specific tokenization parameters for a Google Pay.
|
void |
isReadyToPay(FragmentActivity activity,
GooglePayIsReadyToPayCallback callback)
Before starting the Google Pay flow, use this method to check whether the
Google Pay API is supported and set up on the device.
|
void |
isReadyToPay(FragmentActivity activity,
ReadyForGooglePayRequest request,
GooglePayIsReadyToPayCallback callback)
Before starting the Google Pay flow, use this method to check whether the
Google Pay API is supported and set up on the device.
|
void |
onActivityResult(FragmentActivity activity,
int resultCode,
android.content.Intent data,
GooglePayOnActivityResultCallback callback) |
void |
requestPayment(FragmentActivity activity,
GooglePayRequest request,
GooglePayRequestPaymentCallback callback)
Launch a Google Pay request.
|
void |
tokenize(FragmentActivity activity,
PaymentData paymentData,
GooglePayOnActivityResultCallback callback)
Call this method when you've received a successful
PaymentData response in your
activity or fragment's onActivityResult method to get a GooglePayCardNonce
or PayPalAccountNonce. |
protected static final java.lang.String EXTRA_ENVIRONMENT
protected static final java.lang.String EXTRA_PAYMENT_DATA_REQUEST
public void isReadyToPay(FragmentActivity activity,
GooglePayIsReadyToPayCallback callback)
true, show the Google Pay button. When it is called with false, display other
checkout options.activity - Android FragmentActivitycallback - GooglePayIsReadyToPayCallbackpublic void isReadyToPay(FragmentActivity activity,
ReadyForGooglePayRequest request,
GooglePayIsReadyToPayCallback callback)
true, show the Google Pay button. When it is called with false, display other
checkout options.activity - Android FragmentActivityrequest - ReadyForGooglePayRequestcallback - GooglePayIsReadyToPayCallbackpublic void getTokenizationParameters(FragmentActivity activity,
GooglePayGetTokenizationParametersCallback callback)
PaymentDataRequest is required.
PaymentMethodTokenizationParameters should be supplied to the PaymentDataRequest via
PaymentDataRequest.Builder#setPaymentMethodTokenizationParameters(PaymentMethodTokenizationParameters)
and allowedCardNetworks should be supplied to the CardRequirements via
CardRequirements.Builder#addAllowedCardNetworks(Collection)}.
activity - Android FragmentActivitycallback - GooglePayGetTokenizationParametersCallbackpublic void requestPayment(FragmentActivity activity,
GooglePayRequest request,
GooglePayRequestPaymentCallback callback)
activity - Android FragmentActivityrequest - The GooglePayRequest containing options for the transaction.callback - GooglePayRequestPaymentCallbackpublic void tokenize(FragmentActivity activity,
PaymentData paymentData,
GooglePayOnActivityResultCallback callback)
PaymentData response in your
activity or fragment's onActivityResult method to get a GooglePayCardNonce
or PayPalAccountNonce.activity - Android FragmentActivitypaymentData - PaymentData from the Intent in onActivityResult method.callback - GooglePayOnActivityResultCallbackpublic void onActivityResult(FragmentActivity activity,
int resultCode,
android.content.Intent data,
GooglePayOnActivityResultCallback callback)
activity - Android ActivityresultCode - a code associated with the Activity resultdata - Android Intentcallback - GooglePayOnActivityResultCallback