OPPCard
@interface OPPCard : NSObject
Class to encapsulate shopper’s card details that have been tokenized.
-
Name of card holder.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull holder;
Swift
var holder: String { get set }
-
The last 4 digits of the card number.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull last4Digits;
Swift
var last4Digits: String { get set }
-
The card’s expiration month.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull expiryMonth;
Swift
var expiryMonth: String { get set }
-
The card’s expiration year.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull expiryYear;
Swift
var expiryYear: String { get set }
-
Creates an
OPPCard
object from JSON.Declaration
Objective-C
+ (nullable instancetype)cardFromJSON:(nonnull NSDictionary *)JSON;
Swift
convenience init?(fromJSON JSON: [AnyHashable : Any])
Parameters
JSON
A dictionary with parameters received from the Server.
Return Value
Returns an
OPPCard
object, ornil
if JSON contains invalid values. -
Creates an
OPPCard
object with the provided values.Declaration
Objective-C
+ (nullable instancetype)cardWithHolder:(nullable NSString *)holder last4Digits:(nonnull NSString *)last4Digits expiryMonth:(nonnull NSString *)expiryMonth expiryYear:(nonnull NSString *)expiryYear;
Parameters
holder
Name of card holder.
last4Digits
The last 4 digits of the card number.
expiryMonth
The card’s expiration month.
expiryYear
The card’s expiration year.
Return Value
Returns an
OPPCard
object, ornil
if parameters are empty. -
Creates an
OPPCard
object with the provided values.Declaration
Objective-C
- (nullable instancetype)initWithHolder:(nullable NSString *)holder last4Digits:(nonnull NSString *)last4Digits expiryMonth:(nonnull NSString *)expiryMonth expiryYear:(nonnull NSString *)expiryYear;
Swift
init?(holder: String?, last4Digits: String, expiryMonth: String, expiryYear: String)
Parameters
holder
Name of card holder.
last4Digits
The last 4 digits of the card number.
expiryMonth
The card’s expiration month.
expiryYear
The card’s expiration year.
Return Value
Returns an
OPPCard
object, ornil
if parameters are empty.