-
- 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>
mobilePhone
private Array<byte>
countryCode
private BillingAddress
billingAddress
private boolean
isTokenizationEnabled
public 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 void
setMobilePhone(@Nullable() String mobilePhone)
void
setCountryCode(@Nullable() String countryCode)
BillingAddress
getBillingAddress()
Returns the billing address of the customer. PaymentParams
setBillingAddress(@Nullable() BillingAddress billingAddress)
Sets the billing address of the customer. boolean
isTokenizationEnabled()
Returns tokenization flag. CardPaymentParams
setTokenizationEnabled(boolean tokenizationEnabled)
Sets tokenization flag. static boolean
isCountryCodeValid(@Nullable() String countryCode)
static boolean
isHolderValid(@Nullable() String holder)
static boolean
isNumberValid(@Nullable() String cardNumber, boolean luhnCheck)
Checks if card number is valid static boolean
isExpiryMonthValid(@Nullable() String expiryMonth)
static boolean
isExpiryYearValid(@Nullable() String expiryYear)
static boolean
isCardExpired(@Nullable() String cardExpiryMonth, @Nullable() String cardExpiryYear)
static boolean
isMobilePhoneNumberValid(@Nullable() String mobilePhoneNumber)
Checks if mobile phone is valid. void
mask()
Map<String, String>
getParamsForRequest()
Returns a map of all parameters needed for card transaction. int
describeContents()
void
writeToParcel(Parcel dest, int flags)
boolean
equals(Object o)
int
hashCode()
-
-
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()
-
-
-
-