Skip to content

Commit

Permalink
Merge branch 'hotfix/1.11.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan committed Feb 14, 2020
2 parents f2ce5e6 + 9628893 commit 251c26c
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
HiPay iOS SDK change log and release notes
================================================

1.11.3
-----
* fix brand with space

1.11.2
-----
* Replace UIWebView (deprecated) by WKWebView
Expand Down
4 changes: 4 additions & 0 deletions Example/HiPayFullservice/HPFDemoTableViewController.m
Expand Up @@ -353,6 +353,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
else if (transactionError.userInfo[NSLocalizedFailureReasonErrorKey] != nil) {
cell.detailTextLabel.text = transactionError.userInfo[NSLocalizedFailureReasonErrorKey];
}
else if (transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey] != nil
&& transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey][@"message"] != nil) {
cell.detailTextLabel.text = transactionError.userInfo[HPFErrorCodeHTTPParsedResponseKey][@"message"];
}

return cell;
}
Expand Down
14 changes: 7 additions & 7 deletions Example/Podfile.lock
@@ -1,12 +1,12 @@
PODS:
- HiPayFullservice (1.11.2):
- HiPayFullservice/Core (= 1.11.2)
- HiPayFullservice/Payment-Screen (= 1.11.2)
- HiPayFullservice/Core (1.11.2)
- HiPayFullservice/Payment-Screen (1.11.2):
- HiPayFullservice (1.11.3):
- HiPayFullservice/Core (= 1.11.3)
- HiPayFullservice/Payment-Screen (= 1.11.3)
- HiPayFullservice/Core (1.11.3)
- HiPayFullservice/Payment-Screen (1.11.3):
- HiPayFullservice/Core
- HiPayFullservice/Utilities
- HiPayFullservice/Utilities (1.11.2):
- HiPayFullservice/Utilities (1.11.3):
- HiPayFullservice/Core
- OCMock (3.5)
- OHHTTPStubs (8.0.0):
Expand Down Expand Up @@ -38,7 +38,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
HiPayFullservice: abc2143d2c1176297aee81d01a24dde228cd6175
HiPayFullservice: 70bfb55b9315412314cbfe2a50ea403f8db76b30
OCMock: 4ab4577fc941af31f4a0398f6e7e230cf21fc72a
OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881

Expand Down
Expand Up @@ -39,9 +39,17 @@ - (void)testSettingValues
XCTAssertEqualObjects([HPFClientConfig sharedClientConfig].password, @"passwd");
XCTAssertTrue([HPFClientConfig sharedClientConfig].environment == HPFEnvironmentProduction);
XCTAssertEqualObjects([HPFClientConfig sharedClientConfig].appRedirectionURL, [NSURL URLWithString:@"hipayexample://hipay-fullservice"]);
XCTAssertNotNil([HPFClientConfig sharedClientConfig].userAgent);
XCTAssertTrue([HPFClientConfig sharedClientConfig].isPaymentCardStorageEnabled);
XCTAssertFalse([[HPFClientConfig sharedClientConfig] isEqual:@""]);

XCTestExpectation *userAgent = [[XCTestExpectation alloc] initWithDescription:@"User Agent"];
XCTWaiterResult waiter = [XCTWaiter waitForExpectations:@[userAgent] timeout:1.0];
if (waiter == XCTWaiterResultTimedOut) {
XCTAssertNotNil([HPFClientConfig sharedClientConfig].userAgent);
}
else {
XCTFail(@"Expectations error: UserAgent == nil");
}
}

- (void)testInitSchemeError
Expand Down
Expand Up @@ -49,7 +49,7 @@ - (void)testMapping
@"card_expiry_year": @"2018",
@"issuer": @"ACME Bank",
@"country": @"FR",
@"domesticNetwork": @"cb"
@"domestic_network": @"cb"
};

OCMockObject *mockedMapper = [OCMockObject partialMockForObject:[[HPFPaymentCardTokenMapper alloc] initWithRawData:rawData]];
Expand All @@ -74,7 +74,7 @@ - (void)testMapping
XCTAssertEqualObjects(@2018, paymentCardToken.cardExpiryYear);
XCTAssertEqualObjects([rawData objectForKey:@"issuer"], paymentCardToken.issuer);
XCTAssertEqualObjects([rawData objectForKey:@"country"], paymentCardToken.country);
XCTAssertEqualObjects([rawData objectForKey:@"domesticNetwork"], paymentCardToken.domesticNetwork);
XCTAssertEqualObjects([rawData objectForKey:@"domestic_network"], paymentCardToken.domesticNetwork);

