CardRequirements.Builder | Doclava
public final class

CardRequirements.Builder

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

Class Overview

Builder to create a CardRequirements.

Summary

Public Methods
CardRequirements.Builder addAllowedCardNetwork(int allowedCardNetwork)
Adds a card network supported for this purchase.
CardRequirements.Builder addAllowedCardNetworks(Collection<Integer> allowedCardNetworks)
Adds a set of card networks supported for this purchase.
CardRequirements build()
CardRequirements.Builder setAllowPrepaidCards(boolean allowPrepaidCards)
Sets whether a prepaid card may be used for this transaction.
CardRequirements.Builder setBillingAddressFormat(int billingAddressFormat)
Sets billing address format.
CardRequirements.Builder setBillingAddressRequired(boolean billingAddressRequired)
Sets whether a billing address is required from the buyer.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public CardRequirements.Builder addAllowedCardNetwork (int allowedCardNetwork)

Adds a card network supported for this purchase. See WalletConstants.CardNetwork for available options.

Allowed card networks must be explicitly set using either this method or addAllowedCardNetworks(Collection).

Parameters
allowedCardNetwork int

Returns
CardRequirements.Builder

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

Adds a set of card networks supported for this purchase. See WalletConstants.CardNetwork for available options.

Allowed card networks must be explicitly set using either this method or addAllowedCardNetwork(int).

Parameters
allowedCardNetworks Collection

Returns
CardRequirements.Builder

public CardRequirements build ()

Returns
CardRequirements the actual CardRequirements created using the data passed to the Builder object.

public CardRequirements.Builder setAllowPrepaidCards (boolean allowPrepaidCards)

Sets whether a prepaid card may be used for this transaction. If omitted, defaults to true.

Parameters
allowPrepaidCards boolean

Returns
CardRequirements.Builder

public CardRequirements.Builder setBillingAddressFormat (int billingAddressFormat)

Sets billing address format. See WalletConstants.BillingAddressFormat for more info. If omitted, defaults to BILLING_ADDRESS_FORMAT_MIN.

Note that you should only set the format to BILLING_ADDRESS_FORMAT_FULL when it's required to process the order since it can increase friction during the checkout process and can lead to a lower conversion rate.

Parameters
billingAddressFormat int

Returns
CardRequirements.Builder

public CardRequirements.Builder setBillingAddressRequired (boolean billingAddressRequired)

Sets whether a billing address is required from the buyer. The returned billing address can be retrieved by getBillingAddress() in getCardInfo(). If omitted, defaults to false.

Optionally, when a billing address is required, extra format requirements can be set through setBillingAddressFormat(int).

Parameters
billingAddressRequired boolean

Returns
CardRequirements.Builder