-
- 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 private final String
tokenId
private final String
paymentBrand
private final Card
card
private final BankAccount
bankAccount
private final VirtualAccount
virtualAccount
public 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 String
getTokenId()
Returns the token id. String
getPaymentBrand()
Returns the payment brand. Card
getCard()
Returns the Card if token contains it, otherwise null. BankAccount
getBankAccount()
Returns the BankAccount if token contains it, otherwise null. VirtualAccount
getVirtualAccount()
Returns the VirtualAccount if token contains it, otherwise null. static Token
createTokenFromJSON(@NonNull() JSONObject jsonObject)
Not used anymore. int
describeContents()
void
writeToParcel(@NonNull() Parcel dest, int flags)
Token
copyToken(@NonNull() Token token)
boolean
equals(Object o)
int
hashCode()
Token
clone()
-
-
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.
-
getPaymentBrand
@NonNull() String getPaymentBrand()
Returns the payment brand.
-
getBankAccount
@Nullable() BankAccount getBankAccount()
Returns the BankAccount if token contains it, otherwise null.
-
getVirtualAccount
@Nullable() VirtualAccount getVirtualAccount()
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
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(@NonNull() Parcel dest, int flags)
-
hashCode
int hashCode()
-
-
-
-