[mockedMapper verify];
}
Expand Down
Expand Up @@ -75,7 +75,9 @@ - (void)testPaymentProductCodeForPlainTextNumber
[[[mockedFormatter expect] andReturn:@"51051051051051"] digitsOnlyFromPlainText:@"mastercard3"];

[[[mockedFormatter expect] andReturn:@"675941110000"] digitsOnlyFromPlainText:@"maestro1"];
[[[mockedFormatter expect] andReturn:@"670300000000"] digitsOnlyFromPlainText:@"maestro2"];
[[[mockedFormatter expect] andReturn:@"6766000000000"] digitsOnlyFromPlainText:@"maestro2"];

[[[mockedFormatter expect] andReturn:@"67030000000000003"] digitsOnlyFromPlainText:@"bcmc1"];

[[[mockedFormatter expect] andReturn:@"378282246310"] digitsOnlyFromPlainText:@"amex1"];
[[[mockedFormatter expect] andReturn:@"371449635398"] digitsOnlyFromPlainText:@"amex2"];
Expand All @@ -96,6 +98,8 @@ - (void)testPaymentProductCodeForPlainTextNumber
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"maestro1"], [NSSet setWithObject:HPFPaymentProductCodeMaestro]);
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"maestro2"], [NSSet setWithObject:HPFPaymentProductCodeMaestro]);

XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"bcmc1"], [NSSet setWithObject:HPFPaymentProductCodeBCMC]);

XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"amex1"], [NSSet setWithObject:HPFPaymentProductCodeAmericanExpress]);
XCTAssertEqualObjects([formatter paymentProductCodesForPlainTextNumber:@"amex2"], [NSSet setWithObject:HPFPaymentProductCodeAmericanExpress]);

Expand Down Expand Up @@ -258,13 +262,21 @@ - (void)testIsInRangeForPaymentProductCode
[mockedFormatter verify];

