Class Token
-
- All Implemented Interfaces:
-
android.os.Parcelable,java.lang.Cloneable
public class Token implements Parcelable, Cloneable
Represents the token, providing access to the token id, payment brand and Card or BankAccount depends of token type.
-
-
Field Summary
Fields Modifier and Type Field Description public final StringtokenIdpublic final StringpaymentBrandpublic final Cardcardpublic final BankAccountbankAccountpublic final VirtualAccountvirtualAccountpublic final static Parcelable.Creator<Token>CREATOR
-
Constructor Summary
Constructors Constructor Description Token(String tokenId, String paymentBrand, Card card)Constructs the token with token id, payment brand and Card. Token(String tokenId, String paymentBrand, BankAccount bankAccount)Constructs the token with token id, payment brand and BankAccount. Token(String tokenId, String paymentBrand, VirtualAccount virtualAccount)Constructs the token with token id, payment brand and VirtualAccount.
-
Method Summary
Modifier and Type Method Description StringgetTokenId()Returns the token id. StringgetPaymentBrand()Returns the payment brand. CardgetCard()Returns the Card if token contains it, otherwise null. BankAccountgetBankAccount()Returns the BankAccount if token contains it, otherwise null. VirtualAccountgetVirtualAccount()Returns the VirtualAccount if token contains it, otherwise null. static TokencreateTokenFromJSON(@NonNull() JSONObject jsonObject)Not used anymore. intdescribeContents()voidwriteToParcel(@NonNull() Parcel dest, int flags)TokencopyToken(@NonNull() Token token)booleanequals(Object o)inthashCode()Tokenclone()-
-
Constructor Detail
-
Token
Token(String tokenId, String paymentBrand, Card card)
Constructs the token with token id, payment brand and Card.- Parameters:
tokenId- The token valuepaymentBrand- The payment brand associated with tokencard- The card payment information associated with token Card
-
Token
Token(String tokenId, String paymentBrand, BankAccount bankAccount)
Constructs the token with token id, payment brand and BankAccount.- Parameters:
tokenId- The token valuepaymentBrand- The payment brand associated with a tokenbankAccount- The bank account information associated with a token BankAccount
-
Token
Token(String tokenId, String paymentBrand, VirtualAccount virtualAccount)
Constructs the token with token id, payment brand and VirtualAccount.- Parameters:
tokenId- The token valuepaymentBrand- The payment brand associated with a tokenvirtualAccount- The virtual account information associated with a token VirtualAccount
-
-
Method Detail
-
getTokenId
@NonNull() String getTokenId()
Returns the token id.
- Returns:
the token id
-
getPaymentBrand
@NonNull() String getPaymentBrand()
Returns the payment brand.
- Returns:
the payment brand
-
getCard
@Nullable() Card getCard()
Returns the Card if token contains it, otherwise null.
- Returns:
the Card if token contains it, otherwise null
-
getBankAccount
@Nullable() BankAccount getBankAccount()
Returns the BankAccount if token contains it, otherwise null.
- Returns:
the BankAccount if token contains it, otherwise null
-
getVirtualAccount
@Nullable() VirtualAccount getVirtualAccount()
Returns the VirtualAccount if token contains it, otherwise null.
- Returns:
the VirtualAccount if token contains it, otherwise null
-
createTokenFromJSON
@Deprecated()@Nullable() static Token createTokenFromJSON(@NonNull() JSONObject jsonObject)
Not used anymore.
- Parameters:
jsonObject- the JSON object representing a token- Returns:
the Token
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
hashCode
int hashCode()
-
-
-
-