CardInfo
Stay organized with collections
Save and categorize content based on your preferences.
Parcelable representing more detailed information about a payment card.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Method Summary
UserAddress |
|
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
|
|
String
|
|
void |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Methods
public UserAddress
getBillingAddress
()
Returns
- 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 notbe 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.
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
- 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
notbe 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.
public String
getCardNetwork
()
Gets the card network of the selected card. Card network has a finite set of values.
This card network should notbe 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
- the card network of the buyer's selected card.
public void
writeToParcel
( Parcel
out, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eCardInfo\u003c/code\u003e provides detailed information about a payment card, including billing address, card class, description, last four digits, and network.\u003c/p\u003e\n"],["\u003cp\u003eIt's a Parcelable object, meaning it can be passed between Android components.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetCardDescription()\u003c/code\u003e returns a user-facing message describing the card, which should be displayed to the user.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetCardDetails()\u003c/code\u003e, \u003ccode\u003egetCardNetwork()\u003c/code\u003e, and \u003ccode\u003egetCardClass()\u003c/code\u003e provide card details for internal use, not for displaying directly to the user.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetBillingAddress()\u003c/code\u003e returns the billing address if it was requested during payment setup.\u003c/p\u003e\n"]]],[],null,["# CardInfo\n\npublic final class **CardInfo** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nParcelable representing more detailed information about a payment card. \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[CardInfo](/android/reference/com/google/android/gms/wallet/CardInfo)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/wallet/CardInfo#CREATOR) | |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| UserAddress | [getBillingAddress](/android/reference/com/google/android/gms/wallet/CardInfo#getBillingAddress())() Gets the billing address associated with buyer's payment card. |\n| int | [getCardClass](/android/reference/com/google/android/gms/wallet/CardInfo#getCardClass())() Gets the card class which can be either credit, debit or prepaid. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getCardDescription](/android/reference/com/google/android/gms/wallet/CardInfo#getCardDescription())() Gets a user-facing message to describe the card selected for funding this payment transaction. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getCardDetails](/android/reference/com/google/android/gms/wallet/CardInfo#getCardDetails())() Gets the last four digits of the selected card. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getCardNetwork](/android/reference/com/google/android/gms/wallet/CardInfo#getCardNetwork())() Gets the card network of the selected card. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/wallet/CardInfo#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[CardInfo](/android/reference/com/google/android/gms/wallet/CardInfo)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public UserAddress **getBillingAddress** ()\n\nGets the billing address associated with buyer's payment card.\n\nNote this billing address will only be populated when billing address is set as\nrequired through [CardRequirements.Builder.setBillingAddressRequired(boolean)](/android/reference/com/google/android/gms/wallet/CardRequirements.Builder#setBillingAddressRequired(boolean)). Also, the\nbilling address' appearance depends on the optional setting in [CardRequirements.Builder.setBillingAddressFormat(int)](/android/reference/com/google/android/gms/wallet/CardRequirements.Builder#setBillingAddressFormat(int)) \n\n##### Returns\n\n- the billing address if requested, or `null` otherwise. \n\n#### public int **getCardClass** ()\n\nGets the card class which can be either credit, debit or prepaid. See [WalletConstants.CardClass](/android/reference/com/google/android/gms/wallet/WalletConstants.CardClass)\nfor the expected card class values. This class **should not** be displayed\nto the buyer, but can be used when the details of a buyer's card are needed. An example\nwould be selecting a processor that gives better interchange rates or applying a\ndiscount depending on the card class. \n\n##### Returns\n\n- [WalletConstants.CardClass](/android/reference/com/google/android/gms/wallet/WalletConstants.CardClass) of the buyer's selected card, but can be unknown if it can not be determined. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getCardDescription** ()\n\nGets a user-facing message to describe the card selected for funding this payment\ntransaction. You are required to show this to inform the buyer of their funding source.\nPlease refer to the [documentation](//developers.google.com/pay/api/android/guides/brand-guidelines) for\nmore information.\n\n**IMPORTANT:** Do not attempt to parse the contents of this string as\nthe format, contents and length may change at any time. If you need finer grain\ndetails, see [getCardNetwork()](/android/reference/com/google/android/gms/wallet/CardInfo#getCardNetwork()),\n[getCardDetails()](/android/reference/com/google/android/gms/wallet/CardInfo#getCardDetails()),\nand [getCardClass()](/android/reference/com/google/android/gms/wallet/CardInfo#getCardClass())\nfor stable card information. \n\n##### Returns\n\n- a user-facing message about the selected card used for payment. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getCardDetails** ()\n\nGets the last four digits of the selected card. These details **should\nnot** be displayed to the buyer, but can be used when the details of a buyer's\ncard are needed. An example would be for customer support to help the buyer identify\nthe card used for this transaction. \n\n##### Returns\n\n- the card details. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getCardNetwork** ()\n\nGets the card network of the selected card. Card network has a finite set of values.\nThis card network **should not** be displayed to the buyer, but can be\nused when the details of a buyer's card are needed. An example would be for customer\nsupport to help the buyer identify the card used for this transaction.\n\nYou can rely on the card network not changing once it is defined for a given card in\na transaction (i.e. purchasing with a single Visa card will always return VISA).\n\nExamples of currently expected values for elements returned are:\n\n- VISA\n- MASTERCARD\n- DISCOVER\n- AMEX \n\n##### Returns\n\n- the card network of the buyer's selected card. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]