InstrumentInfo
Stay organized with collections
Save and categorize content based on your preferences.
Parcelable representing more detailed information about a payment instrument.
Nested Class Summary
@interface
Card class indicates whether it is a credit,
debit or prepaid card.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Constants
public static final int
CARD_CLASS_CREDIT
public static final int
CARD_CLASS_DEBIT
public static final int
CARD_CLASS_PREPAID
public static final int
CARD_CLASS_UNKNOWN
Public Methods
public int
getCardClass
()
Class of a card that is either credit, debit or prepaid. See InstrumentInfo.CardClass
for the expected card class values. This class should notbe displayed
to the user, but can be used when the details of a user's instrument are needed. An
example would be selecting a processor that gives better interchange rates for certain
card classes or applying a discount based on the card class.
Note that class unknown may be returned if it can not be determined. Also, class
will only be populated for the cards with InstrumentType VISA, MASTERCARD, DISCOVER,
AMEX (See getInstrumentType()
for all expected InstrumentType).
public String
getInstrumentDetails
()
Details of an instrument that has a finite set of formats. These details should notbe displayed to the user, but can be used when the details
of a user's instrument are needed. An example would be a customer support call when the
user only knows that one of their credit cards were charged.
You can rely on the format of instrument details not changing once it is defined for
a given form of payment in a transaction (i.e. Instrument details of a credit card are
always the last four digits of the card). However, you should be able to handle new
formats that could be introduced in the future (i.e. when support is added for a new
form of payment where last four credit card digits has no meaning and other information
is returned).
Current expected formats for elements of this array are:
- Credit cards return the last four digits of the card selected
Returns
- instrument details that will not be null, but can be the empty string
public String
getInstrumentType
()
Type of an instrument that has a finite set of values. This type should
notbe displayed to the user, but can be used when the details of a user's
instrument are needed. An example would be a customer support call when the user only
knows that one of their credit cards were charged.
You can rely on an instrument type not changing once it is defined for a given
instrument in a transaction (i.e. purchasing with a single Visa card will always return
VISA). However, you should be able to handle elements that are not defined in the
expected list below (i.e. when support is added for a new form of payment not listed
below).
Current expected values for elements of this array are:
- VISA
- MASTERCARD
- DISCOVER
- AMEX
Returns
- an instrument type that will be non-empty
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\u003eInstrumentInfo\u003c/code\u003e provides detailed information about a payment instrument, like a credit card, for use in Android applications.\u003c/p\u003e\n"],["\u003cp\u003eIt includes details like card class (credit, debit, prepaid), instrument type (Visa, Mastercard, etc.), and instrument details (e.g., last four digits for credit cards).\u003c/p\u003e\n"],["\u003cp\u003eThese details are not meant for direct display to users but for internal use, such as customer support or payment processing.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should be prepared to handle potential new formats and instrument types that may be added in the future.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInstrumentInfo\u003c/code\u003e class implements \u003ccode\u003eParcelable\u003c/code\u003e for easy data transfer between components.\u003c/p\u003e\n"]]],[],null,["# InstrumentInfo\n\npublic final class **InstrumentInfo** 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 instrument. \n\n### Nested Class Summary\n\n|------------|---|---|---------------------------------------------------------------------|\n| @interface | [InstrumentInfo.CardClass](/android/reference/com/google/android/gms/wallet/InstrumentInfo.CardClass) || Card class indicates whether it is a credit, debit or prepaid card. |\n\n### Constant Summary\n\n|-----|----------------------------------------------------------------------------------------------------------|---|\n| int | [CARD_CLASS_CREDIT](/android/reference/com/google/android/gms/wallet/InstrumentInfo#CARD_CLASS_CREDIT) | |\n| int | [CARD_CLASS_DEBIT](/android/reference/com/google/android/gms/wallet/InstrumentInfo#CARD_CLASS_DEBIT) | |\n| int | [CARD_CLASS_PREPAID](/android/reference/com/google/android/gms/wallet/InstrumentInfo#CARD_CLASS_PREPAID) | |\n| int | [CARD_CLASS_UNKNOWN](/android/reference/com/google/android/gms/wallet/InstrumentInfo#CARD_CLASS_UNKNOWN) | |\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[InstrumentInfo](/android/reference/com/google/android/gms/wallet/InstrumentInfo)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/wallet/InstrumentInfo#CREATOR) | |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int | [getCardClass](/android/reference/com/google/android/gms/wallet/InstrumentInfo#getCardClass())() Class of a card that is either credit, debit or prepaid. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getInstrumentDetails](/android/reference/com/google/android/gms/wallet/InstrumentInfo#getInstrumentDetails())() Details of an instrument that has a finite set of formats. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getInstrumentType](/android/reference/com/google/android/gms/wallet/InstrumentInfo#getInstrumentType())() Type of an instrument that has a finite set of values. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/wallet/InstrumentInfo#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\nConstants\n---------\n\n#### public static final int\n**CARD_CLASS_CREDIT**\n\nConstant Value: 1 \n\n#### public static final int\n**CARD_CLASS_DEBIT**\n\nConstant Value: 2 \n\n#### public static final int\n**CARD_CLASS_PREPAID**\n\nConstant Value: 3 \n\n#### public static final int\n**CARD_CLASS_UNKNOWN**\n\nConstant Value: 0\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[InstrumentInfo](/android/reference/com/google/android/gms/wallet/InstrumentInfo)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public int **getCardClass** ()\n\nClass of a card that is either credit, debit or prepaid. See [InstrumentInfo.CardClass](/android/reference/com/google/android/gms/wallet/InstrumentInfo.CardClass)\nfor the expected card class values. This class **should not** be displayed\nto the user, but can be used when the details of a user's instrument are needed. An\nexample would be selecting a processor that gives better interchange rates for certain\ncard classes or applying a discount based on the card class.\n\nNote that class unknown may be returned if it can not be determined. Also, class\nwill only be populated for the cards with InstrumentType VISA, MASTERCARD, DISCOVER,\nAMEX (See [getInstrumentType()](/android/reference/com/google/android/gms/wallet/InstrumentInfo#getInstrumentType()) for all expected InstrumentType). \n\n##### Returns\n\n- [InstrumentInfo.CardClass](/android/reference/com/google/android/gms/wallet/InstrumentInfo.CardClass) of the instrument. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getInstrumentDetails** ()\n\nDetails of an instrument that has a finite set of formats. These details\n**should not** be displayed to the user, but can be used when the details\nof a user's instrument are needed. An example would be a customer support call when the\nuser only knows that one of their credit cards were charged.\n\nYou can rely on the format of instrument details not changing once it is defined for\na given form of payment in a transaction (i.e. Instrument details of a credit card are\nalways the last four digits of the card). However, you should be able to handle new\nformats that could be introduced in the future (i.e. when support is added for a new\nform of payment where last four credit card digits has no meaning and other information\nis returned).\n\nCurrent expected formats for elements of this array are:\n\n- Credit cards return the last four digits of the card selected \n\n##### Returns\n\n- instrument details that will not be null, but can be the empty string \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getInstrumentType** ()\n\nType of an instrument that has a finite set of values. This type **should\nnot** be displayed to the user, but can be used when the details of a user's\ninstrument are needed. An example would be a customer support call when the user only\nknows that one of their credit cards were charged.\n\nYou can rely on an instrument type not changing once it is defined for a given\ninstrument in a transaction (i.e. purchasing with a single Visa card will always return\nVISA). However, you should be able to handle elements that are not defined in the\nexpected list below (i.e. when support is added for a new form of payment not listed\nbelow).\n\nCurrent expected values for elements of this array are:\n\n- VISA\n- MASTERCARD\n- DISCOVER\n- AMEX \n\n##### Returns\n\n- an instrument type that will be non-empty \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]