public final class

IsReadyToPayRequest.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.wallet.IsReadyToPayRequest.Builder

Class Overview

Builder for creating an IsReadyToPayRequest.

Summary

Public Methods
IsReadyToPayRequest.Builder addAllowedCardNetwork(int allowedCardNetwork)
Adds a card network for cards allowed in the purchase.
IsReadyToPayRequest.Builder addAllowedCardNetworks(Collection<Integer> allowedCardNetworks)
Adds a collection of card networks for cards allowed in the purchase.
IsReadyToPayRequest.Builder addAllowedPaymentMethod(int allowedPaymentMethod)
Adds an allowed payment method.
IsReadyToPayRequest.Builder addAllowedPaymentMethods(Collection<Integer> allowedPaymentMethods)
Adds a collection of allowed payment methods.
IsReadyToPayRequest build()
IsReadyToPayRequest.Builder setExistingPaymentMethodRequired(boolean existingPaymentMethodRequired)
If set to true, then IsReadyToPay will only return true if the user has an existing payment method that matches the other criteria specified in the IsReadyToPayRequest.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public IsReadyToPayRequest.Builder addAllowedCardNetwork (int allowedCardNetwork)

Adds a card network for cards allowed in the purchase. See WalletConstants.CardNetwork for available options. If not explicitly set via this or addAllowedCardNetworks(Collection), the default supported networks will be CARD_NETWORK_AMEX, CARD_NETWORK_DISCOVER, CARD_NETWORK_MASTERCARD, and CARD_NETWORK_VISA.

Parameters
allowedCardNetwork int
Returns
IsReadyToPayRequest.Builder

public IsReadyToPayRequest.Builder addAllowedCardNetworks (Collection<Integer> allowedCardNetworks)

Adds a collection of card networks for cards allowed in the purchase. See WalletConstants.CardNetwork for available options. If not explicitly set via this or addAllowedCardNetwork(int), the default supported networks will be CARD_NETWORK_AMEX, CARD_NETWORK_DISCOVER, CARD_NETWORK_MASTERCARD, and CARD_NETWORK_VISA.

Parameters
allowedCardNetworks Collection
Returns
IsReadyToPayRequest.Builder

public IsReadyToPayRequest.Builder addAllowedPaymentMethod (int allowedPaymentMethod)

Adds an allowed payment method. See WalletConstants.PaymentMethod for available options. If not explicitly set via this or addAllowedPaymentMethods(Collection), then the default allowed payment method will be PAYMENT_METHOD_TOKENIZED_CARD.

Parameters
allowedPaymentMethod int
Returns
IsReadyToPayRequest.Builder

public IsReadyToPayRequest.Builder addAllowedPaymentMethods (Collection<Integer> allowedPaymentMethods)

Adds a collection of allowed payment methods. See WalletConstants.PaymentMethod for available options. If not explicitly set via this or addAllowedPaymentMethod(int), then the default allowed payment method will be PAYMENT_METHOD_TOKENIZED_CARD.

Parameters
allowedPaymentMethods Collection
Returns
IsReadyToPayRequest.Builder

public IsReadyToPayRequest build ()

Returns
IsReadyToPayRequest The actual IsReadyToPayRequest created using the data passed to the Builder object.

public IsReadyToPayRequest.Builder setExistingPaymentMethodRequired (boolean existingPaymentMethodRequired)

If set to true, then IsReadyToPay will only return true if the user has an existing payment method that matches the other criteria specified in the IsReadyToPayRequest.

If you set this to true, make sure to call isReadyToPay(GoogleApiClient) as early as possible in your flow as the call may take longer to resolve due to the extra check for an existing payment method.

Parameters
existingPaymentMethodRequired boolean
Returns
IsReadyToPayRequest.Builder