OPPCardPaymentParams
@objc
public final class OPPCardPaymentParams : OPPBaseCardPaymentParams
Class to represent a set of card parameters needed for performing an e-commerce card transaction.
It offers сonvenience methods for checking if the number is valid, i.e. if it passes the Luhn check and can be assigned to one of the major card companies.
After getting an authorization for the transaction the parameters are masked in accordance to PCI PA DSS requirements.
-
Holder of the card account. The length must be greater than 3 characters and less then 128 character.
Declaration
Swift
@objc public private(set) var holder: String? { get set } -
The card number. It may contain spaces
" "and dashes"-".Declaration
Swift
@objc public private(set) var number: String { get set } -
The card expiry month in the format
MM.Declaration
Swift
@objc public private(set) var expiryMonth: String? { get set } -
The card expiry year in the format
YYYY.Declaration
Swift
@objc public private(set) var expiryYear: String? { get set } -
The customer’s country code.
Declaration
Swift
@objc public var countryCode: String? { get set } -
The customer’s mobile number.
Declaration
Swift
@objc public var mobilePhone: String? { get set } -
Default is
false. Iftrue, the payment information will be stored for future use.Declaration
Swift
@objc public var isTokenizationEnabled: Bool -
The customer’s billing address.
Declaration
Swift
@objc public var address: OPPBillingAddress?
-
Creates an object representing a card transaction.
Throws
The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public init(checkoutID: String, paymentBrand: String?, holder: String?, number: String, expiryMonth: String?, expiryYear: String?, cvv: String?) throwsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.paymentBrandThe payment brand of the card.
holderThe name of the cardholder.
numberThe card number of the transaction.
expiryYearThe expiration year. It is expected in the format
YYYY.expiryMonthThe expiration month of the card. It is expected in the format
MM.cvvThe cvv code associated with the card. Set to
nilif CVV is not required. -
Creates an object representing a card transaction.
Throws
The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public convenience init(checkoutID: String, holder: String?, number: String, expiryMonth: String?, expiryYear: String?, cvv: String?) throwsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.holderThe name of the cardholder.
numberThe card number of the transaction.
expiryYearThe expiration year. It is expected in the format
YYYY.expiryMonthThe expiration month of the card. It is expected in the format
MM.CVVThe CVV code associated with the card. Set to
nilif CVV is not required. -
Creates an object representing a card transaction.
Throws
The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public static func cardPaymentParams(checkoutID: String, paymentBrand: String?, holder: String?, number: String, expiryMonth: String?, expiryYear: String?, cvv: String?) throws -> OPPCardPaymentParamsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.paymentBrandThe payment brand of the card.
holderThe name of the card holder.
numberThe card number of the transaction.
expiryYearThe expiration year. It is expected in the format
YYYY.expiryMonthThe expiration month of the card. It is expected in the format
MM.cvvThe CVV code associated with the card. Set to
nilif CVV is not required. -
Creates an object representing a card transaction without specifying a brand. Use it only with BIP settings ‘automatic brand detection’ activated.
Throws
The error that occurred while validating payment parameters. See code attribute (OPPErrorCode) andNSLocalizedDescriptionto identify the reason of failure.Declaration
Swift
@objc public static func cardPaymentParams(checkoutID: String, holder: String?, number: String, expiryMonth: String?, expiryYear: String?, cvv: String?) throws -> OPPCardPaymentParamsParameters
checkoutIDThe checkout ID of the transaction. Must be not
nilor empty.holderThe name of the card holder.
numberThe card number of the transaction.
expiryYearThe expiration year. It is expected in the format
YYYY.expiryMonthThe expiration month of the card. It is expected in the format
MM.CVVThe CVV code associated with the card. Set to
nilif CVV is not required.
-
Checks if the holder name is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isHolderValid(_ holder: String) -> BoolParameters
holderHolder of the card account.
Return Value
trueif the holder name length greater than 3 characters and less than 128 character. -
Checks if the card number is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isNumberValid(_ number: String, luhnCheck: Bool) -> BoolParameters
numberCard number.
luhnCheckSet to
trueif number should pass Luhn test http://en.wikipedia.org/wiki/Luhn_algorithm.Return Value
trueif the number consists of 10-19 digits and passes luhn test,falseif it doesn’t. -
Checks if the card expiry month is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isExpiryMonthValid(_ expiryMonth: String) -> BoolParameters
expiryMonthThe expiry month of the card.
Return Value
trueif the card expiry month is in the formatMM. -
Checks if the card expiry year is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isExpiryYearValid(_ expiryYear: String) -> BoolParameters
expiryYearThe expiry year of the card.
Return Value
trueif the card expiry year is in the formatYYYY. -
Checks if the country code is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isCountryCodeValid(_ countryCode: String) -> BoolReturn Value
trueif the country code contains digits only. -
Checks if the mobile phone is filled with sufficient data to perform a transaction.
Declaration
Swift
@objc public static func isMobilePhoneValid(_ mobilePhone: String) -> BoolReturn Value
trueif the mobile phone number contains digits only. -
Checks if the month and year have been set and whether or not card is expired.
Declaration
Swift
@objc public static func isExpired(_ month: String, and year: String) -> BoolParameters
monthThe expiry month of the card.
yearThe expiry year of the card.
Return Value
trueif the month or the year is expired.NOif the card is not expired yet.
OPPCardPaymentParams Class Reference