Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Release 1.6.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments authored and jenkins committed May 19, 2020
1 parent fe722f2 commit 84ab631
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion IngenicoConnectExample/ICAppConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
#define kICBoletoBancarioId @"1503"
#define kICBancontactId @"3012"
#define kICArvatoIds [NSSet setWithArray:@[@"9000", @"9001"]]
#define kICApplicationIdentifier @"iOS Example Application/v1.6.4"
#define kICApplicationIdentifier @"iOS Example Application/v1.6.5"
#endif
16 changes: 14 additions & 2 deletions IngenicoConnectExample/ICCardProductViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ @interface ICCardProductViewController ()
@property (nonatomic, strong) ICIINDetailsResponse *iinDetailsResponse;
@property (strong, nonatomic) NSBundle *sdkBundle;
@property (strong, nonatomic) NSArray<ICIINDetail *> *cobrands;
@property (strong, nonatomic) NSString *previousEnteredCreditCardNumber;
@end

@implementation ICCardProductViewController
Expand Down Expand Up @@ -113,8 +114,7 @@ -(void)formatAndUpdateCharactersFromTextField:(UITextField *)texField cursorPosi
ICFormRowTextField *row = [self.formRows objectAtIndex:indexPath.row];
if ([row.paymentProductField.identifier isEqualToString:@"cardNumber"]) {
NSString *unmasked = [self.inputData unmaskedValueForField:row.paymentProductField.identifier];
if (unmasked.length >= 6 && *position <= 7) {
unmasked = [unmasked substringToIndex:6];
if (unmasked.length >= 6 && [self oneOfFirst8DigitsChangedInText:unmasked]) {

[self.session IINDetailsForPartialCreditCardNumber:unmasked context:self.context success:^(ICIINDetailsResponse *response) {
self.iinDetailsResponse = response;
Expand Down Expand Up @@ -144,9 +144,21 @@ -(void)formatAndUpdateCharactersFromTextField:(UITextField *)texField cursorPosi

}];
}
_previousEnteredCreditCardNumber = unmasked;
}
}

-(Boolean)oneOfFirst8DigitsChangedInText:(NSString *)currentEnteredCreditCardNumber {
// Add some padding, so we are sure there are 8 characters to compare.
NSString *currentPadded = [currentEnteredCreditCardNumber stringByAppendingString: @"xxxxxxxx"];
NSString *previousPadded = [_previousEnteredCreditCardNumber stringByAppendingString:@"xxxxxxxx"];

NSString *currentFirst8 = [currentPadded substringWithRange:NSMakeRange(0, 8)];
NSString *previousFirst8 = [previousPadded substringWithRange:NSMakeRange(0, 8)];

return ![currentFirst8 isEqualToString:previousFirst8];
}

-(void)initializeFormRows {
[super initializeFormRows];
NSArray<ICFormRow *> *newFormRows = [self coBrandFormsWithIINDetailsResponse:self.cobrands];
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target 'IngenicoConnectExample' do
# use_frameworks!

# Pods for IngenicoConnectExample
pod 'IngenicoConnectSDK', '~> 5.0'
pod 'IngenicoConnectSDK', '~> 5.1'
pod 'SVProgressHUD'

target 'IngenicoConnectExampleTests' do
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- IngenicoConnectSDK (5.0.0):
- IngenicoConnectSDK (5.1.0):
- AFNetworking (~> 3.0)
- SVProgressHUD (2.2.5)

Expand Down

0 comments on commit 84ab631

Please sign in to comment.