CardRequirements.Builder

public final class CardRequirements.Builder extends Object

Builder to create a CardRequirements.

Public Method Summary

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
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.

Inherited Method Summary

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).

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).

public CardRequirements build ()

Returns
  • 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.

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.

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).