-
- All Implemented Interfaces:
-
android.os.Parcelable
public class CardPaymentParams extends BaseCardPaymentParams
Represents payment parameters for card payment brands.
-
-
Field Summary
Fields Modifier and Type Field Description private Array<byte>mobilePhoneprivate Array<byte>countryCodeprivate BillingAddressbillingAddressprivate booleanisTokenizationEnabledpublic final static Parcelable.Creator<CardPaymentParams>CREATOR
-
Constructor Summary
Constructors Constructor Description CardPaymentParams(String checkoutId, String paymentBrand, String number, String holder, String expiryMonth, String expiryYear, String cvv)Creates an object representing a card transaction. CardPaymentParams(String checkoutId, String number, String holder, String expiryMonth, String expiryYear, String cvv)Creates an object representing a card transaction without specifying a brand.
-
Method Summary
Modifier and Type Method Description voidsetMobilePhone(@Nullable() String mobilePhone)voidsetCountryCode(@Nullable() String countryCode)BillingAddressgetBillingAddress()Returns the billing address of the customer. PaymentParamssetBillingAddress(@Nullable() BillingAddress billingAddress)Sets the billing address of the customer. booleanisTokenizationEnabled()Returns tokenization flag. CardPaymentParamssetTokenizationEnabled(boolean tokenizationEnabled)Sets tokenization flag. static booleanisCountryCodeValid(@Nullable() String countryCode)static booleanisHolderValid(@Nullable() String holder)static booleanisNumberValid(@Nullable() String cardNumber, boolean luhnCheck)Checks if card number is valid static booleanisExpiryMonthValid(@Nullable() String expiryMonth)static booleanisExpiryYearValid(@Nullable() String expiryYear)static booleanisCardExpired(@Nullable() String cardExpiryMonth, @Nullable() String cardExpiryYear)static booleanisMobilePhoneNumberValid(@Nullable() String mobilePhoneNumber)Checks if mobile phone is valid. voidmask()Map<String, String>getParamsForRequest()Returns a map of all parameters needed for card transaction. intdescribeContents()voidwriteToParcel(Parcel dest, int flags)booleanequals(Object o)inthashCode()-
-
Constructor Detail
-
CardPaymentParams
CardPaymentParams(String checkoutId, String paymentBrand, String number, String holder, String expiryMonth, String expiryYear, String cvv)
Creates an object representing a card transaction.- Parameters:
checkoutId- The checkout ID of the transactionpaymentBrand- The payment brand, must be a card brandnumber- The card numberholder- The name of the card holderexpiryMonth- The expiration month of the card, it is expected in MM formatexpiryYear- The expiration year, it is expected in YYYY formatcvv- The CVV code associated with the card
-
CardPaymentParams
CardPaymentParams(String checkoutId, String number, String holder, String expiryMonth, String expiryYear, String cvv)
Creates an object representing a card transaction without specifying a brand.- Parameters:
checkoutId- The checkout ID of the transactionnumber- The card numberholder- The name of the card holderexpiryMonth- The expiration month of the card, it is expected in MM formatexpiryYear- The expiration year, it is expected in YYYY formatcvv- The CVV code associated with the card
-
-
Method Detail
-
setMobilePhone
void setMobilePhone(@Nullable() String mobilePhone)
-
setCountryCode
void setCountryCode(@Nullable() String countryCode)
-
getBillingAddress
@Nullable() BillingAddress getBillingAddress()
Returns the billing address of the customer.
-
setBillingAddress
PaymentParams setBillingAddress(@Nullable() BillingAddress billingAddress)
Sets the billing address of the customer.
- Parameters:
billingAddress- The billing address.
-
isTokenizationEnabled
boolean isTokenizationEnabled()
Returns tokenization flag. If true, the payment information will be stored for future use. Default value is false.
-
setTokenizationEnabled
@NonNull() CardPaymentParams setTokenizationEnabled(boolean tokenizationEnabled)
Sets tokenization flag. If true, the payment information will be stored for future use.
- Parameters:
tokenizationEnabled- The boolean value
-
isCountryCodeValid
static boolean isCountryCodeValid(@Nullable() String countryCode)
-
isHolderValid
static boolean isHolderValid(@Nullable() String holder)
-
isNumberValid
static boolean isNumberValid(@Nullable() String cardNumber, boolean luhnCheck)
Checks if card number is valid
- Parameters:
cardNumber- the card numberluhnCheck- use luhn check for validation or not
-
isExpiryMonthValid
static boolean isExpiryMonthValid(@Nullable() String expiryMonth)
-
isExpiryYearValid
static boolean isExpiryYearValid(@Nullable() String expiryYear)
-
isCardExpired
static boolean isCardExpired(@Nullable() String cardExpiryMonth, @Nullable() String cardExpiryYear)
-
isMobilePhoneNumberValid
static boolean isMobilePhoneNumberValid(@Nullable() String mobilePhoneNumber)
Checks if mobile phone is valid.
- Parameters:
mobilePhoneNumber- The mobile phone number value
-
mask
void mask()
-
getParamsForRequest
@NonNull() Map<String, String> getParamsForRequest()
Returns a map of all parameters needed for card transaction.
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
hashCode
int hashCode()
-
-
-
-