[[[mockedFormatter expect] andReturn:@"5"] digitsOnlyFromPlainText:@"maestro1"];
[[[mockedFormatter expect] andReturn:@"59"] digitsOnlyFromPlainText:@"maestro2"];
[[[mockedFormatter expect] andReturn:@"596865"] digitsOnlyFromPlainText:@"maestro3"];
[[[mockedFormatter expect] andReturn:@"639"] digitsOnlyFromPlainText:@"maestro2"];
[[[mockedFormatter expect] andReturn:@"679"] digitsOnlyFromPlainText:@"maestro3"];
XCTAssertFalse([formatter plainTextNumber:@"maestro1" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
XCTAssertTrue([formatter plainTextNumber:@"maestro2" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
XCTAssertTrue([formatter plainTextNumber:@"maestro3" isInRangeForPaymentProductCode:HPFPaymentProductCodeMaestro]);
[mockedFormatter verify];

[[[mockedFormatter expect] andReturn:@"4"] digitsOnlyFromPlainText:@"bcmc1"];
[[[mockedFormatter expect] andReturn:@"561400"] digitsOnlyFromPlainText:@"bcmc2"];
[[[mockedFormatter expect] andReturn:@"479658"] digitsOnlyFromPlainText:@"bcmc3"];
XCTAssertFalse([formatter plainTextNumber:@"bcmc1" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
XCTAssertTrue([formatter plainTextNumber:@"bcmc2" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
XCTAssertTrue([formatter plainTextNumber:@"bcmc3" isInRangeForPaymentProductCode:HPFPaymentProductCodeBCMC]);
[mockedFormatter verify];

[[[mockedFormatter expect] andReturn:@"3"] digitsOnlyFromPlainText:@"diners1"];
[[[mockedFormatter expect] andReturn:@"38"] digitsOnlyFromPlainText:@"diners2"];
[[[mockedFormatter expect] andReturn:@"398776"] digitsOnlyFromPlainText:@"diners3"];
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -54,7 +54,7 @@ GEM
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
declarative (0.0.10)
declarative-option (0.1.0)
digest-crc (0.4.1)
Expand Down Expand Up @@ -178,7 +178,7 @@ GEM
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.7)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
Expand Down
2 changes: 1 addition & 1 deletion HiPayFullservice.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "HiPayFullservice"
s.version = "1.11.2"
s.version = "1.11.3"
s.summary = "HiPay SDK for iOS lets you accept payments in your iOS application."
s.description = <<-DESC
HiPay is a new generation of payment platform optimized for todays’ e-tailers.
Expand Down
Expand Up @@ -253,8 +253,6 @@ - (void)inferPaymentProductCode

HPFPaymentProduct *newInferredPaymentProduct = [self getPaymentProductFromInferedCode:inferedPaymentProductCode];

BOOL isDomestic = [HPFPaymentProduct isPaymentProductCode:self.paymentProduct.code domesticNetworkOfPaymentProductCode:inferedPaymentProductCode];

if (newInferredPaymentProduct != inferedPaymentProduct) {
inferedPaymentProduct = newInferredPaymentProduct;

Expand All @@ -266,13 +264,11 @@ - (void)inferPaymentProductCode
}
}

if (!isDomestic) {
[self updateTitleHeader];
[self.delegate paymentProductViewController:self changeSelectedPaymentProduct:inferedPaymentProduct];
}
[self updateTitleHeader];
[self.delegate paymentProductViewController:self changeSelectedPaymentProduct:inferedPaymentProduct];
}

if ((inferedPaymentProduct == nil) && !isDomestic) {
if (inferedPaymentProduct == nil) {
paymentProductDisallowed = YES;
} else {
paymentProductDisallowed = NO;
Expand Down Expand Up @@ -517,7 +513,9 @@ - (void)submit

HPFOrderRequest *orderRequest = [self createOrderRequest];

orderRequest.paymentProductCode = (cardToken.domesticNetwork) ? cardToken.domesticNetwork : cardToken.brand;
NSString *paymentProductCode = (cardToken.domesticNetwork) ? cardToken.domesticNetwork : cardToken.brand;
paymentProductCode = [paymentProductCode stringByReplacingOccurrencesOfString:@" " withString:@"-"];
orderRequest.paymentProductCode = paymentProductCode;
orderRequest.paymentMethod = [HPFCardTokenPaymentMethodRequest cardTokenPaymentMethodRequestWithToken:cardToken.token eci:self.paymentPageRequest.eci authenticationIndicator:self.paymentPageRequest.authenticationIndicator];

[self performOrderRequest:orderRequest signature:self.signature];
Expand Down
58 changes: 57 additions & 1 deletion HiPayFullservice/Utilities/Resources/card-numbers-info.plist
Expand Up @@ -75,12 +75,67 @@
<integer>6</integer>
</array>
</dict>
<key>bcmc</key>
<dict>
<key>ranges</key>
<array>
<string>{6703,1}</string>
<string>{606005,1}</string>
<string>{479658,1}</string>
<string>{561358,1}</string>
<string>{561359,1}</string>
<string>{56136,1}</string>
<string>{56137,1}</string>
<string>{56138,1}</string>
<string>{56139,1}</string>
<string>{561400,1}</string>
<string>{561401,1}</string>
<string>{561402,1}</string>
<string>{561403,1}</string>
<string>{561404,1}</string>
<string>{561405,1}</string>
<string>{561406,1}</string>
<string>{561407,1}</string>
</array>
<key>lengths</key>
<array>
<string>{16,3}</string>
</array>
<key>format</key>
<array>
<integer>4</integer>
<integer>4</integer>
<integer>4</integer>
<integer>4</integer>
<integer>3</integer>
</array>
</dict>
<key>maestro</key>
<dict>
<key>ranges</key>
<array>
<string>{50,1}</string>
<string>{56,14}</string>
<string>{56,1}</string>
<string>{57,1}</string>
<string>{58,1}</string>
<string>{639,1}</string>
<string>{6701,1}</string>
<string>{6702,1}</string>
<string>{6704,1}</string>
<string>{6705,1}</string>
<string>{6706,1}</string>
<string>{6707,1}</string>
<string>{6708,1}</string>
<string>{6709,1}</string>
<string>{671,1}</string>
<string>{672,1}</string>
<string>{673,1}</string>
<string>{674,1}</string>
<string>{675,1}</string>
<string>{676,1}</string>
<string>{677,1}</string>
<string>{678,1}</string>
<string>{679,1}</string>
</array>
<key>lengths</key>
<array>
Expand All @@ -92,6 +147,7 @@
<integer>4</integer>
<integer>4</integer>
<integer>4</integer>
<integer>3</integer>
</array>
</dict>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion fastlane/Fastfile
Expand Up @@ -59,7 +59,7 @@ platform :ios do
desc "Deploy HiPayFullservice on Cocoapods"
lane :DeployHiPayFullservice do
# Set version number (e.g 1.0.0)
version = "1.11.2"
version = "1.11.3"

# Set version in PodSpec file
version_bump_podspec(path: "HiPayFullservice.podspec", version_number: version)
Expand Down

0 comments on commit 251c26c

Please sign in to comment.