public final class

CardInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ com.google.android.gms.wallet.CardInfo

Class Overview

Parcelable representing more detailed information about a payment card.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<CardInfo> CREATOR
Public Methods
UserAddress getBillingAddress()
Gets the billing address associated with buyer's payment card.
int getCardClass()
Gets the card class which can be either credit, debit or prepaid.
String getCardDescription()
Gets a user-facing message to describe the card selected for funding this payment transaction.
String getCardDetails()
Gets the last four digits of the selected card.
String getCardNetwork()
Gets the card network of the selected card.
void writeToParcel(Parcel out, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<CardInfo> CREATOR

Public Methods

public UserAddress getBillingAddress ()

Gets the billing address associated with buyer's payment card.

Note this billing address will only be populated when billing address is set as required through setBillingAddressRequired(boolean). Also, how the billing address will look like also depends on the optional setting in setBillingAddressFormat(int)

Returns
UserAddress the billing address if requested, or null otherwise.

public int getCardClass ()

Gets the card class which can be either credit, debit or prepaid. See WalletConstants.CardClass for the expected card class values. This class should not be displayed to the buyer, but can be used when the details of a buyer's card are needed. An example would be selecting a processor that gives better interchange rates or applying a discount depending on the card class.

Returns
int WalletConstants.CardClass of the buyer's selected card, but can be unknown if it can not be determined.

public String getCardDescription ()

Gets a user-facing message to describe the card selected for funding this payment transaction. You are required to show this to inform the buyer of their funding source. Please refer to the documentation for more information.

IMPORTANT: Do not attempt to parse the contents of this string as the format, contents and length may change at any time. If you need finer grain details, see getCardNetwork(), getCardDetails(), and getCardClass() for stable card information.

Returns
String a user-facing message about the selected card used for payment.

public String getCardDetails ()

Gets the last four digits of the selected card. These details should not be displayed to the buyer, but can be used when the details of a buyer's card are needed. An example would be for customer support to help the buyer identify the card used for this transaction.

Returns
String the card details.

public String getCardNetwork ()

Gets the card network of the selected card. Card network has a finite set of values. This card network should not be displayed to the buyer, but can be used when the details of a buyer's card are needed. An example would be for customer support to help the buyer identify the card used for this transaction.

You can rely on the card network not changing once it is defined for a given card in a transaction (i.e. purchasing with a single Visa card will always return VISA).

Examples of currently expected values for elements returned are:

  • VISA
  • MASTERCARD
  • DISCOVER
  • AMEX

Returns
String the card network of the buyer's selected card.

public void writeToParcel (Parcel out, int flags)

Parameters
out Parcel
flags int