Inherits EMModel.
Public Member Functions | |
(BOOL) | - isValid |
(BOOL) | - hasValidCardNumberForm |
(BOOL) | - hasValidCardNumberChecksum |
(BOOL) | - hasValidDate |
(BOOL) | - hasValidCVV |
(BOOL) | - isEqualTo: |
(void) | - setEqualTo: |
(BOOL) | - inferCardType: |
Properties | |
NSString * | fullName |
NSString * | cardNumber |
NSString * | cardType |
NSString * | expiryMonth |
NSString * | expiryYear |
NSString * | cvv |
NSString * | billAddressId |
- (BOOL) hasValidCardNumberChecksum |
Returns YES if the cardNumber passes the checksum algorithm.
- (BOOL) hasValidCardNumberForm |
Returns YES if the credit card type has been set, and the cardNumber meets the criteria for that card type, for example, only Visa cards begin with the number 4.
- (BOOL) hasValidCVV |
Returns YES if the card has a valid CVV. Takes cardType into consideration.
- (BOOL) hasValidDate |
Returns YES if the expiryMonth and expiryYear on this card are the current month, or later.
- (BOOL) inferCardType: | (NSString *) | inputCardNumber |
Attemps to infer the card type by examining the given inputCardNumber. Returns YES if the card type was inferred, and set on this EMCreditCard model. Otherwise returns NO if no card type could be inferred.
- (void) setEqualTo: | (EMCreditCard *) | card |
Sets card equal to the card passed in as argument